// JavaScript Document
function numonly()
{
	if ( (event.keyCode>47 && event.keyCode<58 ) || (event.keyCode==32)|| (event.keyCode==46))
	{
 	    document.getElementById("contactno").style.backgroundColor='#FEEFA9';
		 return true;
	}
	else
		return false
}

function charsonly()
{
/*	if (!(event.keyCode>47 && event.keyCode<58 ) || (event.keyCode==32)|| (event.keyCode==46))
	{
  	     document.getElementById("name").style.backgroundColor='#FEEFA9';
		 return true;
	}
	else
		return false
*/
}
function validate()
{
var d1,d2,n1,n2,n3,n4;
d1=document.form1.txt_date1.value;
d2=document.form1.txt_date2.value;
n1=document.form1.noofguests.value;
n2=document.form1.adults.value;
n3=document.form1.children.value;
n4=parseInt(n2)+parseInt(n3);
if (d1=="")
{
  document.getElementById("checkindate").style.backgroundColor='#FF8000';
  document.form1.txt_date1.value='Select Check-in Date';
  document.form1.txt_date1.select();
  return false;
}
else
{
  document.getElementById("checkindate").style.backgroundColor='#FEEFA9';
}
if (d2=="")
{
  document.getElementById("checkoutdate").style.backgroundColor='#FF8000';
  document.form1.txt_date2.value='Select Check-out Date';
  document.form1.txt_date2.select();
  return false;
}
else
{
  document.getElementById("checkoutdate").style.backgroundColor='#FEEFA9';
}
if (dateComp(d1,d2))	
{
}
else
{
  document.getElementById("checkoutdate").style.backgroundColor='#FF8000';
  document.form1.txt_date2.value='Select Check-out Date';
  document.form1.txt_date2.select();
  return false;
}
if(document.form1.roomselect2.value=="")
{
  document.getElementById("rpn").style.backgroundColor='#FF8000';
  return false;
}
if(document.form1.roomtypes.value=="")
{
  document.getElementById("label").style.backgroundColor='#FF8000';
  document.getElementById("rt").style.backgroundColor='#FF8000';
  return false;
}
if(document.form1.noofguests.value=="")
{
  document.getElementById("label").style.backgroundColor='#FF8000';
  document.getElementById("ng").style.backgroundColor='#FF8000';
  return false;
}
if(document.form1.adults.value=="")
{
  document.getElementById("label").style.backgroundColor='#FF8000';
  document.getElementById("ad").style.backgroundColor='#FF8000';
  return false;
}
if(document.form1.children.value=="")
{
  document.getElementById("label").style.backgroundColor='#FF8000';
  document.getElementById("ch").style.backgroundColor='#FF8000';
  return false;
}
if(n1!=n4)
{
  alert("Please specify the no of adults and children correctly");
  document.form1.adults.focus();
  return false;
}
if(document.form1.txtName.value=="")
{
  document.getElementById("name").style.backgroundColor='#FF8000';
  document.form1.txtName.value='Enter the Name';
  document.form1.txtName.select();
  return false;
}
else
{
  document.getElementById("name").style.backgroundColor='#FEEFA9';
}
/*
if(document.form1.txtCompany.value=="")
{
  document.getElementById("company").style.backgroundColor='#FF8000';
  document.form1.txtCompany.value='Enter the Company Name';
  document.form1.txtCompany.select();
  return false;

}
 
else
{
  document.getElementById("company").style.backgroundColor='#FEEFA9';
}
if(document.form1.txtAddress.value=="")
{
  document.getElementById("address").style.backgroundColor='#FF8000';
  document.form1.txtAddress.value='Enter the Address';
  document.form1.txtAddress.select();
  return false;
}
else
{
  document.getElementById("address").style.backgroundColor='#FEEFA9';
}

if(document.form1.txtcontactno.value=="")
{
  document.getElementById("contactno").style.backgroundColor='#FF8000';
  document.form1.txtcontactno.value='Enter the Contact Number';
  document.form1.txtcontactno.select();
  return false;
}
else
{
  document.getElementById("contactno").style.backgroundColor='#FEEFA9';
}
 */
if (document.form1.txtemail.value=="")
{
	  document.getElementById("mail").style.backgroundColor='#FF8000';
	  document.form1.txtemail.value='Enter the E-Mail address';
	  document.form1.txtemail.select();
	  return false;
}
else 
{
     var j = new RegExp(); 
     j.compile("[A-Za-z0-9._-]+@[^.]+\..+"); 
     if (!j.test(form1.txtemail.value))
     { 
		  document.getElementById("mail").style.backgroundColor='#FF8000';
		  document.form1.txtemail.value='Enter the valid E-Mail address';
		  document.form1.txtemail.select();
          return false;
	 }
}	
return true;	
}	
function chkindate()
{
  document.getElementById("checkindate").style.backgroundColor='#FEEFA9';
} 
function chkoutdate()
{
  document.getElementById("checkoutdate").style.backgroundColor='#FEEFA9';
} 
function rpn()
{
   document.getElementById("rpn").style.backgroundColor='#FEEFA9';
}
function rt()
{
   document.getElementById("label").style.backgroundColor='#FEEFA9';
   document.getElementById("rt").style.backgroundColor='#FEEFA9';
}
function ng()
{
   document.getElementById("label").style.backgroundColor='#FEEFA9';
   document.getElementById("ng").style.backgroundColor='#FEEFA9';
}
function ad()
{
   document.getElementById("label").style.backgroundColor='#FEEFA9';
   document.getElementById("ad").style.backgroundColor='#FEEFA9';
}
function ch()
{
   document.getElementById("label").style.backgroundColor='#FEEFA9';
   document.getElementById("ch").style.backgroundColor='#FEEFA9';
}
function name()
{
  //document.getElementById("name").style.backgroundColor='#FEEFA9';
} 
function company()
{
  document.getElementById("company").style.backgroundColor='#FEEFA9';
} 
function address()
{
  document.getElementById("address").style.backgroundColor='#FEEFA9';
} 
function contact()
{
  document.getElementById("contactno").style.backgroundColor='#FEEFA9';
}
function email()
{
  document.getElementById("mail").style.backgroundColor='#FEEFA9';
} 

