﻿// JScript File

var digits = "0123456789";
var phoneNumberDelimiters = "()- ";
var validWorldPhoneChars = phoneNumberDelimiters + "+";
var minDigitsInIPhoneNumber = 10;
var invalid =" ";

function CheckAlphaNumeric(e)
  {
//	if(e.keyCode<'65'||e.keyCode>'90')
//	{
//	   if(e.keyCode<'97'||e.keyCode>'122')
//	   {
//	     alert("Invalid Data");
//		 return false;
//		} 
//	 }
//	 return true;
  }
 
function checkInternationalPhone(strPhone)
{
    var s=stripCharsInBag(strPhone,validWorldPhoneChars);
    return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}
function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}
function Numeric(e)
  {
//	if(e.keyCode<'48'||e.keyCode>'57')
//	{
//	     alert("Invalid Data");
//		 return false;
//	}
//    return true;
  }
  function digit(e)
{
//    if(e.keyCode<'48' || e.keyCode>'57')
//    {
//        alert("No. of Room Should Be In Digit")
//        return false;
//    }
}
function money(e)
{
//    if(e.keyCode<'48'|| e.keyCode>'57')
//    {
//        if(e.keyCode!='46')
//        {
//            alert("Invalid Data");
//            return false;            
//        }
//    }
}
//---------------------------------------------------------------------------
function chk_char(string,id,len,msg)
{
        var validChars=string;
		var strChars;
		var result=len;
		for(i=0;i<document.getElementById(id).value.length;i++)
		{
		  strChars=document.getElementById(id).value.charAt(i);
		  if(validChars.indexOf(strChars)==-1)
		  {
		    alert(msg);
		    document.getElementById(id).style.backgroundColor="lightyellow";
            document.getElementById(id).focus()
            result=i;
		    return result;
		  }		         
		}
		return result;
}
//-----------------------------------------------------------------------------------------------------------
function chk_confirm(page)
 {	
  if(page=="OwnerHotelDetails")
  {
    var ok=window.confirm('Thanks for registering your Hotel,It will be activated after verification.Add another hotel ?');
    if(ok)
    {
      window.parent.location.href='OwnerHotelDetails.aspx';
      return true;	                          			                      
    }
    else
    {
      window.parent.location.href='OwnerControlPanel.aspx';
      return true;
       //return false;	                       	                       
    } 
   }
  if(page=="OwnerControlPanel")
  {
    var ok=window.confirm('You do not add hotel.Do you want to add hotel ?');
    if(ok)
    {
      window.parent.location.href='OwnerHotelDetails.aspx';
      return true;	                          			                      
    }
    else
    {
      return false;	                       	                       
    } 
   } 
 if(page=="OwnerRoomDetails")
  {
    var ok=window.confirm('Room Details Successfully Submitted.Do you want to add another room ?');
    if(ok)
    {
      return false;	                          			                      
    }
    else
    {
      window.parent.location.href='ownerControlPanel.aspx';
      return true;	                       	                       
    } 
   }                	
    return true;
 }	  
//===========================================================================================================
function Chat_window()
    {
	    var confirmWin=null;
	    var w=screen.width-(screen.width/2.00);
	    var h=screen.height-(screen.height/2.70);
	    var winl = (screen.width-w)/1.94;
	    var wint =(screen.height-h)/2.15;
	    confirmWin=window.open("chatwindow.aspx","",'width='+w+',height='+h+',top='+wint+',left='+winl+',title=0,status=0,menubar=0');
	 }
//===================================Count====================================================================
function count(count,id,no)
{
   var a=document.getElementById(id).value;   
   if(a!="")
   {
     if(a.length>=no)
     {
       document.getElementById(count).value=0+' characters left';
       document.getElementById(id).value=a.substring(0,no);
       document.getElementById(count).style.background="lightpink";
     }
     else
     {
       document.getElementById(count).value=(no-(a.length))+' characters left';
       if(document.getElementById(count).value==0 || document.getElementById(count).value<=1)
       {
         document.getElementById(count).style.background="lightpink";
       }
       else
       {
         document.getElementById(count).style.background="#E0E0E0";
       }
     }
   }
   else
   {
     document.getElementById(count).style.background="#E0E0E0";
     document.getElementById(count).value=no+' characters left';
   }
   return false;
}
//-------------------------------------------------------------------------------------------------------------
function blank_id(ID)
   {		     
     if(document.getElementById(ID).value=="" || document.getElementById(ID).value=="Enter Your CustomerID" )
     {
        alert("Please enter your CustomerID/Ticket No!");
        document.getElementById(ID).style.backgroundColor="lightyellow";
        document.getElementById(ID).focus();
        return (false);
     }
    
    return (true);
   }	
//-------------------------------------------------------------------------------------------------
//Owner Registration
function ownerregistration()
 {
	 if(document.getElementById("txtFName").value=="") 
	 {
		alert("Please enter your First Name");
		document.getElementById("txtFName").style.backgroundColor="lightyellow";
		document.getElementById("txtFName").focus();
		return false;
	 }
	 if(document.getElementById("txtLName").value=="") 
	 {
		alert("Please enter your Last Name");
		document.getElementById("txtLName").style.backgroundColor="lightyellow";
		document.getElementById("txtLName").focus();
		return false;
	 }
	 if(document.getElementById("txtAddress").value=="") 
	 {
		alert("Please enter your Address");
		document.getElementById("txtAddress").style.backgroundColor="lightyellow";
		document.getElementById("txtAddress").focus();
		return false;
	 }
	
	if(document.getElementById("txtAddress").value.length>200)
	{
	   alert("Your Address Should not Be more than 200 Characters");
	   document.getElementById("txtAddress").style.backgroundColor="lightyellow";
	   document.getElementById("txtAddress").focus();
	   return false;
	}
	
	 if(document.getElementById("ddl_Country").value=="--Select--") 
	 {
		alert("Please Select your Country");
		document.getElementById("ddl_Country").focus();
		return false;
	 }

	 if(document.getElementById("ddl_Country").value=="Others")
	 {
	    if(document.getElementById("txtcountry").value=="")
	    {
	        alert("If You Can't Find Your Country In List!! Please Enter Your Country Name");
	        document.getElementById("txtcountry").style.backgroundColor="lightyellow";
	        document.getElementById("txtcountry").focus();
	        return false;
	    }
	    
	 }
	 if(document.getElementById("ddl_Country").value=="India" || document.getElementById("ddl_Country").value=="United States of America")
	 {
	     if(document.getElementById("ddl_State").value=="--Select--") 
	     {
		    alert("Please Select your State");
		    document.getElementById("ddl_State").focus();
		    return false;
	     }
	 }
	 if(document.getElementById("ddl_State").value=="Others")
	 {   
	    if(document.getElementById("txtstate").value=="")
	    {
	        alert("If You Can't Find Your State In List!! Please Enter Your State Name");
	        document.getElementById("txtstate").style.backgroundColor="lightyellow";
	        document.getElementById("txtstate").focus();
	        return false;
	    }
	    
	 }
	 if(document.getElementById("ddl_Country").value=="India")
	 {
	     if(document.getElementById("ddl_District").value=="--Select--") 
	     {
		    alert("Please Select your District");
		    document.getElementById("ddl_District").focus();
		    return false;
	     }
	 }
	 if(document.getElementById("ddl_District").value=="Others")
	 {
	    if(document.getElementById("txtdistrict").value=="")
	    {
	        alert("If You Can't Find Your District In List!! Please Enter Your District Name");
	        document.getElementById("txtdistrict").style.backgroundColor="lightyellow";
	        document.getElementById("txtdistrict").focus();
	        return false;
	    }
	   
	 }
	 if(document.getElementById("txtcontactno").value=="")
	{
            alert("Please Enter Your Contact number");
            document.getElementById("txtcontactno").style.backgroundColor="lightyellow";
            document.getElementById("txtcontactno").focus();
			return false;
	}
	
	if(document.getElementById("txtcontactno").value!="")
	{
        var Phone=document.getElementById("txtcontactno")
	
	    if (checkInternationalPhone(Phone.value)==false)
	    {
		    alert("Please Enter a Valid(min 10 digit)Phone Number ");
		    document.getElementById("txtcontactno").style.backgroundColor="lightyellow";		   
		    document.getElementById("txtcontactno").focus();
		    return false;
	    }
	       
	}	 
	 if(document.getElementById("txtEmail").value=="") 
	 {
		alert("Please enter your Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
	 
	 var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	 if(!emailcheck.test(document.getElementById("txtEmail").value))
	 {
		alert("Please enter valid Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
	 
    if(document.getElementById("txtpassword").value=="")
	{
	    alert("Please Enter Your Password");
	    document.getElementById("txtpassword").style.backgroundColor="lightyellow";
	    document.getElementById("txtpassword").focus();
	    return false;
	}
	
	if(document.getElementById("txtpassword").value.length<6)
	{
	    alert("PassWord Should Be At Least 6 Characters");
	    document.getElementById("txtpassword").style.backgroundColor="lightyellow";
	    document.getElementById("txtpassword").focus();
	    return false;
	}
	
	if(document.getElementById("txtconfirmpassword").value=="")
	{
	    alert("Please Confirm Your Password");
	    document.getElementById("txtconfirmpassword").style.backgroundColor="lightyellow";
	    document.getElementById("txtconfirmpassword").focus();
	    return false;
	}
	
	if(document.getElementById("txtpassword").value!=document.getElementById("txtconfirmpassword").value)
	{
	    alert("Mismatch Your Password & Confirm Password")
	    document.getElementById("txtconfirmpassword").style.backgroundColor="lightyellow";
	    document.getElementById("txtconfirmpassword").focus();
	    return false;
	}
	if(document.getElementById("chk_terms").checked==false)
	{
            alert("Please Select The Terms & Condition");
            document.getElementById("chk_terms").focus();
			return false;
	}	
}

//-------------------------------------------------------------------------------------------------
//Agent Registration
function agentregistration()
 {
	 if(document.getElementById("txtFName").value=="") 
	 {
		alert("Please enter your First Name");
		document.getElementById("txtFName").style.backgroundColor="lightyellow";
		document.getElementById("txtFName").focus();
		return false;
	 }
	 if(document.getElementById("txtLName").value=="") 
	 {
		alert("Please enter your Last Name");
		document.getElementById("txtLName").style.backgroundColor="lightyellow";
		document.getElementById("txtLName").focus();
		return false;
	 }
	 if(document.getElementById("txtCName").value=="") 
	 {
		alert("Please enter your Centre Name");
		document.getElementById("txtCName").style.backgroundColor="lightyellow";
		document.getElementById("txtCName").focus();
		return false;
	 }
	 if(document.getElementById("txtAddress").value=="") 
	 {
		alert("Please enter your Address");
		document.getElementById("txtAddress").style.backgroundColor="lightyellow";
		document.getElementById("txtAddress").focus();
		return false;
	 }
	
	if(document.getElementById("txtAddress").value.length>200)
	{
	   alert("Your Address Should not Be more than 200 Characters");
	   document.getElementById("txtAddress").style.backgroundColor="lightyellow";
	   document.getElementById("txtAddress").focus();
	   return false;
	}
	
	 if(document.getElementById("ddl_Country").value=="--Select--") 
	 {
		alert("Please Select your Country");
		document.getElementById("ddl_Country").focus();
		return false;
	 }
	 
	 if(document.getElementById("drCity").value=="--Select--")
	 {
	    alert("Please Enter Your City Name");
	    document.getElementById("drCity").focus();
	    return false;
	 }
	 if(document.getElementById("txtcontactno").value=="")
	 {
            alert("Please Enter Your Contact number");
            document.getElementById("txtcontactno").style.backgroundColor="lightyellow";
            document.getElementById("txtcontactno").focus();
			return false;
	 }
	
	if(document.getElementById("txtcontactno").value!="")
	{
        var Phone=document.getElementById("txtcontactno")
	
	    if (checkInternationalPhone(Phone.value)==false)
	    {
		    alert("Please Enter a Valid(min 10 digit)Phone Number ");
		    document.getElementById("txtcontactno").style.backgroundColor="lightyellow";		   
		    document.getElementById("txtcontactno").focus();
		    return false;
	    }
	       
	}	 
	 if(document.getElementById("txtEmail").value=="") 
	 {
		alert("Please enter your Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
	 
	 var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	 if(!emailcheck.test(document.getElementById("txtEmail").value))
	 {
		alert("Please enter valid Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
	 
    if(document.getElementById("txtpassword").value=="")
	{
	    alert("Please Enter Your Password");
	    document.getElementById("txtpassword").style.backgroundColor="lightyellow";
	    document.getElementById("txtpassword").focus();
	    return false;
	}
	
	if(document.getElementById("txtpassword").value.length<6)
	{
	    alert("PassWord Should Be At Least 6 Characters");
	    document.getElementById("txtpassword").style.backgroundColor="lightyellow";
	    document.getElementById("txtpassword").focus();
	    return false;
	}
	
	if(document.getElementById("txtconfirmpassword").value=="")
	{
	    alert("Please Confirm Your Password");
	    document.getElementById("txtconfirmpassword").style.backgroundColor="lightyellow";
	    document.getElementById("txtconfirmpassword").focus();
	    return false;
	}
	
	if(document.getElementById("txtpassword").value!=document.getElementById("txtconfirmpassword").value)
	{
	    alert("Mismatch Your Password & Confirm Password")
	    document.getElementById("txtconfirmpassword").style.backgroundColor="lightyellow";
	    document.getElementById("txtconfirmpassword").focus();
	    return false;
	}
	if(document.getElementById("chk_terms").checked==false)
	{
            alert("Please Select The Terms & Condition");
            document.getElementById("chk_terms").focus();
			return false;
	}	
}
//-------------------------------------------------------------------------------------------------
//Agent Update
function agentupdate()
 {
	 if(document.getElementById("txtFName").value=="") 
	 {
		alert("Please enter your First Name");
		document.getElementById("txtFName").style.backgroundColor="lightyellow";
		document.getElementById("txtFName").focus();
		return false;
	 }
	 if(document.getElementById("txtLName").value=="") 
	 {
		alert("Please enter your Last Name");
		document.getElementById("txtLName").style.backgroundColor="lightyellow";
		document.getElementById("txtLName").focus();
		return false;
	 }
	 if(document.getElementById("txtCName").value=="") 
	 {
		alert("Please enter your Centre Name");
		document.getElementById("txtCName").style.backgroundColor="lightyellow";
		document.getElementById("txtCName").focus();
		return false;
	 }
	 if(document.getElementById("txtAddress").value=="") 
	 {
		alert("Please enter your Address");
		document.getElementById("txtAddress").style.backgroundColor="lightyellow";
		document.getElementById("txtAddress").focus();
		return false;
	 }
	
	if(document.getElementById("txtAddress").value.length>200)
	{
	   alert("Your Address Should not Be more than 200 Characters");
	   document.getElementById("txtAddress").style.backgroundColor="lightyellow";
	   document.getElementById("txtAddress").focus();
	   return false;
	}
	
	 if(document.getElementById("ddl_Country").value=="--Select--") 
	 {
		alert("Please Select your Country");
		document.getElementById("ddl_Country").focus();
		return false;
	 }
	 
	 if(document.getElementById("drCity").value=="--Select--")
	 {
	    alert("Please Enter Your City Name");
	    document.getElementById("drCity").focus();
	    return false;
	 }
	 if(document.getElementById("txtcontactno").value=="")
	 {
            alert("Please Enter Your Contact number");
            document.getElementById("txtcontactno").style.backgroundColor="lightyellow";
            document.getElementById("txtcontactno").focus();
			return false;
	 }
	
	if(document.getElementById("txtcontactno").value!="")
	{
        var Phone=document.getElementById("txtcontactno")
	
	    if (checkInternationalPhone(Phone.value)==false)
	    {
		    alert("Please Enter a Valid(min 10 digit)Phone Number ");
		    document.getElementById("txtcontactno").style.backgroundColor="lightyellow";		   
		    document.getElementById("txtcontactno").focus();
		    return false;
	    }
	       
	}	 
	 if(document.getElementById("txtEmail").value=="") 
	 {
		alert("Please enter your Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
	 
	 var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	 if(!emailcheck.test(document.getElementById("txtEmail").value))
	 {
		alert("Please enter valid Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
}
//--------------------------------------------------------------------------------------------------------------------
//Holiday Home Registration
function HolidayHomeRegistration()
 {
	 if(document.getElementById("txt_holidayname").value=="") 
	 {
		alert("Please enter Holiday Home Name");
		document.getElementById("txt_holidayname").style.backgroundColor="lightyellow";
		document.getElementById("txt_holidayname").focus();
		return false;
	 }
	 if(document.getElementById("ddl_country").value=="--Select--") 
	 {
		alert("Please Select your Country");
		document.getElementById("ddl_country").focus()
		return false;
	 }
	 if(document.getElementById("ddl_country").value=="Others")
	 {
	    if(document.getElementById("txtcountry").value=="")
	    {
	        alert("If You Can't Find Your Country In List!! Please Enter Your Country Name");
	        document.getElementById("txtcountry").focus()
	        return false;
	    }
	 }
	 if(document.getElementById("ddl_Country").value=="India" || document.getElementById("ddl_Country").value=="United States of America")
	 {
	     if(document.getElementById("ddl_state").value=="--Select--") 
	     {
		    alert("Please Select your State");
		    document.getElementById("ddl_state").focus()
		    return false;
	     }
	 }
	 if(document.getElementById("ddl_state").value=="Others")
	 {   
	    if(document.getElementById("txtstate").value=="")
	    {
	        alert("If You Can't Find Your State In List!! Please Enter Your State Name");
	        document.getElementById("txtstate").style.backgroundColor="lightyellow";
	        document.getElementById("txtstate").focus();
	        return false;
	    }
	 }
	 if(document.getElementById("ddl_touristspot").value=="--Select--") 
	 {
		alert("Please Select your tourist spot");
		document.getElementById("ddl_touristspot").focus()
		return false;
	 }
	 if(document.getElementById("ddl_touristspot").value=="Others")
	 {
	    if(document.getElementById("txttouristspot").value=="")
	    {
	        alert("If You Can't Find Your tourist spot In List!! Please Enter Your tourist spot Name");
	        document.getElementById("txttouristspot").style.backgroundColor="lightyellow";
	        document.getElementById("txttouristspot").focus();
	        return false;
	    }
	 }
	 if(document.getElementById("txt_Address").value=="") 
	 {
		alert("Please enter your Address");
		document.getElementById("txt_Address").style.backgroundColor="lightyellow";
		document.getElementById("txt_Address").focus();
		return false;
	 }
	if(document.getElementById("txt_Address").value.length>250)
	{
	   alert("Your Address Should not Be more than 250 Characters");
	   
	   return false;
	} 
	if(document.getElementById("txt_email").value=="") 
	 {
		alert("Please enter your Email");
		document.getElementById("txt_email").style.backgroundColor="lightyellow";
		document.getElementById("txt_email").focus();
		return false;
	 }
	 var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	 if(!emailcheck.test(document.getElementById("txt_email").value))
	 {
		alert("Please enter valid Email");
		document.getElementById("txt_email").style.backgroundColor="lightyellow";
		document.getElementById("txt_email").focus();
		return false;
	 }
	 if(document.getElementById("txt_contactno").value=="")
	{
        alert("Please Enter Your Contact number");
        document.getElementById("txt_contactno").focus()
		return false;
	}
	if(document.getElementById("txt_contactno").value!="")
	{
        var Phone=document.getElementById("txt_contactno")
	
	    if (checkInternationalPhone(Phone.value)==false)
	    {
		    alert("Please Enter a Valid(min 10 digit)Phone Number ");
		    document.getElementById("txt_contactno").style.backgroundColor="lightyellow";
		    Phone.value=""
		    Phone.focus();
		    return false;
	    }	    
	}	 
	if(document.getElementById("txt_bookingofficeaddress").value=="") 
	 {
		alert("Please enter your Booking Address");
		document.getElementById("txt_bookingofficeaddress").style.backgroundColor="lightyellow";
		document.getElementById("txt_bookingofficeaddress").focus();
		return false;
	 }
	if(document.getElementById("txt_bookingofficeaddress").value.length>250)
	{
	   alert("Your Booking Address Should not Be more than 250 Characters");
	   return false;
	}
	 
    if(document.getElementById("txt_password").value=="")
	{
	    alert("Please Enter Your Password");
	    document.getElementById("txt_password").style.backgroundColor="lightyellow";
	    document.getElementById("txt_password").focus();
	    return false;
	}
	if(document.getElementById("txt_password").value.length<6)
	{
	    alert("PassWord Should Be At Least 6 Characters")
	    document.getElementById("txt_password").value=""
	    document.getElementById("txt_password").style.backgroundColor="lightyellow";
	    document.getElementById("txt_password").focus();
	    return false;
	}
	if(document.getElementById("txt_passwordcon").value=="")
	{
	    alert("Please Confirm Your Password");
	    document.getElementById("txt_passwordcon").style.backgroundColor="lightyellow";
	    document.getElementById("txt_passwordcon").focus();
	    return false;
	}
	if(document.getElementById("txt_password").value!=document.getElementById("txt_passwordcon").value)
	{
	    alert("Mismatch Your Password & Confirm Password");
	    document.getElementById("txt_passwordcon").style.backgroundColor="lightyellow";
	    document.getElementById("txt_passwordcon").focus();	    
	    return false;
	}			
}
//--------------------------------------------------------------------------------------------------------------------
//Owner Login
function OwnerLogin()
 {
	 if(document.getElementById("txtUName").value=="") 
	 {
		alert("Please Enter your User ID");
		document.getElementById("txtUName").style.backgroundColor="lightyellow";
		document.getElementById("txtUName").focus();
		return false;
	 }
	 
	 if(document.getElementById("txtPassword").value=="") 
	 {
		alert("Please Enter your Password");
		document.getElementById("txtPassword").style.backgroundColor="lightyellow";
		document.getElementById("txtPassword").focus();
		return false;
	 }
	 
	 if(document.getElementById("RB_ht").checked==false && document.getElementById("RB_hh").checked==false && document.getElementById("RB_TA").checked==false) 
	 {
		alert("Select your category");
		return false;
	 }
	 return true;
	 
 }
 //------------------------------------------------------------------------------------------------------------------------
 // Pop Up
function popup1()
{
   var confirmWin = window.open('popup1.aspx','anycontent','width=425,height=75,status');
}
function popup2()
{
   var confirmWin = window.open('popup2.aspx','anycontent','width=425,height=75,status');
}

//---------------------------------------------------------------------------------------------------
//Start OwnerHotelDetails		

function OwnerHotelDetails()
{   
    if(document.getElementById("txtHName").value=="")
    {
        alert("Please Enter Your Hotel Name");
        document.getElementById("txtHName").style.backgroundColor="lightyellow";
        document.getElementById("txtHName").focus();
		return false;
    }    
    if(document.getElementById("drCountry").value=="--Select--")
    {
        alert("Please Select a Country!!");
        document.getElementById("drCountry").focus();
		return false;
    }       
    
//    if(document.getElementById("drCountry").value=="Others")
//	 {
//	    if(document.getElementById("txtcountry").value=="")
//	    {
//	        alert("Please Select a Country!! If not listed Please Select Others");
//	        document.getElementById("txtcountry").style.backgroundColor="lightyellow";
//	        document.getElementById("txtcountry").focus();
//	        return false;
//	    }
//	 }
	 if(document.getElementById("drCountry").value=="India" || document.getElementById("drCountry").value=="United States of America")
	 {
	    if(document.getElementById("drState").value=="--Select--")
        {
            alert("Please Select a State!!");
            document.getElementById("drState").focus();
		    return false;
        }
    }
//	if(document.getElementById("drState").value=="Others")
//	 {   
//	    if(document.getElementById("txtstate").value=="")
//	    {
//	        alert("If You Can't Find Your State In List... Please Enter Your State Name");
//	        document.getElementById("txtstate").style.backgroundColor="lightyellow";
//	        document.getElementById("txtstate").focus();
//	        return false;
//	    }
//	 }
	 if(document.getElementById("drCountry").value=="India")
	 {
        if(document.getElementById("drDistrict").value=="--Select--")
        {
            alert("Please Select a District!!");
            document.getElementById("drDistrict").focus();
		    return false;
        }
    }
//	 if(document.getElementById("drDistrict").value=="Others")
//	 {
//	    if(document.getElementById("txtdistrict").value=="")
//	    {
//	        alert("If You Can't Find Your District In List... Please Enter Your District Name");
//	        document.getElementById("txtdistrict").focus();
//	        return false;
//	    }
//	 }
    if(document.getElementById("drCity").value=="--Select--")
    {
        alert("Please Select a City!!");
        document.getElementById("drCity").focus();
	    return false;
    }
    if(document.getElementById("drCity").value=="Other")
	 {   
	    if(document.getElementById("txt_cityother").value=="")
	    {
	        alert("If You Can't Find Your City In List... Please Enter Your City Name");
	        document.getElementById("txt_cityother").style.backgroundColor="lightyellow";
	        document.getElementById("txt_cityother").focus();
	        return false;
	    }
	 }
	if(document.getElementById("txtHAddress").value=="")
    {
        alert("Please Enter Your Hotel Address");
        document.getElementById("txtHAddress").style.backgroundColor="lightyellow";
        document.getElementById("txtHAddress").focus();
		return false;
    }
    if(document.getElementById("txtHAddress").value.length>100)
    {
        alert("Hotel Address Should not Be more than 100 Characters");
        document.getElementById("txtHAddress").style.backgroundColor="lightyellow";
        document.getElementById("txtHAddress").focus();
		return false;
    }
    if(document.getElementById("txt_location").value!="")
    {
        if(document.getElementById("txt_location").value.length>50)
        {
            alert("Hotel location should not be more than 50 characters");
            document.getElementById("txt_location").style.backgroundColor="lightyellow";
            document.getElementById("txt_location").focus();
		    return false;
        }
    }
    if(document.getElementById("ddl_currencymode").value=="Your Currency Mode")
	 {
	    alert("Please Select Your Currency Mode");
	    document.getElementById("ddl_currencymode").focus();
	    return false;
	 }
	 if(document.getElementById("txt_phoneno").value=="")
	 {
	    alert("Please Enter A Contact Number");
	    document.getElementById("txt_phoneno").style.backgroundColor="lightyellow";
	    document.getElementById("txt_phoneno").focus();
	    return false;
	 }
	 if(document.getElementById("txt_phoneno").value!="")
	 {
	    var contno=document.getElementById("txt_phoneno")
	    if (checkInternationalPhone(contno.value)==false)
	    {
		    alert("Please Enter a Valid(min 10 digit)Phone Number ");
		    contno.value=""
		    document.getElementById("txt_phoneno").style.backgroundColor="lightyellow";
		    contno.focus();
		    return false;
	    }
	 }
     if(document.getElementById("txt_email").value=="")
	 {
	    alert("Please Enter Your Email ID");
	    document.getElementById("txt_email").style.backgroundColor="lightyellow";
	    document.getElementById("txt_email").focus();
	    return false;
	 }
    if(document.getElementById("txt_email").value!="")  
    {
        var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
        if(!emailcheck.test(document.getElementById("txt_email").value))
        {
	        alert("Please enter valid Email");
	        document.getElementById("txt_email").value=""
	        document.getElementById("txt_email").style.backgroundColor="lightyellow";
	        document.getElementById("txt_email").focus();
	        return false;
        }
	}
	if(document.getElementById("drcheckintime").value==0)
	 {
	    alert("Please Select Your Check in time");
	    document.getElementById("drcheckintime").focus()
	    return false;
	 }
	 if(document.getElementById("drcheckouttime").value==0)
	 {
	    alert("Please Select Your Check out time");
	    document.getElementById("drcheckouttime").focus()
	    return false;
	 }
	 
   if(document.getElementById("txt_description").value.length>1500)
    {
        alert("Hotel Description Should not Be more than 1500 Characters");
        document.getElementById("txt_description").style.backgroundColor="lightyellow";
        document.getElementById("txt_description").focus();
		return false;
    }
    if(document.getElementById("txthotelfeatures").value.length>1000)
    {
        alert("Hotel Features Should not Be more than 1000 Characters");
        document.getElementById("txthotelfeatures").style.backgroundColor="lightyellow";
        document.getElementById("txthotelfeatures").focus();
		return false;
    }
//    if(document.getElementById("File_Rules").value=="")
//    {
//        alert("Select Your Rules & Regulations File [.doc,.txt,.pdf]"); 
//        document.getElementById("File_Rules").focus();      
//		return false;
//    } 
//        var ok=window.confirm('Add another hotel ?');
//        if(ok)
//        {
//          //document.getElementById("TextBox3").value="SYSTSOL";
//          return true;	                          			                      
//        }
//        else
//        {
//          //document.getElementById("TextBox3").value="";
//           return false;	                       	                       
//        }      
      return true;
    }
//---------------------------------------------------------------------------------------------------------------
//Start OwnerAddRoomDetails	
function OwnerAddRoomDetails()
{
    var val=/^\d+\d$/;

    if(document.getElementById("TabContainer1_TabPanel1_drCategory").value=="--Select--")
    {
        alert("Please Select a Room Category!!");        
        document.getElementById("TabContainer1_TabPanel1_drCategory").focus()
		return false;
    }  
	if(document.getElementById("TabContainer1_TabPanel1_drCategory").value=="Enter Category")
	 {   
	    if(document.getElementById("TabContainer1_TabPanel1_txtCategory").value=="")
	    {
	        alert("If You Can't Find Your Room Category In List... Please Enter Your Room Category");
	        document.getElementById("TabContainer1_TabPanel1_txtCategory").style.backgroundColor="lightyellow";
	        document.getElementById("TabContainer1_TabPanel1_txtCategory").focus();
	        return false;
	    }
	 }
	 var from=document.getElementById("TabContainer1_TabPanel1_txtRoomNo_From").value;
	 var to=document.getElementById("TabContainer1_TabPanel1_txtRoomNo_To").value;
	if(from=="")
    {
        alert("Please Enter a [Integer] Room No!!");
        document.getElementById("TabContainer1_TabPanel1_txtRoomNo_From").style.backgroundColor="lightyellow";
        document.getElementById("TabContainer1_TabPanel1_txtRoomNo_From").focus()
		return false;
    }
    if(from!="")
    {
        var len=document.getElementById("TabContainer1_TabPanel1_txtRoomNo_From").value.length;
        var count=chk_char("0123456789","TabContainer1_TabPanel1_txtRoomNo_From",len,"Please Enter a [Integer] Room No!!");

        if(count<len)
        {
           return false;
        }        
//        if(chk_char("0123456789","txtRoomNo_From","Please Enter a [Integer] Room No!!"))
//		{
//			alert("Please Enter a [Integer] Room No!!");
//			document.getElementById("txtRoomNo_From").style.backgroundColor="lightyellow";
//			document.getElementById("txtRoomNo_From").focus();
//			return false;
//		}
    }
    if(to!="")
    {
        var len=document.getElementById("TabContainer1_TabPanel1_txtRoomNo_To").value.length;
        var count=chk_char("0123456789","TabContainer1_TabPanel1_txtRoomNo_To",len,"Please Enter a [Integer] Room No!!");
        if(count<len)
        {
           return false;
        }  
    }
    if(from!="" && to!="")
    {
        if(to<from)
		{
			alert("Room no to not less than from!!");
			document.getElementById("TabContainer1_TabPanel1_txtRoomNo_To").style.backgroundColor="lightyellow";
			document.getElementById("TabContainer1_TabPanel1_txtRoomNo_To").focus();
			return false;
		}
    }
    if(document.getElementById("TabContainer1_TabPanel1_Drp_Person").value=="--Select--")
    {
        alert("Please select how many persons are allowed in this room !!");
        document.getElementById("TabContainer1_TabPanel1_Drp_Person").focus()
		return false;
    }
//    if(document.getElementById("txtperson").value!="")
//    {
//        if(!val.test(document.getElementById("txtperson").value))
//		{
//			alert("No Of Person must be integer value.\n");
//			document.getElementById("txtperson").style.backgroundColor="lightyellow";
//			document.getElementById("txtperson").focus();
//			return false;
//		}
//    }
    var rate=document.getElementById("TabContainer1_TabPanel1_txtRate").value;
    if(rate=="")
    {
        alert("Please Enter,Rate of the Room/Night !!");
        document.getElementById("TabContainer1_TabPanel1_txtRate").style.backgroundColor="lightyellow";
        document.getElementById("TabContainer1_TabPanel1_txtRate").focus()
		return false;
    }
    if(rate!="")
    {
        var len=document.getElementById("TabContainer1_TabPanel1_txtRate").value.length;
        var count=chk_char("0123456789","TabContainer1_TabPanel1_txtRate",len,"RATE IS NOT IN CORRECT FORMAT.[ Don't use blank space,$'/.\!@#%^&*()_+{}[]|:;<>? ]\n");
        if(count<len)
        {
           return false;
        }       
		
//		else if(per!="")
//        {
//            if(!val.test(per))
//	        {
//		        alert("PERCENTAGE IS NOT IN CORRECT FORMAT.\n");
//		        document.getElementById("txtPer").focus()
//		        return false;
//	        }
//	        else if(per>100)
//	        {
//		        alert("PERCENTAGE IS NOT MORE THAN 100%.\n");
//		        document.getElementById("txtPer").focus()
//		        return false;
//	        }
//	        else if(per<0)
//	        {
//		        alert("PERCENTAGE IS NOT LESS THAN 0%.\n");
//		        document.getElementById("txtPer").focus()
//		        return false;
//	        }
//        } 
    } 
    var adv=document.getElementById("TabContainer1_TabPanel1_txtAdv").value;
    if(adv!="")
    {
        var len=document.getElementById("TabContainer1_TabPanel1_txtAdv").value.length;
        var count=chk_char("0123456789","TabContainer1_TabPanel1_txtAdv",len,"RATE IS NOT IN CORRECT FORMAT.[ Don't use blank space,$'/.\!@#%^&*()_+{}[]|:;<>? ]\n");
        if(count<len)
        {
           return false;
        } 
//		if(adv>rate)
//		{
//		    alert("ADVANCE IS NOT MORE THAN ROOM RATE.\n");
//			document.getElementById("txtAdv").style.backgroundColor="lightyellow";
//			document.getElementById("txtAdv").focus();
//			return false;
//		}
    } 
    if(document.getElementById("TabContainer1_TabPanel1_txtdescription").value!="")
    {
        if(document.getElementById("TabContainer1_TabPanel1_txtdescription").value.length>1000)
	    {
	       alert("Your Description Should not Be more than 1000 Characters");
	       document.getElementById("TabContainer1_TabPanel1_txtdescription").style.backgroundColor="lightyellow";
	       document.getElementById("TabContainer1_TabPanel1_txtdescription").focus();
	       return false;
	    }
    }  
       
	 return true;
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
function OwnerSpeRoomDetails()
{
    var type=document.getElementById("TabContainer1_TabPanel2_DropDownList2").value;
    var val=/^\d+\d$/;
        
	var from=document.getElementById("TabContainer1_TabPanel2_TextBox1").value;
	if(from=="")
    {
        alert("Please Your "+type+" No!!");
        document.getElementById("TabContainer1_TabPanel2_TextBox1").style.backgroundColor="lightyellow";
        document.getElementById("TabContainer1_TabPanel2_TextBox1").focus()
		return false;
    }
 
    if(document.getElementById("TabContainer1_TabPanel2_TextBox2").value=="")
    {
        alert("Please enter how many Aaccommodation are allowed in this "+type+" !!");
        document.getElementById("TabContainer1_TabPanel2_TextBox2").focus()
		return false;
    }
    var rate=document.getElementById("TabContainer1_TabPanel2_TextBox5").value;
    if(rate=="")
    {
        alert("Please Enter,Rate of the "+type+"/Hour !!");
        document.getElementById("TabContainer1_TabPanel2_TextBox5").style.backgroundColor="lightyellow";
        document.getElementById("TabContainer1_TabPanel2_TextBox5").focus()
		return false;
    }
    if(rate!="")
    {
        var len=document.getElementById("TabContainer1_TabPanel2_TextBox5").value.length;
        var count=chk_char("0123456789","TabContainer1_TabPanel2_TextBox5",len,"RATE IS NOT IN CORRECT FORMAT.[ Don't use blank space,$'/.\!@#%^&*()_+{}[]|:;<>? ]\n");
        if(count<len)
        {
           return false;
        }   
    } 
    var adv=document.getElementById("TabContainer1_TabPanel2_TextBox6").value;
    if(adv=="")
    {
        alert("Please Enter,Advance of the "+type+"/Hour !!");
        document.getElementById("TabContainer1_TabPanel2_TextBox6").style.backgroundColor="lightyellow";
        document.getElementById("TabContainer1_TabPanel2_TextBox6").focus()
		return false;
    }
    if(adv!="")
    {
        var len=document.getElementById("TabContainer1_TabPanel2_TextBox6").value.length;
        var count=chk_char("0123456789","TabContainer1_TabPanel2_TextBox6",len,"RATE IS NOT IN CORRECT FORMAT.[ Don't use blank space,$'/.\!@#%^&*()_+{}[]|:;<>? ]\n");
        if(count<len)
        {
           return false;
        } 

    } 
    if(document.getElementById("TabContainer1_TabPanel2_TextBox7").value=="")
    {
        alert("Please mention the floor no !!");
        document.getElementById("TabContainer1_TabPanel2_TextBox7").style.backgroundColor="lightyellow";
        document.getElementById("TabContainer1_TabPanel2_TextBox7").focus()
		return false;
    }
    if(document.getElementById("TabContainer1_TabPanel2_TextBox9").value!="")
    {
        if(document.getElementById("TabContainer1_TabPanel2_TextBox9").value.length>1000)
	    {
	       alert("Your Description Should not Be more than 1000 Characters");
	       document.getElementById("TabContainer1_TabPanel2_TextBox9").style.backgroundColor="lightyellow";
	       document.getElementById("TabContainer1_TabPanel2_TextBox9").focus();
	       return false;
	    }
    }  
       
	 return true;
}
//---------------------------------------------------------------------------------------------------------------
//Room Booking
function roombooking()
 {
	 if(document.getElementById("txtFName").value=="") 
	 {
		alert("Please enter First Name");
		document.getElementById("txtFName").style.backgroundColor="lightyellow";
		document.getElementById("txtFName").focus();
		return false;
	 }
	 if(document.getElementById("txtLName").value=="") 
	 {
		alert("Please your Last Name");
		document.getElementById("txtLName").style.backgroundColor="lightyellow";
		document.getElementById("txtLName").focus();
		return false;
	 }
	 if(document.getElementById("txtAddress").value=="") 
	 {
		alert("Please Enter your Address");
		document.getElementById("txtAddress").style.backgroundColor="lightyellow";
		document.getElementById("txtAddress").focus();
		return false;
	 }
	 if(document.getElementById("txtAddress").value.length>100)
	{
	   alert("Your Address Should not Be more than 100 Characters");
	   document.getElementById("txtAddress").style.backgroundColor="lightyellow";
	   document.getElementById("txtAddress").focus();
	   return false;
	}
	 if(document.getElementById("DrAge").value=="Select Age") 
	 {
		alert("Please Select Age");
		document.getElementById("DrAge").focus()
		return false;
	 }
	 if(document.getElementById("drCountry").value=="--Select--") 
	 {
		alert("Please Select your Country");
		document.getElementById("drCountry").focus()
		return false;
	 }

	 if(document.getElementById("txtEmail").value=="") 
	 {
		alert("Please enter your Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
	 var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	 if(!emailcheck.test(document.getElementById("txtEmail").value))
	 {
		alert("Please enter valid Email");
		document.getElementById("txtEmail").focus()
		return false;
	 }
	 if(document.getElementById("chk_terms").checked==false)
	{
        alert("Please Select The Terms & Condition");
        document.getElementById("chk_terms").focus();
		return false;
	}
//	 if(document.getElementById("txtPhoneNo").value=="")
//	 {
//        alert("Please Enter Your Valid(min 10 digit)Phone Number ");
//	    document.getElementById("txtPhoneNo").style.backgroundColor="lightyellow";
//	    Phone.focus();
//	    return false;
//	 }
//    var Phone=document.getElementById("txtPhoneNo");
//    if(Phone!="")
//    {
//        if (checkInternationalPhone(Phone.value)==false)
//        {
//	        alert("Please Enter a Valid(min 10 digit)Phone Number ");
//	        document.getElementById("txtPhoneNo").style.backgroundColor="lightyellow";
//	        Phone.focus();
//	        return false;
//        }
//    }	  
//	if(document.getElementById("txt_mobile").value!="")
//	{
//        var Phone=document.getElementById("txt_mobile");
//	
//	    if (checkInternationalPhone(Phone.value)==false)
//	    {
//		    alert("Please Enter a Valid(min 10 digit)Mobile Number ");
//		    Phone.value=""
//		    document.getElementById("txt_mobile").style.backgroundColor="lightyellow";
//		    Phone.focus();
//		    return false;
//	    }	    
//	}
	
	return true;	
}
//--------------------------------------------------------------------------------------------------------------------
//Room Booking1
function roombooking1()
 {    
	 if(document.getElementById("txtFName").value=="") 
	 {
		alert("Please enter First Name");
		document.getElementById("txtFName").style.backgroundColor="lightyellow";
		document.getElementById("txtFName").focus();
		return false;
	 }
	 if(document.getElementById("txtLName").value=="") 
	 {
		alert("Please your Last Name");
		document.getElementById("txtLName").style.backgroundColor="lightyellow";
		document.getElementById("txtLName").focus();
		return false;
	 }
	 if(document.getElementById("txtAddress").value=="") 
	 {
		alert("Please Enter your Address");
		document.getElementById("txtAddress").style.backgroundColor="lightyellow";
		document.getElementById("txtAddress").focus();
		return false;
	 }
	 if(document.getElementById("txtAddress").value.length>100)
	{
	   alert("Your Address Should not Be more than 100 Characters");
	   document.getElementById("txtAddress").style.backgroundColor="lightyellow";
	   document.getElementById("txtAddress").focus();
	   return false;
	}
	 if(document.getElementById("DrAge").value=="Select Age") 
	 {
		alert("Please Select Age");
		document.getElementById("DrAge").focus()
		return false;
	 }
	 if(document.getElementById("drCountry").value=="--Select--") 
	 {
		alert("Please Select your Country");
		document.getElementById("drCountry").focus()
		return false;
	 }
	 if(document.getElementById("txtEmail").value=="") 
	 {
		alert("Please enter your Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
	 var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	 if(!emailcheck.test(document.getElementById("txtEmail").value))
	 {
		alert("Please enter valid Email");
		document.getElementById("txtEmail").focus()
		return false;
	 }
	if(document.getElementById("txtPhoneNo").value!="")
	{
        var Phone=document.getElementById("txtPhoneNo")
	
	    if (checkInternationalPhone(Phone.value)==false)
	    {
		    alert("Please Enter a Valid(min 10 digit)Phone Number ");
		    Phone.value=""
		    document.getElementById("txtPhoneNo").style.backgroundColor="lightyellow";
		    Phone.focus();
		    return false;
	    }	    
	}
	if(document.getElementById("txt_mobile").value!="")
	{
        var Phone=document.getElementById("txt_mobile")
	
	    if (checkInternationalPhone(Phone.value)==false)
	    {
		    alert("Please Enter a Valid(min 10 digit)Mobile Number ");
		    Phone.value=""
		    document.getElementById("txt_mobile").style.backgroundColor="lightyellow";
		    Phone.focus();
		    return false;
	    }	    
	}
	if(document.getElementById("DrPaymentMode").value=="--Select--")
      {
        alert("Please Select your Payment Mode");
        document.getElementById("DrPaymentMode").focus();
        return false;
      }
	return true;	
}
//--------------------------------------------------------------------------------------------------------------------
function roombookingbanquet()
 {
     var D1=document.getElementById("txt_chkin").value;
     var D2=document.getElementById("txt_chkout").value;
     
     var T1=document.getElementById("Drp_1").value;
     var T2=document.getElementById("Drp_2").value;
     
     var T3=D1+' '+T1.substring(0, (T1.length) - 2) + ":00:00" + T1.substring((T1.length) - 2,T1.length);
     var T4=D2+' '+T2.substring(0, (T2.length) - 2) + ":00:00" + T2.substring((T2.length) - 2,T2.length);
     
     var dt=new Date();
     var dt1 = new Date(Date.parse(D1)); 
     var dt2 = new Date(Date.parse(D2));
     
     var dt3 = new Date(Date.parse(T3));
     var dt4 = new Date(Date.parse(T4)); 
     
     if(D1=="" || D1=="mm/dd/yyyy")
     {
	    alert("Please select a date");
	    document.getElementById("txt_chkin").style.backgroundColor="lightyellow";
	    document.getElementById("txt_chkin").focus();
	    return false;
     }
     if(dt1=="NaN") 
     {
	    alert("Please select a valid date");
	    document.getElementById("txt_chkin").style.backgroundColor="lightyellow";
	    document.getElementById("txt_chkin").focus();
	    return false;
     }
     if(T1=="--Select--")
     {
	    alert("Please select a time");
	    document.getElementById("Drp_1").focus();
	    return false;
     }
     
	 if(D2=="" || D2=="mm/dd/yyyy")
     {
	    alert("Please select a date");
	    document.getElementById("txt_chkout").style.backgroundColor="lightyellow";
	    document.getElementById("txt_chkout").focus();
	    return false;
     }
     if(dt2=="NaN") 
     {
	    alert("Please select a valid date");
	    document.getElementById("txt_chkout").style.backgroundColor="lightyellow";
	    document.getElementById("txt_chkout").focus();
	    return false;
     }
     if(T2=="--Select--")
     {
	    alert("Please select a time");
	    document.getElementById("Drp_2").focus();
	    return false;
     }
     if(dt3>=dt4)
     {
        alert("CheckOut time not less than CheckIn time ");
        document.getElementById("txt_chkout").style.backgroundColor="lightyellow";
	    document.getElementById("Drp_2").focus();
        return false;
     }
     //*******************************************************//
     if(document.getElementById("txtFName").value=="") 
	 {
		alert("Please enter First Name");
		document.getElementById("txtFName").style.backgroundColor="lightyellow";
		document.getElementById("txtFName").focus();
		return false;
	 }
	 if(document.getElementById("txtLName").value=="") 
	 {
		alert("Please your Last Name");
		document.getElementById("txtLName").style.backgroundColor="lightyellow";
		document.getElementById("txtLName").focus();
		return false;
	 }
	 if(document.getElementById("txtAddress").value=="") 
	 {
		alert("Please Enter your Address");
		document.getElementById("txtAddress").style.backgroundColor="lightyellow";
		document.getElementById("txtAddress").focus();
		return false;
	 }
	 if(document.getElementById("txtAddress").value.length>100)
	 {
	   alert("Your Address Should not Be more than 100 Characters");
	   document.getElementById("txtAddress").style.backgroundColor="lightyellow";
	   document.getElementById("txtAddress").focus();
	   return false;
	 }
	 if(document.getElementById("DrAge").value=="Select Age") 
	 {
		alert("Please Select Age");
		document.getElementById("DrAge").focus()
		return false;
	 }
	 if(document.getElementById("drCountry").value=="--Select--") 
	 {
		alert("Please Select your Country");
		document.getElementById("drCountry").focus()
		return false;
	 }

	 if(document.getElementById("txtEmail").value=="") 
	 {
		alert("Please enter your Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
	 var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	 if(!emailcheck.test(document.getElementById("txtEmail").value))
	 {
		alert("Please enter valid Email");
		document.getElementById("txtEmail").focus()
		return false;
	 }
	 if(document.getElementById("chk_terms").checked==false)
	 {
        alert("Please Select The Terms & Condition");
        document.getElementById("chk_terms").focus();
		return false;
	 }
	
	return true;	
}
//-------------------------------------------------------------------------------------------------------------
//Start UpdateRoomStatus

function updateroomstatus()
{
    if(document.getElementById("drroomtype").value=="Select Room Type")
	{
		alert("Please Select RoomType");
		return false;
	}
	if(document.getElementById("drroomno").value=="Select Room No")
	{
		alert("Please Select RoomNo.");
		return false;
	}
	if(document.getElementById("txtfromdate").value=="")
	{
		alert("Please Select FromDate");
		return false;
	}
	if(document.getElementById("txttodate").value=="")
	{
		alert("Please Select ToDate");
		return false;
	}
}
//.............................................................................................................................

//AdminHolidayHomeDetails
function holidayHomeValidate()
{
    if(document.getElementById("txt_holidayname").value=="")
    {
        alert("Please Enter Your Holiday Home Name");
        return false;
    }
    if(document.getElementById("txt_address").value=="")
    {
        alert("Please Enter Your Holiday Home Address");
        return false;
    }
    if(document.getElementById("ddl_country").value=="--Select--")
    {
        alert("Please Enter Country");
        return false;
    }
    if(document.getElementById("ddl_country").value=="India")
	 {
	    if(document.getElementById("ddl_state").value=="--Select--") 
	    {
		  alert("Please Enter Your State");
		  return false;
		}
	    if(document.getElementById("ddl_state").value!="--Select--" && document.getElementById("ddl_touristspot").value=="--Select--")
		{
			alert("Please Enter Your Touristspot");
			return false;
		}
	}
	
	if(document.getElementById("ddl_country").value=="Others")
	 {
	    if(document.getElementById("txtcountry").value=="")
	    {
	        alert("If You Can't Find Your Country In List /n Please Enter Your Country Name");
	        return false;
	    }
	 }
	 if(document.getElementById("ddl_state").value=="Others")
	 {   
	    if(document.getElementById("txtstate").value=="")
	    {
	        alert("If You Can't Find Your State In List /n Please Enter Your State Name");
	        return false;
	    }
	 }
	 if(document.getElementById("ddl_touristspot").value=="Others")
	 {
	    if(document.getElementById("txttouristspot").value=="")
	    {
	        alert("If You Can't Find Your TouristSpot In List /n Please Enter Your TouristSpot Name");
	        return false;
	    }
	 }
	 
	if(document.getElementById("txt_email").value!="")
	    {
		    var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
		    if(!emailcheck.test(document.getElementById("txt_email").value))
		    {
			   alert("Please enter valid Email");
			   document.getElementById("txt_email").value==""
			   document.getElementById("txt_email").focus()
			   return false;
		    }
	    }
	
	if(document.getElementById("txt_contactno").value!="") 
	 {
        var Phone=document.getElementById("txt_contactno")	
	    if (checkInternationalPhone(Phone.value)==false)
	    {
		    alert("Please Enter a Valid(min 10 digit)Phone Number ");
		    Phone.value=""
		    Phone.focus()
		    return false;
	    }	    
	 } 
}
function holidayHomeValidate1()
{
    if(document.getElementById("txt_noofroom").value=="")
    {
        alert("Please Enter Your Holiday Home Name");
        return false;
    }
    if(document.getElementById("txt_bedperroom").value=="")
    {
        alert("Please Enter Your Holiday Home Name");
        return false;
    }
    if(document.getElementById("txt_rateperroom").value=="")
    {
        alert("Please Enter Your Holiday Home Name");
        return false;
    }
    if(document.getElementById("rdbattached").value=="" || document.getElementById("rdbnotattched").value=="")
    {
        alert("Please Confirm That Bathrooms Are Attached or Not...");
        return false;
    }
    if(document.getElementById("rdbyes").value=="" || document.getElementById("rdbno").value=="")
    {
        alert("Please Confirm That Do U Have Any Kitchen or Not...");
        return false;
    }
    if(document.getElementById("rdby").value=="" || document.getElementById("rdbn").value=="")
    {
        alert("Please Confirm That Do U Have Any Utensils or Not...");
        return false;
    }
}
//.......................................................................................................................
//Start AdminLogin

function adminvalidation()
		{
    	var fname=document.getElementById("txtFName").value;
    	var lname=document.getElementById("txtLName").value;
	   	var address=document.getElementById("txtAddress").value;
        var country=document.getElementById("drCountry").value;
        var state=document.getElementById("drState").value;
        var district=document.getElementById("drDistrict").value;
        var phone=document.getElementById("txtPhoneNo").value;
        var validChars1="0123456789+-";
        var strChars1;
        var result1=true;
	    var email=document.getElementById("txtEmail").value;
 	    

		if(fname=="")
		{
			alert("Please Enter 'First Name '.\n");
			return false;
		}
	   
		if(lname=="")
		{
		    alert("Please Enter 'Last Name'.\n");
		    return false;
		}
		
	    if(address=="")
		{
			alert("Please Enter 'ADDRESS'.\n");
			return false;
		}

		if(phone=="")
		{
			alert("Please Select 'PHONE NO'.\n");
			return false;
		}
		if(phone!="")
		{
		    var Phone1=document.getElementById("txtPhoneNo")
	
	        if (checkInternationalPhone(Phone1.value)==false)
	        {
		        alert("Please Enter a Valid(min 10 digit)Phone Number ");
		        Phone1.value=""
		        Phone1.focus()
		        return false;
	        }
		}

		
	 if(email=="")
		{
			alert("FILL the 'EMAIL-ID' Field.\n");
			
			return false;
		}

	 if(document.getElementById("txtEmail").value!="")
	    {
		    var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
		    if(!emailcheck.test(document.getElementById("txtEmail").value))
		    {
			   alert("Please enter valid Email");
			   document.getElementById("txt_email").value==""
			   document.getElementById("txt_email").focus()
			   return false;
		    }
	    }
	
	return true;
}

//End AdminLogin
//...................................................................................................................
//Start ChequeDraftPopUp


function ChequeDraftPopUp()
		{
			
			if(document.getElementById("txtBName").value=="")
			{
			  alert("Please enter the Bank Name");
			  return false;
			}
			if(document.getElementById("txtAddress").value=="")
			{
			  alert("Please enter the Bank Address");
			  return false;
			}
			if(document.getElementById("txtCheque").value=="")
			{
			  alert("Please enter the Cheque Number");
			  return false;
			}
			
			if(document.getElementById("txtCDate").value=="")
			{
			  alert("Please enter the issue date");
			  return false;
			}
		}		
		
//End ChequeDraftPopUp
//...................................................................................................................
function HolidayHomeEdit()
{
    if(document.getElementById("txt_name").value=="") 
	 {
		alert("Please enter Holiday Home Name");
		document.getElementById("txt_name").focus()
		return false;
	 }
	 if(document.getElementById("dr_country").value=="--Select--") 
	 {
		alert("Please Select your Country");
		document.getElementById("dr_country").focus()
		return false;
	 }
	 if(document.getElementById("dr_country").value=="Others")
	 {
	    if(document.getElementById("txtcountry").value=="")
	    {
	        alert("If You Can't Find Your Country In List!! Please Enter Your Country Name");
	        document.getElementById("txtcountry").focus()
	        return false;
	    }
	 }
	 if(document.getElementById("dr_state").value=="--Select--") 
	 {
		alert("Please Select your State");
		document.getElementById("dr_state").focus()
		return false;
	 }
	 if(document.getElementById("dr_state").value=="Others")
	 {   
	    if(document.getElementById("txtstate").value=="")
	    {
	        alert("If You Can't Find Your State In List!! Please Enter Your State Name");
	        document.getElementById("txtstate").focus()
	        return false;
	    }
	 }
	 if(document.getElementById("dr_touristspot").value=="--Select--") 
	 {
		alert("Please Select your tourist spot");
		document.getElementById("dr_touristspot").focus()
		return false;
	 }
	 if(document.getElementById("dr_touristspot").value=="Others")
	 {
	    if(document.getElementById("txttouristspot").value=="")
	    {
	        alert("If You Can't Find Your tourist spot In List!! Please Enter Your tourist spot Name");
	        document.getElementById("txttouristspot").focus()
	        return false;
	    }
	 }
	 if(document.getElementById("txt_address").value=="") 
	 {
		alert("Please enter your Address");
		document.getElementById("txt_Address").focus()
		return false;
	 }
	if(document.getElementById("txt_Address").value.length>250)
	{
	   alert("Your Address Should not Be more than 250 Characters");
	   return false;
	} 
	if(document.getElementById("txtemail").value=="") 
	 {
		alert("Please enter your Email");
		document.getElementById("txtemail").focus()
		return false;
	 }
	 var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	 if(!emailcheck.test(document.getElementById("txtemail").value))
	 {
		alert("Please enter valid Email");
		document.getElementById("txtemail").focus()
		return false;
	 }
	 if(document.getElementById("txt_contactno").value=="")
	{
        alert("Please Enter Your Contact number");
        document.getElementById("txt_contactno").focus()
		return false;
	}
	if(document.getElementById("txt_contactno").value!="")
	{
        var Phone=document.getElementById("txt_contactno")
	
	    if (checkInternationalPhone(Phone.value)==false)
	    {
		    alert("Please Enter a Valid(min 10 digit)Phone Number ");
		    Phone.value=""
		    Phone.focus()
		    return false;
	    }	    
	}	 
	if(document.getElementById("txt_bookingoffice").value=="") 
	 {
		alert("Please enter your Booking Address");
		document.getElementById("txt_bookingoffice").focus()
		return false;
	 }
	if(document.getElementById("txt_bookingoffice").value.length>250)
	{
	   alert("Your Booking Address Should not Be more than 250 Characters");
	   return false;
	}	
	 return true;
}


//End HolidayHomeEdit
//.....................................................................................................
//Holiday Home Room
function HolidayHomeRoomRegistration()
 {
	 if(document.getElementById("txt_rno").value=="") 
	 {
		alert("Please enter Room No");
		document.getElementById("txt_rno").style.backgroundColor="lightyellow";
		document.getElementById("txt_rno").focus()
		return false;
	 }
	 
	 if(document.getElementById("txt_bedno").value=="") 
	 {
		alert("Please enter Bed No");
		document.getElementById("txt_bedno").style.backgroundColor="lightyellow";
		document.getElementById("txt_bedno").focus()
		return false;
	 }
	 if(document.getElementById("txt_rate").value=="") 
	 {
		alert("Please enter Rate/Day");
		document.getElementById("txt_rate").style.backgroundColor="lightyellow";
		document.getElementById("txt_rate").focus()
		return false;
	 }
	 if(document.getElementById("RadioButton1").checked==false && document.getElementById("RadioButton2").checked==false) 
	 {
		alert("Please Mention about Attach Bathroom");
		return false;
	 }
	 if(document.getElementById("RadioButton3").checked==false && document.getElementById("RadioButton4").checked==false) 
	 {
		alert("Please Mention about Home Kitchen");
		return false;
	 }
	 if(document.getElementById("RadioButton5").checked==false && document.getElementById("RadioButton6").checked==false) 
	 {
		alert("Please Mention about Kitchen appliance");
		return false;
	 }
	 if(document.getElementById("txt_features").value=="") 
	 {
		alert("Please enter Room features");
		document.getElementById("txt_features").style.backgroundColor="lightyellow";
		document.getElementById("txt_features").focus()
		return false;
	 } 
	if(document.getElementById("txt_features").value.length>250)
	{
	   alert("Your Room Features Should not Be more than 250 Characters");
	   document.getElementById("txt_features").style.backgroundColor="lightyellow";
	   document.getElementById("txt_features").focus()
	   return false;
	}	
}
function validate()
 {
	 if(document.getElementById("txtUName").value=="") 
	 {
		alert("Please Enter your User ID");
		return false;
	 }
	 
	 if(document.getElementById("txtPassword").value=="") 
	 {
		alert("Please Enter your Password");
		return false;
	 }
	  
	 return true;
	 
 } 
function validateUpdateUNamePwd()
 {

	 if(document.getElementById("txtOPwd").value=="") 
	 {
		alert("Please enter your current Password");
		document.getElementById("txtOPwd").style.backgroundColor="lightyellow";
		document.getElementById("txtOPwd").focus();
		return false;
	 }
	 if(document.getElementById("txtPwd").value=="") 
	 {
		alert("Please enter your new Password");
		document.getElementById("txtPwd").style.backgroundColor="lightyellow";
		document.getElementById("txtPwd").focus();
		return false;
	 }
	 if(document.getElementById("txtPwd").value.length<6)
	{
	   alert("Your Password Should not be less than 6 Characters");
	   document.getElementById("txtPwd").style.backgroundColor="lightyellow";
	   document.getElementById("txtPwd").focus();
	   return false;
	}
	 if(document.getElementById("txtCPwd").value=="") 
	 {
		alert("Please retype your new Password");
		document.getElementById("txtCPwd").style.backgroundColor="lightyellow";
		document.getElementById("txtCPwd").focus();
		return false;
	 }
	 if(document.getElementById("txtPwd").value!=document.getElementById("txtCPwd").value) 
	 {
		alert("Sorry, Password mismatch...");
		document.getElementById("txtCPwd").style.backgroundColor="lightyellow";
		document.getElementById("txtCPwd").focus();
		return false;
	 }	  
	 return true;
	 
 }
 //--------------------------------------------------------------------------------------------------------------
 //Owner Registration
function createuser()
 {
	 if(document.getElementById("txtFName").value=="") 
	 {
		alert("Please enter your First Name");
		document.getElementById("txtFName").style.backgroundColor="lightyellow";
		document.getElementById("txtFName").focus();
		return false;
	 }
	 if(document.getElementById("txtLName").value=="") 
	 {
		alert("Please enter your Last Name");
		document.getElementById("txtLName").style.backgroundColor="lightyellow";
		document.getElementById("txtLName").focus();
		return false;
	 }
	 if(document.getElementById("txtAddress").value=="") 
	 {
		alert("Please enter your Address");
		document.getElementById("txtAddress").style.backgroundColor="lightyellow";
		document.getElementById("txtAddress").focus();
		return false;
	 }
	
	if(document.getElementById("txtAddress").value.length>200)
	{
	   alert("Your Address Should not Be more than 200 Characters");
	   document.getElementById("txtAddress").style.backgroundColor="lightyellow";
	   document.getElementById("txtAddress").focus();
	   return false;
	}
	
	 if(document.getElementById("drCountry").value=="--Select--") 
	 {
		alert("Please Select your Country");
		document.getElementById("drCountry").focus();
		return false;
	 }

	 if(document.getElementById("drCountry").value=="Others")
	 {
	    if(document.getElementById("txtcountry").value=="")
	    {
	        alert("If You Can't Find Your Country In List!! Please Enter Your Country Name");
	        document.getElementById("txtcountry").style.backgroundColor="lightyellow";
	        document.getElementById("txtcountry").focus();
	        return false;
	    }
	    
	 }
	 if(document.getElementById("drCountry").value=="India" || document.getElementById("drCountry").value=="United States of America")
	 {
	     if(document.getElementById("drState").value=="--Select--") 
	     {
		    alert("Please Select your State");
		    document.getElementById("drState").focus();
		    return false;
	     }
	 }
	 if(document.getElementById("drState").value=="Others")
	 {   
	    if(document.getElementById("txtstate").value=="")
	    {
	        alert("If You Can't Find Your State In List!! Please Enter Your State Name");
	        document.getElementById("txtstate").style.backgroundColor="lightyellow";
	        document.getElementById("txtstate").focus();
	        return false;
	    }
	    
	 }
	 if(document.getElementById("drCountry").value=="India")
	 {
	     if(document.getElementById("drDistrict").value=="--Select--") 
	     {
		    alert("Please Select your District");
		    document.getElementById("drDistrict").focus();
		    return false;
	     }
	 }
	 if(document.getElementById("drDistrict").value=="Others")
	 {
	    if(document.getElementById("txtdistrict").value=="")
	    {
	        alert("If You Can't Find Your District In List!! Please Enter Your District Name");
	        document.getElementById("txtdistrict").style.backgroundColor="lightyellow";
	        document.getElementById("txtdistrict").focus();
	        return false;
	    }
	   
	 }
	 if(document.getElementById("txtcontactno").value=="")
	{
            alert("Please Enter Your Contact number");
            document.getElementById("txtcontactno").style.backgroundColor="lightyellow";
            document.getElementById("txtcontactno").focus();
			return false;
	}
	
	if(document.getElementById("txtContactNo").value!="")
	{
        var Phone=document.getElementById("txtContactNo")
	
	    if (checkInternationalPhone(Phone.value)==false)
	    {
		    alert("Please Enter a Valid(min 10 digit)Phone Number ");
		    document.getElementById("txtContactNo").style.backgroundColor="lightyellow";		   
		    document.getElementById("txtContactNo").value="";		     
		    document.getElementById("txtContactNo").focus();
		    return false;
	    }
	       
	}	 
	 if(document.getElementById("txtEmail").value=="") 
	 {
		alert("Please enter your Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
	 
	 var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	 if(!emailcheck.test(document.getElementById("txtEmail").value))
	 {
		alert("Please enter valid Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
	 
    if(document.getElementById("txtpassword").value=="")
	{
	    alert("Please Enter Your Password");
	    document.getElementById("txtpassword").style.backgroundColor="lightyellow";
	    document.getElementById("txtpassword").focus();
	    return false;
	}
	
	if(document.getElementById("txtpassword").value.length<6)
	{
	    alert("PassWord Should Be At Least 6 Characters");
	    document.getElementById("txtpassword").style.backgroundColor="lightyellow";
	    document.getElementById("txtpassword").focus();
	    return false;
	}
	
	if(document.getElementById("txtconfirmpassword").value=="")
	{
	    alert("Please Confirm Your Password");
	    document.getElementById("txtconfirmpassword").style.backgroundColor="lightyellow";
	    document.getElementById("txtconfirmpassword").focus();
	    return false;
	}
	
	if(document.getElementById("txtpassword").value!=document.getElementById("txtconfirmpassword").value)
	{
	    alert("Mismatch Your Password & Confirm Password")
	    document.getElementById("txtconfirmpassword").style.backgroundColor="lightyellow";
	    document.getElementById("txtconfirmpassword").focus();
	    return false;
	}
			
}
//--------------------------------------------------------------------------------------------------------------------
//Corporate Registration
function corpregn()
 {
	 if(document.getElementById("txt_cid").value=="") 
	 {
		alert("Please enter Corporate ID Name");
		document.getElementById("txt_cid").style.backgroundColor="lightyellow";
		document.getElementById("txt_cid").focus();
		return false;
	 }
	 if(document.getElementById("txt_cnm").value=="") 
	 {
		alert("Please enter your Corporate Name");
		document.getElementById("txt_cnm").style.backgroundColor="lightyellow";
		document.getElementById("txt_cnm").focus();
		return false;
	 }
	 if(document.getElementById("txt_contactnm").value=="") 
	 {
		alert("Please enter contact person name");
		document.getElementById("txt_contactnm").style.backgroundColor="lightyellow";
		document.getElementById("txt_contactnm").focus();
		return false;
	 }
	
	 if(document.getElementById("DrpCountry").value=="--Select--") 
	 {
		alert("Please Select your Country");
		document.getElementById("DrpCountry").focus();
		return false;
	 }

	if(document.getElementById("DrpCity").value=="--Select--") 
	 {
		alert("Please Select your DrpCity");
		document.getElementById("DrpCity").focus();
		return false;
	 }
	if(document.getElementById("txtAddress").value=="")
	{
            alert("Please Enter Your Address");
            document.getElementById("txtAddress").style.backgroundColor="lightyellow";
            document.getElementById("txtAddress").focus();
			return false;
	}
	if(document.getElementById("txtEmail").value=="") 
	 {
		alert("Please enter corporate Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
	 
	 var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	 if(!emailcheck.test(document.getElementById("txtEmail").value))
	 {
		alert("Please enter valid Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }	
	if(document.getElementById("txt_contactno").value=="")
	{
        alert("Please Enter a Valid(min 10 digit)Phone Number ");
	    document.getElementById("txt_contactno").style.backgroundColor="lightyellow";		   
	    document.getElementById("txt_contactno").focus();
	    return false;
	       
	}	
	if(document.getElementById("txt_contactno").value!="")
	{
        var Phone=document.getElementById("txt_contactno")
	
	    if (checkInternationalPhone(Phone.value)==false)
	    {
		    alert("Please Enter a Valid(min 10 digit)Phone Number ");
		    document.getElementById("txt_contactno").style.backgroundColor="lightyellow";		   
		    document.getElementById("txt_contactno").focus();
		    return false;
	    }
	       
	}	 
	 
}

//--------------------------------------------------------------------------------------------------------------------
//Corporate Registration
function corpupdate()
 {
	 if(document.getElementById("Drp_cid").value=="--Select--") 
	 {
		alert("Please select corporate ID");
		document.getElementById("Drp_cid").focus();
		return false;
	 }
	 if(document.getElementById("txt_cnm").value=="") 
	 {
		alert("Please enter your Corporate Name");
		document.getElementById("txt_cnm").style.backgroundColor="lightyellow";
		document.getElementById("txt_cnm").focus();
		return false;
	 }
	 if(document.getElementById("txt_contactnm").value=="") 
	 {
		alert("Please enter contact person name");
		document.getElementById("txt_contactnm").style.backgroundColor="lightyellow";
		document.getElementById("txt_contactnm").focus();
		return false;
	 }
	
	 if(document.getElementById("DrpCountry").value=="--Select--") 
	 {
		alert("Please Select your Country");
		document.getElementById("DrpCountry").focus();
		return false;
	 }

	if(document.getElementById("DrpCity").value=="--Select--") 
	 {
		alert("Please Select your DrpCity");
		document.getElementById("DrpCity").focus();
		return false;
	 }
	if(document.getElementById("txtAddress").value=="")
	{
            alert("Please Enter Your Address");
            document.getElementById("txtAddress").style.backgroundColor="lightyellow";
            document.getElementById("txtAddress").focus();
			return false;
	}
	if(document.getElementById("txtEmail").value=="") 
	 {
		alert("Please enter corporate Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }
	 
	 var emailcheck=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	 if(!emailcheck.test(document.getElementById("txtEmail").value))
	 {
		alert("Please enter valid Email");
		document.getElementById("txtEmail").style.backgroundColor="lightyellow";
		document.getElementById("txtEmail").focus();
		return false;
	 }	
	if(document.getElementById("txt_contactno").value=="")
	{
        alert("Please Enter a Valid(min 10 digit)Phone Number ");
	    document.getElementById("txt_contactno").style.backgroundColor="lightyellow";		   
	    document.getElementById("txt_contactno").focus();
	    return false;
	       
	}	
	if(document.getElementById("txt_contactno").value!="")
	{
        var Phone=document.getElementById("txt_contactno")
	
	    if (checkInternationalPhone(Phone.value)==false)
	    {
		    alert("Please Enter a Valid(min 10 digit)Phone Number ");
		    document.getElementById("txt_contactno").style.backgroundColor="lightyellow";		   
		    document.getElementById("txt_contactno").focus();
		    return false;
	    }
	       
	}	 
	 
}
//--------------------------------------------------------------------------------------------------------------------
//-----------Change Secrat Code-----------------------------
function validateSecretCode()
 {
	 if(document.getElementById("txt_oldsecretcode").value=="") 
	 {
		alert("Please enter your current SecretCod");
		document.getElementById("txt_oldsecretcode").style.backgroundColor="lightyellow";
		document.getElementById("txt_oldsecretcode").focus();
		return false;
	 }
	 if(document.getElementById("txt_newsecretcode").value=="") 
	 {
		alert("Please enter your new SecretCod");
		document.getElementById("txt_newsecretcode").style.backgroundColor="lightyellow";
		document.getElementById("txt_newsecretcode").focus();
		return false;
	 }
	 if(document.getElementById("txt_newsecretcode").value.length<6)
	 {
	   alert("Your SecretCod Should not be less than 6 Characters");
	   document.getElementById("txt_newsecretcode").style.backgroundColor="lightyellow";
	   document.getElementById("txt_newsecretcode").focus();
	   return false;
	}
	 if(document.getElementById("txt_confirm").value=="") 
	 {
		alert("Please retype your new SecretCod");
		document.getElementById("txt_confirm").style.backgroundColor="lightyellow";
		document.getElementById("txt_confirm").focus();
		return false;
	 }
	 if(document.getElementById("txt_newsecretcode").value!=document.getElementById("txt_confirm").value) 
	 {
		alert("Sorry, SecretCod mismatch...");
		document.getElementById("txt_confirm").style.backgroundColor="lightyellow";
		document.getElementById("txt_confirm").focus();
		return false;
	 }	  
	 return true;	 
 }
 //--------------------------------------------------------------------------------------------------------------
 function chk_date(d1,d2,msg)
 {
     var D1=document.getElementById(d1).value;
     var D2=document.getElementById(d2).value;
     
      var dt=new Date();
         var dt1 = new Date(Date.parse(D1)); 
         var dt2 = new Date(Date.parse(D2));
         if(D1=="" || D1=="mm/dd/yyyy")
	     {
		    alert("Please select a date");
		    document.getElementById(d1).style.backgroundColor="lightyellow";
		    document.getElementById(d1).focus();
		    return false;
	     }
	     if(dt1=="NaN") 
	     {
		    alert("Please select a valid date");
		    document.getElementById(d1).style.backgroundColor="lightyellow";
		    document.getElementById(d1).focus();
		    return false;
	     }
	     if(msg=="CheckOut date must not be less than CheckIn date !")
	     {
            var today=new Date(Date.parse(dt.toDateString()));
            if(today>dt1)
            {
               alert("Your can not select previous date!");
               document.getElementById(d1).style.backgroundColor="lightyellow";
	           document.getElementById(d1).focus();
               return false;
            }
	     }
	     if(D2=="" || D2=="mm/dd/yyyy")  
	     {
		    alert("Please select a date");
		    document.getElementById(d2).style.backgroundColor="lightyellow";
		    document.getElementById(d2).focus();
		    return false;
	     }
	     if(dt2=="NaN")  
	     {
		    alert("Please select a valid date");
		    document.getElementById(d2).style.backgroundColor="lightyellow";
		    document.getElementById(d2).focus();
		    return false;
	     }
	     if(dt1>dt2)
	     {
	        alert(msg);
	        document.getElementById(d2).style.backgroundColor="lightyellow";
		    document.getElementById(d2).focus();
	        return false;
	     }
	     if(msg=="CheckOut date must not be less than CheckIn date !")
	     {
            var one_day=1000*60*60*24;  
            var daydiff=parseInt(dt2.getTime()-dt1.getTime())/(one_day);
	        if(daydiff>30)
            {
               alert("Your booking duration not more than 30 days !");
               document.getElementById(d2).style.backgroundColor="lightyellow";
	           document.getElementById(d2).focus();
               return false;
            }
	       if(document.getElementById("ddl_room_catagory").value=="Select Room Type") 
	       {
		     alert("Please select the room type !");
		     document.getElementById("ddl_room_catagory").focus();
		     return false;
	       }
	     }
	 return true;
 }
   