function select_tr()
{
if (login.adults.value=="1")
{
 t1.style.display="none"; 
 t2.style.display="none";
 tt.style.display="none";
 t3.style.display="none";
 t4.style.display="none";
 t5.style.display="none";
 t6.style.display="none";
 t7.style.display="none";
 t8.style.display="none";
 t9.style.display="none";
}


if (login.adults.value=="2")
{
//alert("222222");
 tt.style.display="";
 t1.style.display=""; 
 t2.style.display="none";
 t3.style.display="none";
 t4.style.display="none";
 t5.style.display="none";
 t6.style.display="none";
 t7.style.display="none";
 t8.style.display="none";
 t9.style.display="none";
}

if (login.adults.value=="3")
{
	tt.style.display="";
 t1.style.display=""; 
 t2.style.display="";
 t3.style.display="none";
 t4.style.display="none";
 t5.style.display="none";
 t6.style.display="none";
 t7.style.display="none";
 t8.style.display="none";
 t9.style.display="none";
}


if (login.adults.value=="4")
{
 t1.style.display=""; 
 t2.style.display="";
 t3.style.display="";
 tt.style.display="";
 t4.style.display="none";
 t5.style.display="none";
 t6.style.display="none";
 t7.style.display="none";
 t8.style.display="none";
 t9.style.display="none";
}

if (login.adults.value=="5")
{
 t1.style.display=""; 
 t2.style.display="";
 tt.style.display="";
 t3.style.display="";
 t4.style.display="";
 t5.style.display="none";
 t6.style.display="none";
 t7.style.display="none";
 t8.style.display="none";
 t9.style.display="none";
}

if (login.adults.value=="6")
{
 t1.style.display=""; 
 t2.style.display="";
 tt.style.display="";
 t3.style.display="";
 t4.style.display="";
 t5.style.display="";
 t6.style.display="none";
 t7.style.display="none";
 t8.style.display="none";
 t9.style.display="none";
}
if (login.adults.value=="7")
{
 t1.style.display=""; 
 t2.style.display="";
 t3.style.display="";
 tt.style.display="";
 t4.style.display="";
 t5.style.display="";
 t6.style.display="";
 t7.style.display="none";
 t8.style.display="none";
 t9.style.display="none";
}

if (login.adults.value=="8")
{
 t1.style.display=""; 
 t2.style.display="";
 t3.style.display="";
 t4.style.display="";
 tt.style.display="";
 t5.style.display="";
 t6.style.display="";
 t7.style.display="";
 t8.style.display="none";
 t9.style.display="none";
}

if (login.adults.value=="9")
{
 t1.style.display=""; 
 t2.style.display="";
 t3.style.display="";
 t4.style.display="";
 tt.style.display="";
 t5.style.display="";
 t6.style.display="";
 t7.style.display="";
 t8.style.display="";
 t9.style.display="none";
}
}
function okkh()
{
String.prototype.left = function(num,mode){
        if(!/\d+/.test(num))return(this);
        var str = this.substr(0,num);
        if(!mode) return str;
        var n = str.Tlength() - str.length;
        num = num - parseInt(n/2);
        return this.substr(0,num);
    }


	  
	  if (document.login.fname.value.length ==0 ) {
      alert("Please input the first name!");
	  document.login.fname.focus();
	  return false;
	}
	if (document.login.lname.value.length ==0 ) {
      alert("Please input the last name!");
	  document.login.lname.focus();
	  return false;
	}
	if (document.login.address.value.length ==0 ) {
      alert("Please input the address!");
	  document.login.address.focus();
	  return false;
	}
	if (document.login.city.value.length ==0 ) {
      alert("Please input the city!");
	  document.login.city.focus();
	  return false;
	}
	
	if (document.login.postalcode.value.length ==0 ) {
      alert("Please input the postal code!");
	  document.login.postalcode.focus();
	  return false;
	}
	if (document.login.country.value.length ==0 ) {
      alert("Please input the country!");
	  document.login.country.focus();
	  return false;
	}
	if (document.login.hphone.value.length ==0 ) {
      alert("Please input the home phone!");
	  document.login.hphone.focus();
	  return false;
	}
	if (document.login.dphone.value.length ==0 ) {
      alert("Please input the daytime phone!");
	  document.login.dphone.focus();
	  return false;
	}
		if (document.login.email.value.length ==0 ) {
      alert("Please input the email!");
	  document.login.email.focus();
	  return false;
	}
	 if (document.login.email.value=="" || document.login.email.value.indexOf("@") == -1 || document.login.email.value.indexOf(".") == -1){
	alert("Format of Email is not correct!");
    document.login.email.focus(); 
	return false;
	
	}
		if (document.login.h_indate.value.length ==0 ) {
      alert("Please input Check in!");
	  
	  return false;
	}

		if (document.login.adults.value ==0 ) {
      alert("Please input adults!");
	  
	  return false;
	}
	
	if (document.login.cardname.value.length ==0 ) {
      alert("Please input the card name!");
	  document.login.cardname.focus();
	  return false;
	}
		if (document.login.cardtype[0].checked){

	if (document.login.cardnumber.value.length == 0) {
	    document.login.cardnumber.focus();
		alert("Please input your number entered!");
		return false;
	}
	else if(document.login.cardnumber.value.left(1)!="4"){
	    alert("Your card number is not correct");
		document.login.cardnumber.focus();
		return false;
	}
	else if (document.login.cardnumber.value.length!=19 && document.login.cardnumber.value.length!=16){
	    alert("Your card number is not correct");
		document.login.cardnumber.focus();
		return false;
	}
}

if (document.login.cardtype[1].checked){

	if (document.login.cardnumber.value.length == 0) {
		alert("No card number entered!");
		document.login.cardnumber.focus();
		return false;
	}
	else if(document.login.cardnumber.value.left(1)!="5"){
	    alert("Your card number is not correct");
		document.login.cardnumber.focus();
		return false;
	}
	else if(document.login.cardnumber.value.length!=19 && document.login.cardnumber.value.length!=16 && document.login.cardnumber.value.length!=15){
	    alert("Your card number is not correct");
		document.login.cardnumber.focus();
		return false;
	}
}

if (document.login.cardtype[2].checked){

	if (document.login.cardnumber.value.length == 0) {
		alert("No card number entered!");
		document.login.cardnumber.focus();
		return false;
	}
	else if(document.login.cardnumber.value.left(1)!="3"){//17
	    alert("Your card number is not correct");
		document.login.cardnumber.focus();
		return false;
	}
	else if(document.login.cardnumber.value.length!=15 ){
	    alert("Your card number is not correct");
		document.login.cardnumber.focus();
		return false;
	}
}
	
		if (document.login.cardtype[0].checked){

	if (document.login.cid.value.length != 3) {
		alert("Your CID code is not correct!");
		document.login.cid.focus();
		return false;
	}
}
if (document.login.cardtype[1].checked){

	if (document.login.cid.value.length != 3) {
		alert("Your CID code is not correct!");
		document.login.cid.focus();
		return false;
	}
}
if (document.login.cardtype[2].checked){

	if (document.login.cid.value.length != 4) {
		alert("Your CID code is not correct!");
		document.login.cid.focus();
		return false;
	}
}
		
		
		
		if (document.login.cid.value.length ==0 ) {
      alert("Please input the CID code!");
	  document.login.cid.focus();
	  return false;
	}
		if (document.login.month.value.length ==0 ) {
      alert("Please choose a month!");
	  document.login.month.focus();
	  return false;
	}
	if (document.login.year.value.length ==0 ) {
      alert("Please choose a year!");
	  document.login.year.focus();
	  return false;
	}
	if (document.login.billingtel.value.length ==0 ) {
      alert("Please input the credit card billing tel number!");
	  document.login.billingtel.focus();
	  return false;
	}
	if (document.login.cardaddress.value.length ==0 ) {
      alert("Please input the credit card billing address!");
	  document.login.cardaddress.focus();
	  return false;
	}
		
	document.login.submit();
}
