function RemoveRequestdateApp()
{
	document.frmappointment.Other_Date.value="";
	document.frmappointment.Other_Date.focus();
}

function SetRequestdateApp()
{
	document.frmappointment.Other_Date.value="mm/dd/yyyy";
}

function checkFormApp()
{
	if(document.frmappointment.patient_name.value=="")
	{
		alert("Please enter name.");
		document.frmappointment.patient_name.focus();
		return false;
	}
	else if(document.frmappointment.patient_email.value=="")
	{
		alert("Please enter email address.");
		document.frmappointment.patient_email.focus();
		return false;
	}
	else if(document.frmappointment.patient_phone.value=="") 
	{
		alert("Please enter phone number.");				document.frmappointment.patient_phone.focus();
		return false;
	}
	else if(document.frmappointment.RequestDate.value="Other Date")
	{
	if(document.frmappointment.Other_Date.value=="")
	{
		alert("Please enter date.");
		document.frmappointment.Other_Date.focus();
		return false;
	}
	}
	else if(document.frmappointment.Appointment_Reason.value=="")
	{
		alert("Please enter problem or need for appointment.");
		document.frmappointment.Appointment_Reason.focus();
		return false;
	}
	else 
	{
		return true;
	}
}

function checkFormContact()
{
	if(document.frmcontact.Patient_Name.value=="")
	{
		alert("Please enter name.");
		document.frmcontact.Patient_Name.focus();
		return false;
	}
	else if(document.frmcontact.Patient_Email.value=="")
	{
		alert("Please enter email address.");
		document.frmcontact.Patient_Email.focus();
		return false;
	}
	else if(document.frmcontact.patient_phone.value=="") 
	{
		alert("Please enter phone number.");				document.frmcontact.patient_phone.focus();
		return false;
	}
	else if(document.frmcontact.Patient_Question.value=="")
	{
		alert("Please enter your question.");
		document.frmcontact.Patient_Question.focus();
		return false;
	}
	else 
	{
		return true;
	}
}

function mypopup(url)
{
	window.open(url,"_blank","width=820, height=670,left=100,top=100, location=no, directories=no, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes");
}

function check_accesscode()
{
	if(document.forms[0].access_code.value == "")
	{
		alert("Please enter access code.");
		document.forms[0].access_code.focus();
		return false;
	}
	else
	{
		document.forms[0].submit();
	}
}

function showGallery(Procedure)
{
	document.frm_detail.Procedure_txt.value = Procedure;
	document.frm_detail.submit();
}

function showGalleryDetails(Procedure,Gallery)
{
	document.frm_detail.Procedure_txt.value = Procedure;
	document.frm_detail.Gallery_txt.value = Gallery;
	document.frm_detail.submit();
}

/**********/

function createRequest()
{
	try 
	{
		ajaxRequest = new XMLHttpRequest();
	} 
	catch (trymicrosoft) 
	{
		try 
		{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (othermicrosoft) 
		{
			try 
			{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (failed) 
			{
				ajaxRequest = null;
			}
		}
	}
	if (ajaxRequest == null)
		alert("Error creating request object!");
}

function displayVideo(url)
{
	var id = document.selectProcedure.selProcedure.value;
	createRequest();
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == "4")
		{
			if(ajaxRequest.responseText!="")
			{
				////alert(ajaxRequest.responseText);
				document.getElementById("selectedVideo").style.display='';
				document.getElementById("selectedVideo").innerHTML= ajaxRequest.responseText;
			}
		}
	}
	var url1 = url + "?id=" + id;
	ajaxRequest.open("GET", url1, true);
	ajaxRequest.send(null);
}

function showGalleryPhotos()
{
	document.frm_show.flag_show.value = "1";
	document.frm_show.submit();
}

function showGalleryVideo()
{
	document.frm_show.flag_show.value = "2";
	document.frm_show.submit();
}

function selDentists()
{
	document.form1.submit();
}

function selDentistsA()
{
	document.form1.submit();
}

function selDentistsH()
{
	document.form1.submit();
}
