function f_login_validate()
{
	if (document.f_login.username.value == "")
	{
		alert("Please enter username.")
		document.f_login.username.focus();
		return false;
	}
	if (document.f_login.userpwd.value == "")
	{
		alert("Please enter password.")
		document.f_login.userpwd.focus();
		return false;
	}

	return true;
}


function f_contactus_validate()
{
	if (document.f_contactus.username.value == "")
	{
		alert("Please enter User Name")
		document.f_contactus.username.focus();
		return false;
	}
	
	if (document.f_contactus.email.value == "")
	{
		alert("Please enter email.")
		document.f_contactus.email.focus();
		return false;
	}

	if(document.f_contactus.email.value !='') 
    {
		var atsign=document.f_contactus.email.value.indexOf("@");
		var period=document.f_contactus.email.value.lastIndexOf(".");
		var  len=document.f_contactus.email.value.length;
		if  ((atsign == 0) || (period <= (atsign+1)) || ((len-1)<=period) || (atsign == -1) || (period == -1))
		{
			 alert("Please enter a proper email address.");
			 document.f_contactus.email.focus();
			 return false;
		}
     }
	 else
	{
		 alert("Please enter email")
		 document.f_contactus.email.focus();
		 return false;
	}
	
	if (document.f_contactus.feedback.value == "")
	{
		alert("Please enter feedback.")
		document.f_contactus.feedback.focus();
		return false;
     }



	return true;
}

// Forgot pwd fucntions
 function f_forgot_pwd_validate()
{
	if (document.f_forgot_pwd.email.value == "")
	{
		alert("Please enter email.")
		document.f_forgot_pwd.email.focus();
		return false;
	}

	if(document.f_forgot_pwd.email.value !='') 
    {
		var atsign=document.f_forgot_pwd.email.value.indexOf("@");
		var period=document.f_forgot_pwd.email.value.lastIndexOf(".");
		var  len=document.f_forgot_pwd.email.value.length;
		if  ((atsign == 0) || (period <= (atsign+1)) || ((len-1)<=period) || (atsign == -1) || (period == -1))
		{
			 alert("Please enter a proper email address.");
			 document.f_forgot_pwd.email.focus();
			 return false;
		}
     }
	 else
	{
		 alert("Please enter email")
		 document.f_forgot_pwd.email.focus();
		 return false;
	}

	return true;
}

function errorMsg(msg) 
{
	alert(msg);
	return true;
}


// Footer Function
function MM_openBrWindow(path, width, height) 
{ 
	//var width = 500
	//var height = 400
	LeftPosition = (screen.width-width) / 2;
	TopPosition = (screen.height-height) / 2;
	window.open(path+"","Privacy","fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,directories=no,location=no,width="+width+",height="+height+",top="+TopPosition+",left="+LeftPosition)
}

// Footer Function
function MM_openBrWindowGallery(path, width, height) 
{ 
	//var width = 500
	//var height = 400
	LeftPosition = (screen.width-width) / 2;
	TopPosition = (screen.height-height) / 2;
	window.open(path+"","Privacy","fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,directories=no,location=no,width="+width+",height="+height+",top=0,left=0")
}

function f_onlineAppointments_validate()
{
	if(document.f_onlineAppointments.txtName.value == "")
	{
		alert("Please enter name")
		document.f_onlineAppointments.txtName.focus();
		return false;
	}
	if(document.f_onlineAppointments.txtAge.value == "")
	{
		alert("Please enter Age")
		document.f_onlineAppointments.txtAge.focus();
		return false;
	}
	if (isNaN(document.f_onlineAppointments.txtAge.value))
	{
		alert("Please enter age as numeric")
		document.f_onlineAppointments.txtAge.value="";
		document.f_onlineAppointments.txtAge.focus();
		return false;
	}
	if(document.f_onlineAppointments.drpSex.value == "")
	{
		alert("Please select Zender")
		document.f_onlineAppointments.drpSex.focus();
		return false;
	}

	if(document.f_onlineAppointments.txtAddress.value == "")
	{
		alert("Please enter Address")
		document.f_onlineAppointments.txtAddress.focus();
		return false;
	}

    if(document.f_onlineAppointments.txtCity.value == "")
	{
		alert("Please enter City")
		document.f_onlineAppointments.txtCity.focus();
		return false;
	}

	if(document.f_onlineAppointments.txtZipcode.value == "")
	{
		alert("Please enter Zipcode")
		document.f_onlineAppointments.txtZipcode.focus();
		return false;
	}

	if(document.f_onlineAppointments.drpCountry.value == "")
	{
		alert("Please select Country")
		document.f_onlineAppointments.drpCountry.focus();
		return false;
	}

	if(document.f_onlineAppointments.txtPhone.value == "")
	{
		alert("Please enter Phone number")
		document.f_onlineAppointments.txtPhone.focus();
		return false;
	}
	if (isNaN(document.f_onlineAppointments.txtPhone.value))
	{
		alert("Please enter Phone number as numeric")
		document.f_onlineAppointments.txtPhone.value="";
		document.f_onlineAppointments.txtPhone.focus();
		return false;
	}

	if(document.f_onlineAppointments.txtEmail.value == "")
	{
		alert("Please enter Email")
		document.f_onlineAppointments.txtEmail.focus();
		return false;
	}

	if(document.f_onlineAppointments.txtEmail.value !='') 
    {
		var atsign=document.f_onlineAppointments.txtEmail.value.indexOf("@");
		var period=document.f_onlineAppointments.txtEmail.value.lastIndexOf(".");
		var  len=document.f_onlineAppointments.txtEmail.value.length;
		if  ((atsign == 0) || (period <= (atsign+1)) || ((len-1)<=period) || (atsign == -1) || (period == -1))
		{
			 alert("Please enter a proper email address.");
			 document.f_onlineAppointments.txtEmail.focus();
			 return false;
		}
     }
	 else
	{
		 alert("Please enter email")
		 document.f_onlineAppointments.txtEmail.focus();
		 return false;
	}

	if(document.f_onlineAppointments.chkCheckup.checked == "" && document.f_onlineAppointments.chkConsultations.checked == "" && document.f_onlineAppointments.chkCleaning_polishing.checked == "" && document.f_onlineAppointments.chkWhitening.checked == "" && document.f_onlineAppointments.chkBraces.checked == "" && document.f_onlineAppointments.chkFilling_Root_Canal.checked == "" && document.f_onlineAppointments.chkExtraction_Surgery.checked == "" && document.f_onlineAppointments.chkEmergencycare.checked == "" && document.f_onlineAppointments.chkImplants.checked == "" )
	{	
		alert("Please select appointment type")
		document.f_onlineAppointments.chkCheckup.focus();
		return false;
	}
	
	if(document.f_onlineAppointments.appointmentdate1.value == "" && document.f_onlineAppointments.appointmentdate2.value == "" && document.f_onlineAppointments.appointmentdate3.value == "")
	{
		alert("Please enter date")
		document.f_onlineAppointments.appointmentdate1.focus();
		return false;
	}

	if(document.f_onlineAppointments.txtTime1.value == "" && document.f_onlineAppointments.txtTime2.value == "" && document.f_onlineAppointments.txtTime3.value == "")
	{
		alert("Please enter time")
		document.f_onlineAppointments.txtTime1.focus();
		return false;
	}
	

   
}

function f_feedback_validate()
{
	if(document.f_feedback.txtName.value == "")
	{
		alert("Please enter name")
		document.f_feedback.txtName.focus();
		return false;
	}
	if(document.f_feedback.txtOccupation.value == "")
	{
		alert("Please enter Occupation")
		document.f_feedback.txtOccupation.focus();
		return false;
	}
	
	if(document.f_feedback.txtAddress.value == "")
	{
		alert("Please enter your Address")
		document.f_feedback.txtAddress.focus();
		return false;
	}

	if(document.f_feedback.txtEmail.value == "")
	{
		alert("Please enter Email")
		document.f_feedback.txtEmail.focus();
		return false;
	}

	if(document.f_feedback.txtEmail.value !='') 
    {
		var atsign=document.f_feedback.txtEmail.value.indexOf("@");
		var period=document.f_feedback.txtEmail.value.lastIndexOf(".");
		var  len=document.f_feedback.txtEmail.value.length;
		if  ((atsign == 0) || (period <= (atsign+1)) || ((len-1)<=period) || (atsign == -1) || (period == -1))
		{
			 alert("Please enter a proper email address.");
			 document.f_feedback.txtEmail.focus();
			 return false;
		}
     }
	 else
	{
		 alert("Please enter email")
		 document.f_feedback.txtEmail.focus();
		 return false;
	}
     
	if(document.f_feedback.txtfeedback.value == "")
	{
		alert("Please enter feedback")
		document.f_feedback.txtfeedback.focus();
		return false;
	}
	  
	return true;
}

function popup_PhotoGallery(path)
{
var width = 1000
var height = 700

LeftPosition = ((document.body.offsetWidth-width) / 2)-15;
TopPosition = ((document.body.offsetHeight-height) / 2)+120;
window.open(path, "PhotoGallery", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width="+width+",height="+height+",top="+TopPosition+",left="+LeftPosition)

}

// To Disable right click on every page. This function will call automitacially, when this page is included.
 
 /*
	var message = "ADS Dental Hospitals"; 
	function rtclickcheck(keyp)
		{ 
		if (navigator.appName == "Netscape" && keyp.which == 3)
			{ 	
				alert(message); 
				return false; 
			}
		if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) 
			{ 	
				alert(message); 	
				return false; 
			} 
	} 
	document.onmousedown = rtclickcheck;
	
	*/

// End right click

function statusBar()
{

}