
			
			
			/*function ShowHide()
			{
			
				var mydiv=document.getElementById("searchdiv");
				var down=document.getElementById("ahrefdown");
				var up=document.getElementById("ahrefup");
				
				if(mydiv.style.display=='none')
				{
					
					mydiv.style.display='block';
					up.style.display='block';
					down.style.display='none';
					
				}
				else
				{
					
					mydiv.style.display='none';
					up.style.display='none';
					down.style.display='block';			
				
				}
				
				
			}*/
			function IsNumeric(str)
			{
			var reg =/^[0-9]+$/;
			 
			if(!reg.test(str))
			return false;
			    
			return true;
			}

			
			
			function ValidateHealthCheckSchedules()
			{
				
				var msgStr="";
				if(document.getElementById("DDlHoursFrom").value=="")
				{
					msgStr+="\n - Please Select Slot Start Time-Hour";
				}
				if(document.getElementById("DDlHoursTo").value=="")
				{
					msgStr+="\n - Please Select Slot End Time-Hour";
				}
				if(document.getElementById("TxtCapacity").value=="")
				{
					msgStr+="\n - Please Enter slot capacity";
				}
				if(msgStr!="")
				{
					alert(msgStr);
					return false;
				}
			
			}
			
			function ValidateDiagnosticSchedules()
			{
				
				var msgStr="";
				if(document.getElementById("DDlHoursFrom").value=="")
				{
					msgStr+="\n - Please Select Slot Start Time-Hour";
				}
				if(document.getElementById("DDlHoursTo").value=="")
				{
					msgStr+="\n - Please Select Slot End Time-Hour";
				}
				if(document.getElementById("TxtCapacity").value=="")
				{
					msgStr+="\n - Please Enter slot capacity";
				}
				if(msgStr!="")
				{
					alert(msgStr);
					return false;
				}
			
			}
			
			function ValidateAddDiagnosticTests()
			{
			 
			 var msgStr="";
			 if(document.getElementById("ddlDiagnosticName").value=="")
			 {
				msgStr+="\n - Select Diagnostic Name";	
			 }
			 if(document.getElementById("ddlDiagnosticTests").value=="")
			 {
				msgStr+="\n - Select Diagnostic Test";	
			 }
			  if(msgStr!="")
				{
					alert(msgStr);
					return false;
				}
			
			}
			
			
			function Validate_Search_DoctorName()
			{
				if(document.getElementById("txtDoctorName").value.trim()=="")
				{
					alert('Please enter Doctor name');
					return false;
				}
				else if(document.getElementById("txtDoctorName").value.trim().length<3)
				{
					alert('Please enter Minimum 3 characters for searching doctor');
					return false;
				}
				else
				{
					return true;
				}
			}
			
			
			function Validate_Search_Speciality()
			{
			
				var speciality = document.getElementById("ddlquickspeciality").value;
				var city = document.getElementById("ddlquickcity").value;
				
					if(speciality == "0" && city == "0")
					{
						alert('Please select Specialty or City');
						return false;
						
					}
					else
					{
						return true;
					}
									
				
			}	
			
			
			function Validate_Search_Advanced()
			{
			
				
				var speciality = document.getElementById("ddlquickspeciality").value;
				var city = document.getElementById("ddlquickcity").value;
				var doctor=document.getElementById("txtDoctorName").value;
				var superspeciality=document.getElementById("ddlSuperSpeciality").value;
				if(speciality == "0" && city == "0" && doctor.trim()=="" && superspeciality == "0")
				{
					alert('Please enter Doctor name or Select Specialty or City or Sub Specialty');
					return false;
				}
				else
				{
				
					return true;
				}
				
					 
				
			}
			
			
			String.prototype.trim = function() 
			{
				return this.replace(/^\s+|\s+$/g,"");
			}
			
			String.prototype.ltrim = function() 
			{
				return this.replace(/^\s+/,"");
			}

			String.prototype.rtrim = function() 
			{
				return this.replace(/\s+$/,"");
			}

	function setSearchValues()
	{
	
		//var messageString="";
		
		/*// As there is problem with IE 6.0 the dropdowns are to invisible mode.
		document.getElementById("ddlquickcity").style.display='none';
		document.getElementById("ddlquickspeciality").style.display='none';
		
		document.getElementById("ddlAppointmentTypes").style.display='none';
		document.getElementById("ddlCities").style.display='none';
		document.getElementById("ddlHospitals").style.display='none';
		
		document.getElementById("overlay_modal1").style.display='block';
		
		document.getElementById("objFlash").style.display='none';
		//document.getElementById("flashbanner").style.display='none';
		
		document.getElementById("searchdiv").style.display='block';
		document.getElementById("overlay_modal1").style.display='block';
		document.getElementById("overlay_modal1").style.height='680px';
		*/
		
		var mydiv=document.getElementById("searchdiv");
		//var indiv=document.getElementById("in");
		//var outdiv=document.getElementById("out");
		if(mydiv.style.display=='none')
		{
		mydiv.style.display='block';
		//		indiv.style.display='block';
		//outdiv.style.display='none';
		
		}else
		{
		mydiv.style.display='none';

		
		//indiv.style.display='none';
		//outdiv.style.display='block';			
		
		}

		return false;
	 
	}
	
	
	



		//On Submit Get Dropdown Values
	function OnSubmitGetValues()
	 {
		
		var flag = "true";
	
		if(document.getElementById("ddlAppointmentTypes").value == "0" || document.getElementById("ddlAppointmentTypes").value == "")
		{
			flag = "false";
			alert("Select Appointment Type");
		}
		else if(document.getElementById("ddlCities").value == "0" || document.getElementById("ddlCities").value == "") 
		{
			flag = "false";
			alert("Select Location");
		}
		else if(document.getElementById("ddlHospitals").value == "0" || document.getElementById("ddlHospitals").value == "")
		{
			flag = "false";
			alert("Select Hospital");
		}
		else
		{
			document.getElementById("AppTypeId").value=document.getElementById("ddlAppointmentTypes").value;
			document.getElementById("CityId").value=document.getElementById("ddlCities").value;
			document.getElementById("HospitalId").value=document.getElementById("ddlHospitals").value;
					
			var op = document.getElementById("ddlHospitals");
			var HospitalName = op.options[op.selectedIndex].text;
			document.getElementById("HospitalName").value = HospitalName;
	
			var op = document.getElementById("ddlCities");
			var CityName = op.options[op.selectedIndex].text;
			document.getElementById("CityName").value = CityName;
		
		}
		
		if(flag == "false")
		{
			return false;
		}
		else if(flag == "true")
		{
			return true;
		}
	
	}
	
	/*
	
var mapCities=new Array();

mapCities[1] = new Array('0','SELECT CITY','1','CHENNAI','12','HYDERABAD','13','KOLKATA','1653','SECUNDERABAD','1983','VISAKHAPATNAM','2741','NEW DELHI','2761','AHMEDABAD','3015','BANGALORE','6009','NOIDA');
mapCities[2] = new Array('0','SELECT CITY','12','HYDERABAD','1983','VISAKHAPATNAM');
mapCities[3] = new Array('0','SELECT CITY','1','CHENNAI','12','HYDERABAD','13','KOLKATA','1653','SECUNDERABAD','1983','VISAKHAPATNAM','2741','NEW DELHI','3015','BANGALORE','6009','NOIDA');

var mapConHospitals=new Array();

mapConHospitals[1] = new Array('0','SELECT HOSPITAL','2','APOLLO HOSPITALS, GREAMS ROAD');
mapConHospitals[12] = new Array('0','SELECT HOSPITAL','15','APOLLO EMERGENCY CENTER, KUKATPALLY','13','APOLLO EMERGENCY HOSPITAL, HYDERGUDA','1','APOLLO HEALTH CITY, JUBILEE HILLS');
mapConHospitals[13] = new Array('0','SELECT HOSPITAL','20','APOLLO GLENEAGLES HOSPITAL LIMITED');
mapConHospitals[1653] = new Array('0','SELECT HOSPITAL','14','APOLLO HOSPITALS, VIKRAMPURI');
mapConHospitals[1983] = new Array('0','SELECT HOSPITAL','17','APOLLO HOSPITAL, WALTAIR MAIN ROAD');
mapConHospitals[2741] = new Array('0','SELECT HOSPITAL','12','INDRAPRASTHA APOLLO HOSPITALS');
mapConHospitals[2761] = new Array('0','SELECT HOSPITAL','19','APOLLO HOSPITALS INTERNATIONAL LIMITED');
mapConHospitals[3015] = new Array('0','SELECT HOSPITAL','16','APOLLO HOSPITALS, BANNERGHATTA ROAD');
mapConHospitals[6009] = new Array('0','SELECT HOSPITAL','18','APOLLO HOSPITALS, NOIDA');


var mapDiaHospitals=new Array();

mapDiaHospitals[12] = new Array('0','SELECT HOSPITAL');
mapDiaHospitals[1983] = new Array('0','SELECT HOSPITAL');


var mapHckHospitals=new Array();

mapHckHospitals[1] = new Array('0','SELECT HOSPITAL','2','APOLLO HOSPITALS, GREAMS ROAD');
mapHckHospitals[12] = new Array('0','SELECT HOSPITAL','1','APOLLO HEALTH CITY, JUBILEE HILLS');
mapHckHospitals[13] = new Array('0','SELECT HOSPITAL','20','APOLLO GLENEAGLES HOSPITAL LIMITED');
mapHckHospitals[1653] = new Array('0','SELECT HOSPITAL','14','APOLLO HOSPITALS, VIKRAMPURI');
mapHckHospitals[1983] = new Array('0','SELECT HOSPITAL','17','APOLLO HOSPITAL, WALTAIR MAIN ROAD');
mapHckHospitals[2741] = new Array('0','SELECT HOSPITAL','12','INDRAPRASTHA APOLLO HOSPITALS');
mapHckHospitals[3015] = new Array('0','SELECT HOSPITAL','16','APOLLO HOSPITALS, BANNERGHATTA ROAD');
mapHckHospitals[6009] = new Array('0','SELECT HOSPITAL','18','APOLLO HOSPITALS, NOIDA');

	*/
	function showCities()
	{
	
		//var box = document.forms[0].category1;	
		
		var number = document.getElementById('ddlAppointmentTypes').value;
		//alert(number);
		if (!number) return;
		var RegionDdl = document.getElementById("ddlCities");
		var HospitalsDdl = document.getElementById("ddlHospitals");
		
		if(number==0)
		{
			RegionDdl.options.length = 0;
			HospitalsDdl.options.length = 0;
		}
		else
		{
			
			RegionDdl.options.length = 0;
			HospitalsDdl.options.length = 0;
			//var list = mapcat[number];
			var list = mapCities[number];	
			RegionDdl.options.length = ((list.length)/2);
			
			 
			for(i=0;i<list.length;i+=2)
			{
				RegionDdl.options[i/2].value = list[i];
				RegionDdl.options[i/2].text = list[i+1];
			}
		}
		
		return false;
	}
	
	
	function showHospitals()
	{
		
		var appointmenttype = document.getElementById('ddlAppointmentTypes').value;
		var number = document.getElementById('ddlCities').value;
		var HospitalsDdl = document.getElementById("ddlHospitals");
		
		//alert(number);
		if (!number) return;
		
		//var list = mapcat[number];
		
		if(number==0)
		{
			 HospitalsDdl.options.length = 0;
			
		}
		else
		{
			HospitalsDdl.options.length = 0;
			if(appointmenttype==1)
			{
				var hospitalslist = mapConHospitals[number];
			}
			else if(appointmenttype==2)
			{
				var hospitalslist = mapDiaHospitals[number];
			}
			else if(appointmenttype==3)
			{
				var hospitalslist = mapHckHospitals[number];
			}
					
			HospitalsDdl.options.length = ((hospitalslist.length)/2);
			
			for(i=0;i<hospitalslist.length;i+=2)
			{
				HospitalsDdl.options[i/2].value = hospitalslist[i];
				HospitalsDdl.options[i/2].text = hospitalslist[i+1];
			}
		}
		
		return false;
	
	}	
	
	function callDoctorSearchButton(nkey)
	{
		var keyval
		if(navigator.appName == "Microsoft Internet Explorer")
		{
			keyval = window.event.keyCode;
		}
		else if (navigator.appName == 'Netscape')
		{
			nkeycode = nkey.which;
		    keyval = nkeycode;
		}
		//For A-Z
		if(keyval == 13) 
		{
			document.getElementById('imgBtnSearch1').tabIndex="1";
			return true;
		}
		else
		{
			return false;
		}
		
		
		
	}
	
	function callUserCredentialsButton(nkey)
	{
		
		var keyval
		if(navigator.appName == "Microsoft Internet Explorer")
		{
			keyval = window.event.keyCode;
		}
		else if (navigator.appName == 'Netscape')
		{
			nkeycode = nkey.which;
		    keyval = nkeycode;
		}
		//For A-Z
		if(keyval == 13) 
		{
			document.getElementById('LoginControl1_imgBtnSubmit').tabIndex="1";
			return true;
		}
		else
		{
			return false;
		}
		
	}
	
	function validateusers()
	{
	
		
		var username = document.getElementById("LoginControl1_txtusername").value;
		var password = document.getElementById("LoginControl1_txtpassword").value;
		var doctor = document.getElementById("txtDoctorName").value;
		
		var alertMessage="";
		
		
		if(password.trim()=="" || username.trim()=="")
		{
			if(password.trim() == "" && username.trim() =="" && doctor.trim()=="")
			{
					if(username.trim()=="")
					{
							alertMessage='Please enter Username \n';
					}
					
					if(password.trim()=="")
					{
						alertMessage+='Please enter Password \n';
					}
					alert(alertMessage);
					return false;	
				
			}
			else if(password.trim() == "" && username.trim() =="" && doctor.trim()!="" )
			{
				return true;
			
			}
			else
			{
				if(username.trim()=="")
				{
						alertMessage='Please enter Username \n';
				}
				
				if(password.trim()=="")
				{
					alertMessage+='Please enter Password \n';
				}
				alert(alertMessage);
				return false;	
				
			}
			
		}
		else if(password.trim()!= "" && username.trim() !="")
		{
			return true;
		}
		
		
	}
	
	function fillSuperSpeciality()
	{
	
		 
		var speciality = document.getElementById("ddlquickspeciality").value;
		var superSpecialityString = document.getElementById("hdnSuperSpecialityString").value;
		
		if(document.getElementById("ddlSuperSpeciality")!=null)
		{
			if(speciality!="0")
			{
				if(superSpecialityString!="0")
				{
					fillSuperSpecialities_BySpecialityId(superSpecialityString,speciality);
				}
				else
				{
					
				}
				
			}
			else if(speciality=="0")
			{
				if(superSpecialityString!="0")
				{
					fill_All_SuperSpecialities(superSpecialityString);
				}
				
			}
		}
		
	}
	
	




function fillSuperSpecialities_BySpecialityId(resultString,specialityId)
{
	var superSpeciality = document.getElementById("ddlSuperSpeciality");
	var OptionsList = resultString.split(":");
	
	superSpeciality.options.length=0;
	
	
	var count=0;
	
	for(i=0;i<OptionsList.length-1;i++)
	{
		
		//	Again we are splitting the First Value & text Field based on predefined splitting character.
			var SingleOption = OptionsList[i];
			var ValueTextOfOption = SingleOption.split("~");
		//alert(ValueTextOfOption[0]);
		//alert("Text " + ValueTextOfOption[1]);
			var SuperAndSpecialityID = ValueTextOfOption[0].split("_");

		
		//	Here we are assigning the value & text fields of the dropdown Item for that perticular index						
			if(SuperAndSpecialityID[0]==specialityId)
			{
				count+=1;
				superSpeciality.options.length=count;
				
				superSpeciality.options[i].text = ValueTextOfOption[1];
				superSpeciality.options[i].value = SuperAndSpecialityID[1];
			}
			else
			{
				if(i==0)
				{
					count+=1;
					superSpeciality.options.length=count;
					superSpeciality.options[i].text = ValueTextOfOption[1];
					superSpeciality.options[i].value = SuperAndSpecialityID[1];
				}
			}

		//	We are incrementing the index for further insertion

	}
	
}	
	
	
	

function fill_All_SuperSpecialities(resultString)
{
	var superSpeciality = document.getElementById("ddlSuperSpeciality");
	var OptionsList = resultString.split(":");
	
	superSpeciality.options.length=0;
	
	
	var count=0;
	
	for(i=0;i<OptionsList.length-1;i++)
	{
		
		//	Again we are splitting the First Value & text Field based on predefined splitting character.
			var SingleOption = OptionsList[i];
			var ValueTextOfOption = SingleOption.split("~");
		//alert(ValueTextOfOption[0]);
		//alert("Text " + ValueTextOfOption[1]);
			var SuperAndSpecialityID = ValueTextOfOption[0].split("_");

		
		//	Here we are assigning the value & text fields of the dropdown Item for that perticular index						
			
				count+=1;
				superSpeciality.options.length=count;
				
				superSpeciality.options[i].text = ValueTextOfOption[1];
				superSpeciality.options[i].value = SuperAndSpecialityID[1];
			
		//	We are incrementing the index for further insertion

	}
	
}	

function clearUserFields()
{
	document.getElementById("LoginControl1_txtusername").value="";
	document.getElementById("LoginControl1_txtpassword").value="";
	return true;
	
}

function clearSearchFields()
{
	
	// search fields 
	document.getElementById("txtDoctorName").value="";
	document.getElementById("ddlquickspeciality").selectedIndex="0";	
	document.getElementById("ddlquickcity").selectedIndex="0";	
	
	// advanced search fields
	document.getElementById("ddlSuperSpeciality").selectedIndex="0";
	document.getElementById("rdBtnMale").checked=false;
	document.getElementById("rdBtnFemale").checked=false;
	document.getElementById("ddlTime").selectedIndex="0";	
	document.getElementById("ddlLanguages").selectedIndex="0";	
	
	
	document.getElementById("ddlAppointmentTypes").selectedIndex="0";
	document.getElementById("ddlCities").selectedIndex="0";
	document.getElementById("ddlHospitals").selectedIndex="0";
	
	return true;
		
}


function ValidateEmailId()
{
	if((document.getElementById("txtEmailId").value).length==0)
    {
        alert("Please enter Email Id");
        return false;
    }
    
    else if((document.getElementById("txtEmailId").value).length!=0)
    {
        if(!IsValidEmailID(document.getElementById("txtEmailId").value))
        {
			document.getElementById('txtEmailId').value="";
	        document.getElementById('txtEmailId').select();
	        alert("Please enter valid Email Id");
	        return false;
        }
        else
        {
			return true;
        }
    }
    	
}



			//function IsValidEmailID(id)
			//{ 
			//	var reg =/^[a-zA-Z][a-zA-Z0-9]+([\_\-\.]?[a-zA-Z0-9]+)@[a-zA-Z0-9]+([\.])[a-zA-Z]+$/;                                          
			//	var reg1 =/^[a-zA-Z][a-zA-Z0-9]+([\_\-\.]?[a-zA-Z0-9]+)@[a-zA-Z0-9]+([\.])[a-zA-Z]+([\.])[a-zA-Z]+$/;    
			//	if(reg.test(id) || reg1.test(id))
			//		return true;
			//	return false; 
			//}

		function IsValidEmailID(id)
        {
            var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
            if (filter.test(id))
                return true;
            return false;
        }
        
        function  ValidateHuserAppointments()
        {
         
          if(document.getElementById("ddlAppointmentType").value=="0")
          {
			alert("Please select the Appointment Type");
			return false;
          }
          
          
        }
        
        
        function  ValidateSadminAppointments()
        {
			
		  	
		  if(document.getElementById("ddlHospitals").value=="" || document.getElementById("ddlHospitals").value=="0")
          {
			alert("Please select the Hospital ");
			return false;
          }
         
          if(document.getElementById("ddlAppointmentType").value=="0")
          {
			alert("Please select the Appointment Type");
			return false;
          }
          
          
          
        }
        

function ValidateGetAdviseOnline()
{

	
	var alertMessage="Please provide following missing information";
	if(document.getElementById("ddlCities")!=null)
	{
		if(document.getElementById("ddlCities").value==0)
		{
		    alertMessage += "\n - City";
		}  
		if(document.getElementById("ddlHospitals").value==0)
		{
		  alertMessage += "\n - Hospital";
		}  
	}
	
	
	if((document.getElementById("txtEmail").value).length==0)
    {
        alertMessage += "\n - Email Id";
        
    }
    
    else if((document.getElementById("txtEmail").value).length!=0)
    {
        if(!IsValidEmailID(document.getElementById("txtEmail").value))
        {
			document.getElementById('txtEmail').value="";
	        document.getElementById('txtEmail').select();
	        alertMessage += "\n - Enter valid Email Id";
	        
        }
        
    }
	
	
	if(document.getElementById("txtFirstName").value.trim()=="")
	{
		alertMessage += "\n - First Name";
	}	
	
	if(document.getElementById("txtLastName").value.trim()=="")
	{
		alertMessage += "\n - Last Name";
	}
	
	
	var rbnMaleOrFemale="";
	
	if(document.getElementById("rbMale").checked==true)
	{
		rbnMaleOrFemale="checked";
	}
	else if(document.getElementById("rbFemale").checked==true)
	{
		rbnMaleOrFemale="checked";
	}
	
	if(rbnMaleOrFemale=="")
	{
		alertMessage += "\n - Male/Female for Gender";
	}
	
	
	if(document.getElementById("txtPhoneNo").value.trim()=="")
	{
		alertMessage += "\n - Phone Number";
		
	}
	
	
	
	var rbtnRegistered="";
	
	if(document.getElementById("rbtnRegisterYes").checked==true)
	{
		rbtnRegistered="checked";
	}
	else if(document.getElementById("rbtnRegisterNo").checked==true)
	{
		rbtnRegistered="checked";
	}
	
	if(rbtnRegistered=="")
	{
		alertMessage  += "\n - Yes/No for Have you registered in Apollo Hospitals before?";
	}
	
	if(document.getElementById("txtDescription").value.trim()=="")
	{
		alertMessage += "\n - Description of the Problem";
	}
	
	if(document.getElementById("txtDescription").value.length>500)
	{
	  alertMessage += "\n - Enter Description less than 500 characters";
	}
	
	
	
	if(alertMessage!="Please provide following missing information")
	{
	    if(alertMessage=="Please provide following missing information\n - Enter valid Email Id")
	    {
	      alertMessage="";
	      alertMessage="Please enter valid Email Id";
	    }
		alert(alertMessage);
		return false;
	}
	
	
	
	
	 
	
}	




function validateDoctorRegistration()
{

	
	var alertMessage="";
	
	if((document.getElementById("txtEmailId").value).length!=0)
    {
        if(!IsValidEmailID(document.getElementById("txtEmailId").value))
        {
			document.getElementById('txtEmailId').select();
	        alertMessage += "Please enter valid Email ID \n";
	        
        }
        
    } 
	
	if(document.getElementById("txtFirstName").value.trim()=="")
	{
		alertMessage += "Please enter First Name \n";
	}	
	
	if(document.getElementById("txtLastName").value.trim()=="")
	{
		alertMessage += "Please enter Last Name \n";
	}
	
	
		
	if(document.getElementById("DdlSpeciality").value=="0")
	{
		alertMessage += "Please select Speciality \n";
		
	}
	
	
	if(document.getElementById("txtDOB").value.trim()!="")
	{
		var str=document.getElementById("txtDOB").value;
		if(isDate(str))
		{
		
		}
		else
		{
			alertMessage += "Please enter DOB in dd/mm/yyyy format \n";
		}
		
	}
	
	
	
	
	if(alertMessage=="")
	{
		return true;
	}
	else
	{
		alert(alertMessage);
		return false;
	}
	
	
	
	 
	
}	




 var dtCh= "/";
        var minYear=1900;
        var maxYear=2100;
        
        function isDate(dtStr)
        {
	        if(dtStr!="")
	        {
	        var daysInMonth = DaysArray(12)
	        var pos1=dtStr.indexOf(dtCh)
	        var pos2=dtStr.indexOf(dtCh,pos1+1)
	        var strDay=dtStr.substring(0,pos1)
	        var strMonth=dtStr.substring(pos1+1,pos2)
	        var strYear=dtStr.substring(pos2+1)
	        strYr=strYear
	        if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	        if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	        for (var i = 1; i <= 3; i++) {
		        if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	        }
	        month=parseInt(strMonth)
	        day=parseInt(strDay)
	        year=parseInt(strYr)
	        if (pos1==-1 || pos2==-1){
		         return false
		         
	        }
	        if (strMonth.length<1 || month<1 || month>12){
		        return false
		        //alert("Please enter a valid month")
		       // alert("Please enter a valid date")
		        
	        }
	        if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		        return false
		        //alert("Please enter a valid day")
		        //alert("Please enter a valid date")
		        
	        }
	        if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		        return false
		        //alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		        
	        }
	        if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		        return false
		        //alert("Please enter a valid date")
		        //alert("Please enter a valid date")
		       
	        }
	       }
        return true
        }
        
        
        
         function isInteger(s)
        {
	        var i;
            for (i = 0; i < s.length; i++){   
                // Check that current character is number.
                var c = s.charAt(i);
                if (((c < "0") || (c > "9"))) return false;
            }
            // All characters are numbers.
            return true;
        }

        function stripCharsInBag(s, bag)
        {
	        var i;
            var returnString = "";
            // Search through string's characters one by one.
            // If character is not in bag, append to returnString.
            for (i = 0; i < s.length; i++){   
                var c = s.charAt(i);
                if (bag.indexOf(c) == -1) returnString += c;
            }
            return returnString;
        }

        function daysInFebruary (year)
        {
	        // February has 29 days in any year evenly divisible by four,
            // EXCEPT for centurial years which are not also divisible by 400.
            return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
        }
        function DaysArray(n) 
        {
	        for (var i = 1; i <= n; i++) {
		        this[i] = 31
		        if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		        if (i==2) {this[i] = 29}
           } 
           return this
        }
        
        
        //Validating the Numeric data
        function IsNumeric(str)
        {
            var reg =/^[0-9]+$/;
            if(!reg.test(str))
            {
                alert("Please enter numerics only");
                return false;
            }
            else
            {
                return true;
            }
        }
        
        function IsValidEmailID1(str)
		{
		
			//var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
			var filter = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i;
			if (filter.test(str))
				return true;
			return false;
		}
        
        function ValidateHadminDoctorRegistration()
        {
			   
			   //debugger;
			   var alertMessage="Please provide following missing information:";
				if(document.getElementById("txtFirstName").value.trim()=="")
				{
					alertMessage += "\n - First Name ";
				}	
				
				if(document.getElementById("txtLastName").value.trim()=="")
				{
					alertMessage += "\n - Last Name ";
				}
				
				if(document.getElementById("DdlSpeciality").value.trim()=="0")
				{
				  alertMessage += "\n - Select Specialty ";
				}
				
				if(document.getElementById("txtEmailId").value.trim()!="")
				{
				      if(!IsValidEmailID1(document.getElementById("txtEmailId").value.trim()))
						{
							document.getElementById('txtEmailId').select();
							alert("Please enter valid Email ID");
							return false;
						}
				}
				/*if((document.getElementById('txtWebSite').value).length != 0)
				{
                      var exp = "^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?$" ;
                      var regex = new RegExp(exp);
					  var result;
                      var s = document.getElementById('txtWebSite').value;
						if (s.length > 0)
						{
							result = regex.test(s);
                            if (result == false)
                            {
                                    alert("Please enter a valid Website");
                                    document.getElementById('txtWebSite').focus();
                                    document.getElementById('txtWebSite').select();
                                    return false;
                            }
                         }
                }*/
				if(document.getElementById("txtDOB").value.trim()!="")
				{
					var str=document.getElementById("txtDOB").value;
					if(isDate(str))
					{
						var curr_date = document.getElementById("txtCurrentDate").value;
						var currentDOB = document.getElementById("txtDOB").value;
						if(RegCompareTwoDates(currentDOB,curr_date))
						{
							
						}
						else
						{
							return false;
						}
					}
					else
					{
						alertMessage += "\n - Date of birth in dd/mm/yyyy format";
						
					}
				}
				
				if(document.getElementById("txtEmailId").value.trim()=="" && document.getElementById("txtMobileNo").value.trim()=="")
				{
				  alertMessage += "\n - Email Id or Mobile Number(User Name is either Email Id or Mobile Number)";
				}
				
				if(alertMessage=="Please provide following missing information:")
				{
				
				   
				   	//if(document.getElementById("txtQualification").value.trim()!="")
					//{
						//if(document.getElementById("txtQualification").value.trim().length>500)
						//{
								//alert("Please enter  maximum 500 characters in  qualification field");
								//return false
						//} 
					//}
					//if(document.getElementById("txtExperience").value.trim()!="")
					//{
				   
						//if(document.getElementById("txtExperience").value.trim().length>500)
						//{
								//alert("Please enter  maximum 500 characters in  experience field");
								//return false
						//} 
				  
					//}
					//if(document.getElementById("txtAchievements").value.trim()!="")
					//{
						
						//if(document.getElementById("txtAchievements").value.trim().length>500)
						//{
								//alert("Pease enter  maximum 500 characters in  Achievements field");
								//return false
						//} 
						
					//}
					//if(document.getElementById("txtProfessionalMembers").value.trim()!="")
					//{
					  
						//if(document.getElementById("txtProfessionalMembers").value.trim().length>500)
						//{
								//alert("Please enter  maximum 500 characters in  ProfessionalMembers field");
								//return false
						//} 
					  
					//}
				if(document.getElementById("txtAddress").value.trim()!="")
				{
				  if(document.getElementById("txtAddress").value.trim().length>500)
				   {
					     alert("Please enter  maximum 500 characters in  Address field");
						 return false
				   } 
				}
				if(document.getElementById("txtZipOrPostalCode").value.trim()!="")
				{
				
				  if(document.getElementById("txtZipOrPostalCode").value.trim().length<5)
				   {
					     alert("Please enter  minimum 5 characters in  Pin Code field");
						 return false
				   } 
				  
				}
				if(document.getElementById("txtMobileNo").value.trim()!="")
				{
				
				   if(document.getElementById("txtMobileNo").value.trim().length<10)
				   {
					     alert("Please enter  minimum 10 characters in  Mobile  number field");
						 return false
				   } 
				  
				}
			
				   
				}
				else
				{
					alert(alertMessage);
					return false;
				}
			
			
        }
        
        function validateEditDoctor()
			{

			    debugger;
				var alertMessage="Please provide following missing information:";
				
				if(document.getElementById("txtFirstName").value.trim()=="")
				{
					alertMessage += "\n - First Name ";
				}	
				
				if(document.getElementById("txtLastName").value.trim()=="")
				{
					alertMessage += "\n - Last Name ";
				}
			
				//if(document.getElementById("DdlSpeciality").value=="0")
				//{
					//alertMessage += "Please select Speciality \n";
					
				//}
		
				
				
				if(document.getElementById("txtEmailId").value.trim()=="" && document.getElementById("txtMobileNo").value.trim()=="")
				{
				   alertMessage += "\n - EmailId or Mobile number(Username is EmailId or mobile number)";
				}
		
				if(alertMessage=="Please provide following missing information:")
				{
					if((document.getElementById("txtEmailId").value).length!=0)
					{
						if(!IsValidEmailID(document.getElementById("txtEmailId").value))
						{
							document.getElementById('txtEmailId').select();
							alert("Please enter valid Email ID");
							return false;
						}
						else
						{
//							if((document.getElementById('txtWebSite').value).length != 0)
//							{
//								var exp = "^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?$" ;
//								var regex = new RegExp(exp);
//								var result;
//								var s = document.getElementById('txtWebSite').value;
//								if (s.length > 0)
//								{
//									result = regex.test(s);
//									if (result == false)
//									{
//											alert("Please enter a valid Website");
//											document.getElementById('txtWebSite').focus();
//											document.getElementById('txtWebSite').select();
//											return false;
//									}
//								}
//							 }
						}
					} 
					else
					{
//						if((document.getElementById('txtWebSite').value).length != 0)
//							{
//								var exp = "^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?$" ;
//								var regex = new RegExp(exp);
//								var result;
//								var s = document.getElementById('txtWebSite').value;
//								if (s.length > 0)
//								{
//									result = regex.test(s);
//									if (result == false)
//									{
//											alert("Please enter a valid Website");
//											document.getElementById('txtWebSite').focus();
//											document.getElementById('txtWebSite').select();
//											return false;
//									}
//									
//								}
//							 }
					}
					
				if(document.getElementById("txtDOB").value.trim()!="")
				{
					var str=document.getElementById("txtDOB").value;
					if(isDate(str))
					{
					
					}
					else
					{
						alert("Enter Date Of Birth in 'dd/mm/yyyy' format");
						return false;
					}
					
				}
				
				if(document.getElementById("txtQualification").value.trim()!="")
				{
				   if(document.getElementById("txtQualification").value.trim().length>150)
				   {
					     alert("Please enter  maximum 150 characters in  qualification field");
						 return false
				   } 
				}
				if(document.getElementById("txtExperience").value.trim()!="")
				{
				   
				   if(document.getElementById("txtExperience").value.trim().length>500)
				   {
					     alert("Please enter  maximum 500 characters in  experience field");
						 return false
				   } 
				  
				}
				if(document.getElementById("txtAchievements").value.trim()!="")
				{
				  
				   if(document.getElementById("txtAchievements").value.trim().length>500)
				   {
					     alert("Pease enter  maximum 500 characters in  Achievements field");
						 return false
				   } 
				   
				}
				if(document.getElementById("txtProfessionalMembers").value.trim()!="")
				{
				  
				  if(document.getElementById("txtProfessionalMembers").value.trim().length>500)
				   {
					     alert("Please enter  maximum 500 characters in  ProfessionalMembers field");
						 return false
				   } 
				  
				}
				if(document.getElementById("txtAddress").value.trim()!="")
				{
				  if(document.getElementById("txtAddress").value.trim().length>500)
				   {
					     alert("Please enter  maximum 500 characters in  Address field");
						 return false
				   } 
				}
				if(document.getElementById("txtZipOrPostalCode").value.trim()!="")
				{
				
				  if(document.getElementById("txtZipOrPostalCode").value.trim().length<5)
				   {
					     alert("Please enter  minimum 5 characters in  Pin Code field");
						 return false
				   } 
				  
				}
				if(document.getElementById("txtMobileNo").value.trim()!="")
				{
				
				   if(document.getElementById("txtMobileNo").value.trim().length<10)
				   {
					     alert("Please enter  minimum 10 characters in  Mobile  number field");
						 return false
				   } 
				  
				}
				
				}
				else
				{
					alert(alertMessage);
					return false;
				}
			}	
			
			function RegCompareTwoDates(date1, date2)
			{
				
				var str1  = date1;
				var str2  = date2;
				var len1 = str1.length;
				var len2 = str2.length;
				var dt1   = str1.substring(0,str1.indexOf('/'));
				if(dt1.length < 2)
				{
					dt1 = "0" + dt1;
				}
				var mStrIndex = str1.indexOf('/')+1;
				var mon1  = str1.substring(mStrIndex, len1-5);
				if(mon1.length < 2)
				{
					mon1 = "0" + mon1;
				}
				var yr1   = str1.substring(len1-4,len1);
				
				var dt2   = str2.substring(0,str2.indexOf('/'));
				if(dt2.length < 2)
				{
					dt2 = "0" + dt2;
				}
				var mStrIndex1 = str2.indexOf('/')+1;
				var mon2  = str2.substring(mStrIndex1, len2-5);
				if(mon2.length < 2)
				{
					mon2 = "0" + mon2;
				}
				var yr2   = str2.substring(len2-4,len2);
				
				var date1 = new Date(yr1, mon1-1, dt1);
				var date2 = new Date(yr2, mon2-1, dt2);
			   if(date1 >= date2)
			   {
				  alert(" - Date of Birth  should be less than the Current Date");
				  return false;
			   }
			   else
			   {
				  return true;
			   }
			} //End of the function