(function($) {
$.fn.easySlider = function(options){
// default configuration properties
var defaults = {
prevId: 'prevBtn',
prevText: 'Previous',
nextId: 'nextBtn',
nextText: 'Next',
controlsShow: true,
controlsBefore: '',
controlsAfter: '',
controlsFade: true,
firstId: 'firstBtn',
firstText: 'First',
firstShow: false,
lastId: 'lastBtn',
lastText: 'Last',
lastShow: false,
vertical: false,
speed: 2,
auto: false,
pause: 4000,
continuous: false,
numeric: false,
numericId: 'controls'
};
var options = $.extend(defaults, options);
this.each(function() {
var obj = $(this);
var s = $("li", obj).length;
var w = $("li", obj).width();
var h = $("li", obj).height();
var clickable = true;
obj.width(w);
obj.height(h);
obj.css("overflow","hidden");
var ts = s-1;
var t = 0;
$("ul", obj).css('width',s*w);
if(options.continuous){
$("ul", obj).prepend($("ul li:last-child", obj).clone().css("margin-left","-"+ w +"px"));
$("ul", obj).append($("ul li:nth-child(2)", obj).clone());
$("ul", obj).css('width',(s+1)*w);
};
if(!options.vertical) $("li", obj).css('float','left');
if(options.controlsShow){
var html = options.controlsBefore;
if(options.numeric){
html += '
';
} else {
if(options.firstShow) html += ''+ options.firstText +'';
html += ' '+ options.prevText +'';
html += ' '+ options.nextText +'';
if(options.lastShow) html += ' '+ options.lastText +'';
};
html += options.controlsAfter;
$(obj).after(html);
};
if(options.numeric){
for(var i=0;i'+ (i+1) +'')
.appendTo($("#"+ options.numericId))
.click(function(){
animate($("a",$(this)).attr('rel'),true);
});
};
} else {
$("a","#"+options.nextId).click(function(){
animate("next",true);
});
$("a","#"+options.prevId).click(function(){
animate("prev",true);
});
$("a","#"+options.firstId).click(function(){
animate("first",true);
});
$("a","#"+options.lastId).click(function(){
animate("last",true);
});
};
function setCurrent(i){
i = parseInt(i)+1;
$("li", "#" + options.numericId).removeClass("current");
$("li#" + options.numericId + i).addClass("current");
};
function adjust(){
if(t>ts) t=0;
if(t<0) t=ts;
if(!options.vertical) {
$("ul",obj).css("margin-left",(t*w*-1));
} else {
$("ul",obj).css("margin-left",(t*h*-1));
}
clickable = true;
if(options.numeric) setCurrent(t);
};
function animate(dir,clicked){
if (clickable){
clickable = false;
var ot = t;
switch(dir){
case "next":
t = (ot>=ts) ? (options.continuous ? t+1 : ts) : t+1;
break;
case "prev":
t = (t<=0) ? (options.continuous ? t-1 : 0) : t-1;
break;
case "first":
t = 0;
break;
case "last":
t = ts;
break;
default:
t = dir;
break;
};
var diff = Math.abs(ot-t);
var speed = diff*options.speed;
if(!options.vertical) {
p = (t*w*-1);
$("ul",obj).animate(
{ marginLeft: p },
{ queue:false, duration:speed, complete:adjust }
);
} else {
p = (t*h*-1);
$("ul",obj).animate(
{ marginTop: p },
{ queue:false, duration:speed, complete:adjust }
);
};
if(!options.continuous && options.controlsFade){
if(t==ts){
$("a","#"+options.nextId).hide();
$("a","#"+options.lastId).hide();
} else {
$("a","#"+options.nextId).show();
$("a","#"+options.lastId).show();
};
if(t==0){
$("a","#"+options.prevId).hide();
$("a","#"+options.firstId).hide();
} else {
$("a","#"+options.prevId).show();
$("a","#"+options.firstId).show();
};
};
if(clicked) clearTimeout(timeout);
if(options.auto && dir=="next" && !clicked){;
timeout = setTimeout(function(){
animate("next",false);
},diff*options.speed+options.pause);
};
};
};
// init
var timeout;
if(options.auto){;
timeout = setTimeout(function(){
animate("next",false);
},options.pause);
};
if(options.numeric) setCurrent(0);
if(!options.continuous && options.controlsFade){
$("a","#"+options.prevId).hide();
$("a","#"+options.firstId).hide();
};
});
};
})(jQuery);
$(document).ready(function(){
$("#slider").easySlider({
auto: true,
continuous: true,
numeric: true
});
});
window.addEvent('load', function() {
new JCaption('img.caption');
});
var hwdms_live_site = "";
jQuery(document).ready(function(){
jQuery("#featuredslider-637 > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 4000, true);
});
jQuery(document).ready(function($){
//Full Caption Sliding (Hidden to Visible)
$('.boxgrid.captionfull').hover(function(){
$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:60});
}, function() {
$(".cover", this).stop().animate({top:'-50px'},{queue:false,duration:160});
});
});
window.addEvent('load', function() {
new JCaption('img.caption');
});
var hwdms_live_site = "";
window.addEvent('domready', function() {
SqueezeBox.initialize({});
SqueezeBox.assign($$('a.modal'), {
parse: 'rel'
});
});
(function($){ window.addEvent('domready',function(){this.Slider246 = new DJImageSlider({id: '246', slider_type: 2, slide_size: 735, visible_slides: 1, show_buttons: 1, show_arrows: 1, preload: 300},{auto: 1, transition: Fx.Transitions.linear, duration: 600, delay: 3600})}); })(document.id);
(function($){ window.addEvent('domready',function(){this.Slider427 = new DJImageSlider({id: '427', slider_type: 2, slide_size: 650, visible_slides: 1, show_buttons: 1, show_arrows: 1, preload: 800},{auto: 1, transition: Fx.Transitions.linear, duration: 600, delay: 3600})}); })(document.id);
jQuery(function($){
$('.marquee').marquee();
$('.rwsjquerymarque').marquee({
//speed in milliseconds of the marquee
speed: 60000,
//gap in pixels between the tickers
gap: 10,
//gap in pixels between the tickers
delayBeforeStart: 0,
//'left' or 'right'
direction: 'right',
//true or false - should the marquee be duplicated to show an effect of continues flow
duplicated: true,
//on hover pause the marquee - using jQuery plugin https://github.com/tobia/Pause
pauseOnHover: true
});
//pause and resume links
$('.pause').click(function(e){
e.preventDefault();
$('.rwsjquerymarque').trigger('pause');
});
$('.resume').click(function(e){
e.preventDefault();
$('.rwsjquerymarque').trigger('resume');
});
//toggle
$('.toggle').hover(function(e){
$('.rwsjquerymarque').trigger('pause');
},function(){
$('.rwsjquerymarque').trigger('resume');
})
.click(function(e){
e.preventDefault();
})
});
Date.prototype.stdTimezoneOffset = function() {
var jan = new Date(this.getFullYear(), 0, 1);
var jul = new Date(this.getFullYear(), 6, 1);
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
};
Date.prototype.dst = function() {
return this.getTimezoneOffset() < this.stdTimezoneOffset();
};
function ISO8601Local524(date) {
// handles years from 0000 to 9999 only
var offset524 = date.getTimezoneOffset();
var offsetSign524 = "-";
if (offset524 <= 0) {
offsetSign524 = "+";
offset524 = -offset524;
};
var offsetHours524 = Math.floor(offset524 / 60);
var offsetMinutes524 = offset524 - offsetHours524 * 60;
return ("000" + date.getFullYear()).slice(-4) +
"-" + ("0" + (date.getMonth() + 1)).slice(-2) +
"-" + ("0" + date.getDate()).slice(-2) +
"T" + ("0" + date.getHours()).slice(-2) +
":" + ("0" + date.getMinutes()).slice(-2) +
":" + ("0" + date.getSeconds()).slice(-2) +
"," + ("00" + date.getMilliseconds()).slice(-3) +
offsetSign524 + ("0" + offsetHours524).slice(-2) +
":" + ("0" + offsetMinutes524).slice(-2);
};
(function(a){a.fn.marquee=function(b){return this.each(function(){var j=a.extend({},a.fn.marquee.defaults,b),i=a(this),g,h,d,f;j=a.extend({},j,i.data());j.gap=j.duplicated?j.gap:0;i.wrapInner('');var e=i.find(".js-marquee").css({"margin-right":j.gap,"float":"left"});if(j.duplicated){e.clone().appendTo(i)}i.wrapInner('');f=i.find(".js-marquee:first").width()+j.gap;g=i.find(".js-marquee-wrapper");h=i.width();j.speed=((parseInt(f,10)+parseInt(h,10))/parseInt(h,10))*j.speed;if(j.duplicated){j.speed=j.speed/2}var c=function(){if(!j.duplicated){g.css("margin-left",j.direction=="left"?h:"-"+f+"px");d={"margin-left":j.direction=="left"?"-"+f+"px":h}}else{g.css("margin-left",j.direction=="left"?0:"-"+f+"px");d={"margin-left":j.direction=="left"?"-"+f+"px":0}}i.trigger("beforeStarting");g.animate(d,j.speed,"linear",function(){i.trigger("finished");c()})};i.on("pause",function(){g.pause()});i.on("resume",function(){g.resume()});if(j.pauseOnHover){i.hover(function(){if(a.fn.pause){g.pause()}},function(){if(a.fn.resume){g.resume()}})}setTimeout(c,j.delayBeforeStart)})};a.fn.marquee.defaults={speed:5000,gap:20,delayBeforeStart:0,direction:"left",duplicated:false,pauseOnHover:false}})(jQuery);
jQuery(document).ready(function($){
$("input[name$='type']").click(function(){
var value = $(this).val();
if(value=='Individual') {
$("#Individual_box").show();
$("#Company_box").hide();
}
else if(value=='Company') {
$("#Company_box").show();
$("#Individual_box").hide();
}
});
$("#Individual_box").show();
$("#Company_box").hide();
});
$(document).ready(function() {
//Default Action
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").addClass("active").show(); //Activate first tab
$(".tab_content:first").show(); //Show first tab content
//On Click Event
$("ul.tabs li").click(function() {
$("ul.tabs li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tab_content").hide(); //Hide all tab content
var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active content
return false;
});
});
/* $(document).ready(function() {
$().UItoTop({ easingType: 'easeOutQuart' });
}); */
function CheckArabicOnly(field)
{
var sNewVal = "";
var sFieldVal = field.value;
for(var i = 0; i < sFieldVal.length; i++) {
var ch = sFieldVal.charAt(i);;
var c = ch.charCodeAt(0);
if(c < 1536 || c > 1791) {
// Discard
}
else {
sNewVal = field.value;
}
}
field.value = sNewVal;
}
function checkheadsearch()
{
var form = document.searchheadpage;
if(form.searchword.value == "")
{
alert("Please Enter Arabic searchword");
form.searchword.focus();
return false;
}
}
/* Superior Web Systems */
function displayHideBox(boxNumber)
{
if(document.getElementById("LightBox"+boxNumber).style.display=="none") {
document.getElementById("LightBox"+boxNumber).style.display="block";
document.getElementById("grayBG").style.display="block";
} else {
document.getElementById("LightBox"+boxNumber).style.display="none";
document.getElementById("grayBG").style.display="none";
}
}
$(document).ready(function() {
$().UItoTop({ easingType: 'easeOutQuart' });
});
// Body Mass Index Calculator
// copyright 28th April 2006, by Stephen Chapman
// permission to use this Javascript on your web page is granted
// provided that all of the code in this script (including these
// comments) is used without any alteration
function valButton(btn) {var cnt = -1;for (var i=btn.length-1; i > -1; i--) { if (btn[i].checked) {cnt = i; i = -1;}}if (cnt > -1) return btn[cnt].value;else return null;}function stripBlanks(fld) {var result = "";var c = 0;for (i=0; i < fld.length; i++) {if (fld.charAt(i) != " " || c > 0) {result += fld.charAt(i);if (fld.charAt(i) != " ") c = result.length;}}return result.substr(0,c);}function calc(thisform) {var d = valButton(thisform.d);if (d == null) {alert("You must choose centimetres/kg or inches/lb");return false;}cv = d.split(',');;var h = stripBlanks(thisform.h.value);if (h == '') {alert("You must enter your height");thisform.h.focus();return false;}if (h != Number(h) || (h = Number(h*cv[0]/100)) < 1 || h > 2.5) {alert("Invalid height entered");thisform.h.focus();return false;}var w = stripBlanks(thisform.w.value);if (w == '') {alert("You must enter your weight");thisform.w.focus();return false;}if (w != Number(w) || (w = Number(w/cv[1])) < 25 || w > 250) {alert("Invalid weight entered");thisform.w.focus();return false;} thisform.f.value = Math.round(w / (h*h)*100)/100;}
function dream(value) {
var prob = document.getElementById("toggleText"+value);
var text = document.getElementById("displayText"+value);
if(prob.style.display == "block")
{
prob.style.display = "none";
}
else
{
prob.style.display = "block";
text.innerHTML = "إغلاق";
}
}
function validateEmail(elementValue){
var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
return emailPattern.test(elementValue);
}
$(function(){
$('#new_tell_form_submit').submit(function(e){
e.preventDefault();
cate_id = $("#cate_id").val();
name = $("#name").val();
email = $("#email").val();
var validate_email = validateEmail(email);
question = $("#question").val();
if(cate_id == '')
{
alert('Select Doctor Name');
document.getElementById("cate_id").focus();
return false;
}
if(name == '')
{
alert('Enter the Name');
document.getElementById("name").focus();
return false;
}
else if(email == '')
{
alert('Enter the Email');
document.getElementById("email").focus();
return false;
}
if(validate_email == false)
{
alert("Enter Valid Email address");
document.getElementById("email").focus();
return false;
}
else if(question == '')
{
alert('Enter the Question');
document.getElementById("question").focus();
return false;
}
else
{
var datastr = 'cate_id='+cate_id+'&name='+name + '&email='+email+'&question='+question;
$.ajax({
type : 'POST',
url : 'index.php/contact/askdoctor_success',
data : datastr,
success : function(html)
{
if(html == 1)
{
document.getElementById("askdoctormessages").style.marginTop="21px";
document.getElementById("askdoctormessages").style.marginBottom="25px";
document.getElementById("askdoctormessages").style.textAlign="center";
document.getElementById('askdoctormessages').innerHTML = 'Thank You for your Question';
$('#new_tell_form_submit').slideUp();
}
else if(html == 2)
{
document.getElementById('askdoctormessages').innerHTML = 'Enter the Valid Verification Code';
}
else
{
document.getElementById('askdoctormessages').innerHTML = 'Error Occur. Try again Later';
}
}
});
}
});
});
function contact_check()
{
var form = document.contact_page;
if(form.contact_name.value == "")
{
alert("Enter The Contact Name");
form.contact_name.focus();
return false;
}
else if(form.contact_email.value == "")
{
alert("Enter The Email id");
form.contact_email.focus();
return false;
}
var validate_email = validateEmail(form.contact_email.value);
if(validate_email == false) {
alert("Enter Valid Email address");
form.contact_email.focus();
form.contact_email.value = "";
return false;
}
else if(form.contact_subject.value == "")
{
alert("Enter The Subject");
form.contact_subject.focus();
return false;
}
else if(form.contact_message.value == "")
{
alert("Enter The Message");
form.contact_message.focus();
return false;
}
}
function citizen_check()
{
var form = document.citizen_page;
if(form.thread_title.value == "")
{
alert("Enter The Thread Title");
form.thread_title.focus();
return false;
}
if(form.text.value == "")
{
alert("Enter The Text");
form.text.focus();
return false;
}
else if(form.first_name.value == "")
{
alert("Enter The First Name");
form.first_name.focus();
return false;
}
else if(form.fame.value == "")
{
alert("Enter The Name of Fame");
form.fame.focus();
return false;
}
else if(form.journ_email.value == "")
{
alert("Enter The Email id");
form.journ_email.focus();
return false;
}
var validate_email = validateEmail(form.journ_email.value);
if(validate_email == false) {
alert("Enter Valid Email address");
form.journ_email.focus();
form.journ_email.value = "";
return false;
}
}