function dot_infomation_change(url) {
	var dot_info = document.getElementById("dot_info");
	if (dot_info.value == "birth_certificate") {
		document.getElementById("birth_date_form").style.display = "";
		var title = "Inertia";
		var msg = "<table border=0 valign='top' cellpadding=3 cellspacing=1><tr valign='top'><td><a href='" + url + "' target='_blank'><img src='../../img/125x125zneed_C.gif' border=0></a></td><td  valign='top'><BR>U.S. Federal Law dictates that travel outside of the US via flights after Jan. 1, 2008 requires a US Passport.<BR> <a href='" + url + "' target='_blank'>Click HERE</a> for a link to express passport service</td></tr></table>";
		var width="400", height="220";
		var left = (screen.width/2) - width/2;
		var top = (screen.height/2) - height/2;
		var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
		var msgWindow = window.open("","msgWindow", styleStr);
		var head = '<head><title>'+title+'</title></head>';
		var body = '<center>'+msg+'<br><p><form><input type="button" value="   Close   " onClick="self.close()"></form>';
		msgWindow.document.write(head + body);
				
		
	}else {
		document.getElementById("birth_date_form").style.display = "none";
	}
}
function check_index()
{
if(document.option.ski.checked==true)
if(document.option.ski_four.checked==true)
	{
	alert("You only choose one ski");
	return false;
	}
if(document.option.board.checked==true)
if(document.option.board_four.checked==true)
	{
	alert("You only choose one board");
	return false;
	}
return true;

}
function check_usphone(phonenumber)
{ 

if((phonenumber.match(/^[ ]*[(]{0,1}[ ]*[0-9]{3,3}[ ]*[)]{0,1}[-]{0,1}[ ]*[0-9]{3,3}[ ]*[-]{0,1}[ ]*[0-9]{4,4}[ ]*$/)==null) && (phonenumber.match(/^[ ]*[0-9]{3,3}[ ]*[-]{0,1}[ ]*[0-9]{4,4}[ ]*$/)==null))
	return false; 
return true; 
}  

function getdaymonthyear()
{
	
document.option.DOB.value=document.option.Date_Year.value+"-"+document.option.Date_Month.value +"-"+ document.option.Date_Day.value;
}
function getkey()
{
document.option.password.value =hex_md5(document.option.password1.value) ;
document.option.password1.value='';
}
function kt()
{
		if(document.my_profile.password.value != document.my_profile.password1.value)
		{
		document.my_profile.password.value='';
		document.my_profile.password1.value='';
		alert("You not retype true. Try again");
		document.my_profile.password.focus();
			return false;
		}
		if(!isEmail(document.my_profile.Email.value))
		{
		alert("Your Email not true. Try again");
		document.my_profile.Email.focus();
		return false;
		}
	
	document.my_profile.password.value=hex_md5(document.my_profile.password1.value) ;
	
	return true;
}
function invite()
{
	 var mail= new Array();
	 var i=0;
	
		if(document.option.FirstName1.value + document.option.LastName1.value + document.option.Email1.value!='')
		{
			if((document.option.FirstName1.value=='')||(document.option.LastName1.value=='')||(document.option.Email1.value=='')||(!isEmail(document.option.Email1.value)))
			{
			alert("You must fill full or your Email not true. ");
			document.option.FirstName1.focus();
			return false;
			}
			else
			{
			i++;
			mail[i]=document.option.Email1.value;
			}
		}
		if(document.option.FirstName2.value + document.option.LastName2.value + document.option.Email2.value!='')
		{
			if((document.option.FirstName2.value=='')||(document.option.LastName2.value=='')||(document.option.Email2.value=='')||(!isEmail(document.option.Email2.value)))
			{
			alert("You must fill full or your Email not true. ");
			document.option.FirstName2.focus();
			return false;
			}
			else
			{
			i++;
			mail[i]=document.option.Email2.value;
			}
		}
		if(document.option.FirstName3.value + document.option.LastName3.value + document.option.Email3.value!='')
		{
			if((document.option.FirstName3.value=='')||(document.option.LastName3.value=='')||(document.option.Email3.value==''))
			{
			alert("You must fill full or your Email not true. ");
			document.option.FirstName3.focus();
			return false;
			}
			else
			{
			i=i+1;
			mail[i]=document.option.Email3.value;
			}
		}
		if(document.option.FirstName4.value + document.option.LastName4.value + document.option.Email4.value!='')
		{
			
			if((document.option.FirstName4.value=='')||(document.option.LastName4.value=='')||(document.option.Email4.value=='')||(!isEmail(document.option.Email4.value)))
			{
			alert("You must fill full or your Email not true. ");
			document.option.FirstName4.focus();
			return false;
			}
			else
			{
			i=i+1;
			mail[i]=document.option.Email4.value;
			}
		}
		if(document.option.FirstName5.value + document.option.LastName5.value + document.option.Email5.value!='')
		{
			if((document.option.FirstName5.value=='')||(document.option.LastName5.value=='')||(document.option.Email5.value=='')||(!isEmail(document.option.Email5.value)))
			{
			alert("You must fill full or your Email not true. ");
			document.option.FirstName5.focus();
			return false;
			}
			else
			{
			i=i+1;
			mail[i]=document.option.Email5.value;
			}
		}
		if(document.option.FirstName6.value + document.option.LastName6.value + document.option.Email6.value!='')
		{
			if((document.option.FirstName6.value=='')||(document.option.LastName6.value=='')||(document.option.Email6.value=='')||(!isEmail(document.option.Email6.value)))
			{
			alert("You must fill full or your Email not true. ");
			document.option.FirstName6.focus();
			return false;
			}
			else
			{
			i=i+1;
			mail[i]=document.option.Email6.value;
			}
		}
		if(document.option.FirstName7.value + document.option.LastName7.value + document.option.Email7.value!='')
		{
			if((document.option.FirstName7.value=='')||(document.option.LastName7.value=='')||(document.option.Email7.value=='')||(!isEmail(document.option.Email7.value)))
			{
			alert("You must fill full or your Email not true. ");
			document.option.FirstName7.focus();
			return false;
			}
			else
			{
			i=i+1;
			mail[i]=document.option.Email7.value;
			}
		}
		if(document.option.FirstName8.value + document.option.LastName8.value + document.option.Email8.value!='')
		{
			if((document.option.FirstName8.value=='')||(document.option.LastName8.value=='')||(document.option.Email8.value=='')||(!isEmail(document.option.Email8.value)))
			{
			alert("You must fill full or your Email not true. ");
			document.option.FirstName8.focus();
			return false;
			}
			else
			{
			i=i+1;
			mail[i]=document.option.Email8.value;
			}
		}
		if(document.option.FirstName9.value + document.option.LastName9.value + document.option.Email9.value!='')
		{
			if((document.option.FirstName9.value=='')||(document.option.LastName9.value=='')||(document.option.Email9.value=='')||(!isEmail(document.option.Email9.value)))
			{
			alert("You must fill full or your Email not true. ");
			document.option.FirstName9.focus();
			return false;
			}
			else
			{
			i=i+1;
			mail[i]=document.option.Email9.value;
			}
		}
		if(document.option.FirstName10.value + document.option.LastName10.value + document.option.Email10.value!='')
		{
			if((document.option.FirstName10.value=='')||(document.option.LastName10.value=='')||(document.option.Email10.value=='')||(!isEmail(document.option.Email10.value)))
			{
			alert("You must fill full or your Email not true. ");
			document.option.FirstName10.focus();
			return false;
			}
			else
			{
			i=i+1;
			mail[i]=document.option.Email10.value;
			}
		}

		var x=i;
		for(i=1;i<=x;i++)
		{
			for(j=1;j<i;j++)
			{
				if (mail[j] == mail[i])
				{
				alert("You have two mail are the same");
				return false;
				}
			}
		}
		
		return true;
}
function checkmail()
{
	if(!isEmail(document.option.Email.value))
	{
	alert("Your Mail is invalid.Try again.");
	document.option.Email.focus();
	return false;
	}
	return true;
	
	
}
function iswebsite(s)
{   
  if (s=="") return false;
  if(s.indexOf(" ")>0) return false;
  var i = 1;
  var sLength = s.length;
  if (sLength > 63)
	return false;  
  if (s.indexOf(".")==-1) return false;
  if (s.indexOf("..")!=-1) return false;
  if (s.lastIndexOf(".")==s.length-1) return false;
  var str="abcdefghikjlmnopqrstuvwxyz1234567890-."; 
  for(var j=0;j<s.length;j++)
	if(str.indexOf(s.charAt(j))==-1)
		return false;
   return true;
}
function isEmail(s)
{   
  if (s=="") return false;
  if(s.indexOf(" ")>0) return false;
  if(s.indexOf("@")==-1) return false;
  var i = 1;
  var sLength = s.length;
  if (s.indexOf(".")==-1) return false;
  if (s.indexOf("..")!=-1) return false;
  if (s.indexOf("@")!=s.lastIndexOf("@")) return false;
  if (s.lastIndexOf(".")==s.length-1) return false;
  var str="abcdefghikjlmnopqrstuvwxyz1234567890-@._"; 
  for(var j=0;j<s.length;j++)
	if(str.indexOf(s.charAt(j))==-1)
		return false;
   return true;
}
function check_number()
{
	if(!Number(document.option.number.value))
	{
	alert("It is not number.Try again");
	document.option.number.focus();
	return false;
	}
	return true;
	
}
function signup_campus()
{
	if(document.option.FirstName.value=='')
	{
		alert("You must enter FirstName.");
		document.option.FirstName.focus();
		return false;
	}
	if(document.option.LastName.value=='')
	{
		alert("You must enter LastName.");
		document.option.LastName.focus();
		return false;
	}
	if(!isEmail(document.option.Email.value))
	{
		alert("You must enter true mail.");
		document.option.Email.focus();
		return false;
	}
	if(document.option.Address.value=='')
	{
		alert("You must enter Address.");
		document.option.Address.focus();
		return false;
	}
	if(document.option.City.value=='')
	{
		alert("You must enter City.");
		document.option.City.focus();
		return false;
	}
	if(document.option.Phone.value=='')
	{
		alert("You must enter Phone.");
		document.option.Phone.focus();
		return false;
	}
if(!check_usphone(document.option.Phone.value,1))
	{
		alert("You must enter Validate Phone.");
		document.option.Phone.focus();
		return false;

	}
	
	return true;		
}
function signup_manager()
{
	if(document.option.FirstName.value=='')
	{
		alert("You must enter FirstName.");
		document.option.FirstName.focus();
		return false;
	}
	if(document.option.LastName.value=='')
	{
		alert("You must enter LastName.");
		document.option.LastName.focus();
		return false;
	}
	if(!isEmail(document.option.Email.value))
	{
		alert("You must enter true mail.");
		document.option.Email.focus();
		return false;
	}
	if(document.option.Address.value=='')
	{
		alert("You must enter Address.");
		document.option.Address.focus();
		return false;
	}
	if(document.option.City.value=='')
	{
		alert("You must enter City.");
		document.option.City.focus();
		return false;
	}
	if(document.option.Phone.value=='')
	{
		alert("You must enter Phone.");
		document.option.Phone.focus();
		return false;
	}
	if(!check_usphone(document.option.Phone.value,1))
	{
		alert("You must enter Validate Phone.");
		document.option.Phone.focus();
		return false;

	}
	
	
	return true;		
}
function signup_agent()
{
	if(document.option.Name.value=='')
	{
		alert("You must enter Name.");
		document.option.Name.focus();
		return false;
	}
	if(document.option.ContactName.value=='')
	{
		alert("You must enter ContactName.");
		document.option.ContactName.focus();
		return false;
	}
	if(document.option.Address.value=='')
	{
		alert("You must enter Address.");
		document.option.Address.focus();
		return false;
	}
	if(document.option.City.value=='')
	{
		alert("You must enter City.");
		document.option.City.focus();
		return false;
	}
	if(document.option.Phone.value=='')
	{
		alert("You must enter Phone.");
		document.option.Phone.focus();
		return false;
	}
	if(!check_usphone(document.option.Phone.value,1))
	{
		alert("You must enter Validate Phone.");
		document.option.Phone.focus();
		return false;

	}
	
	if(document.option.Mobile.value=='')
	{
		alert("You must enter Mobile.");
		document.option.Mobile.focus();
		return false;
	}
	if(!isEmail(document.option.Email.value))
	{
		alert("You must enter true mail.");
		document.option.Email.focus();
		return false;
	}
	if(!document.option.Zipcode.value.isZipCode())
		{
		alert("You must enter Correct Zipcode.");
		document.option.Zipcode.focus();
			return false;
	}
	if(!document.option.Website.value.isDomainname())
		{
		alert("You must enter Correct Domain.");
		document.option.Website.focus();
			return false;
	}
	
	
	return true;		
}
function mailto_other()
{
	if((document.mailto.mail1.value!='') && (!isEmail(document.mailto.mail1.value)))
		{
			alert("You must type true Email. ");
			document.mailto.mail1.focus();
			return false;
		}
	if((document.mailto.mail2.value!='') && (!isEmail(document.mailto.mail2.value)))
		{
			alert("You must type true Email. ");
			document.mailto.mail2.focus();
			return false;
		}
	if((document.mailto.mail3.value!='') && (!isEmail(document.mailto.mail3.value)))
		{
			alert("You must type true Email. ");
			document.mailto.mail3.focus();
			return false;
		}
	if((document.mailto.mail4.value!='') && (!isEmail(document.mailto.mail4.value)))
		{
			alert("You must type true Email. ");
			document.mailto.mail4.focus();
			return false;
		}
	if((document.mailto.mail5.value!='') && (!isEmail(document.mailto.mail5.value)))
		{
			alert("You must type true Email. ");
			document.mailto.mail5.focus();
			return false;
		}	
		return true;
}
function check_input_other_passenger()
{	
		if(!document.others_passenger.CellPhone.value.isUSPhone())
		{
			alert("You must enter Validate CellPhone.Ex 123-456-7890");
			document.others_passenger.CellPhone.focus();
			return false;
		}
		if(!isEmail(document.others_passenger.Email.value))
		{
			alert("Your Email not true. Try again");
			document.others_passenger.Email.focus();
			return false;
		}
		if(document.others_passenger.Password.value != document.others_passenger.Password1.value)
		{
			document.others_passenger.Password.value='';
			document.others_passenger.Password1.value='';
			alert("New Password and Retype Password must be the same.Please Try again!");
			document.others_passenger.Password.focus();
			return false;
		}
		
		return true;
}