var array = new String(window.location);
var Location=array.split("/");
var Len=Location.length-1;
if(Location[Len]=="")
{
 Location[Len]="index.php";	
}
<!--
/*
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
var enter=0;
var subEnter=0;
window.addEvent('domready',function (){
									 
									 
									 
	if(Location[Len]!="ourresort_overview.php"){
		$('subMenuOurResort').style.height='0px';
	}
	if(Location[Len]!="ourresort_marina.php"){
		$('subMenuOurResort').style.height='0px';
	}
	if(Location[Len]!="ourresort_golfcourse.php"){
		$('subMenuOurResort').style.height='0px';
	}
  if(Location[Len]!="ourresort_masterplan.php"){
		$('subMenuInvestment').style.height='0px';
	}
	if(Location[Len]!="theteam_architects.php"){
		$('subMenuTeam').style.height='0px';
	}
	if(Location[Len]!="theteam_developer.php"){
		$('subMenuTeam').style.height='0px';
	}
	if(Location[Len]!="theteam_engineering.php"){
		$('subMenuTeam').style.height='0px';
	}
	if(Location[Len]!="theteam_legal.php"){
		$('subMenuTeam').style.height='0px';
	}
	if(Location[Len]!="investment_titleinformation.php"){
		$('subMenuInvestment').style.height='0px';
	}
	if(Location[Len]!="investment_closingagent.php"){
		$('subMenuInvestment').style.height='0px';
	}
	if(Location[Len]!="pressandmedia_pressreleases.php"){
		$('subMenuPress').style.height='0px';
	}
	if(Location[Len]!="pressandmedia_events.php"){
		$('subMenuPress').style.height='0px';
	}
	if(Location[Len]!="contactus_contactinfo.php"){
		$('subMenuContact').style.height='0px';
	}
	if(Location[Len]!="contactus_request.php"){
		$('subMenuContact').style.height='0px';
	}
	$('subMenuMexico').style.height='0px';
	$('subMenuInvestment').style.height='0px';
	
	if(Location[Len]=="index.php" || Location[Len]=="photogallery.php"){
		$('subMenu').style.height='0px';
	}
	var subMenuOurResort = new Fx.Styles($('subMenuOurResort'), {duration:150, wait:false});
	var subMenuMexico = new Fx.Styles($('subMenuMexico'), {duration:150, wait:false});
	var subMenuTeam = new Fx.Styles($('subMenuTeam'), {duration:150, wait:false});
	var subMenuInvestment = new Fx.Styles($('subMenuInvestment'), {duration:150, wait:false});
	var subMenuPress = new Fx.Styles($('subMenuPress'), {duration:150, wait:false});
	var subMenuContact = new Fx.Styles($('subMenuContact'), {duration:150, wait:false});
	var subMenu = new Fx.Styles($('subMenu'), {duration:150, wait:false});
	
	$('subMenu').addEvent('mouseenter', function(e){
										
		if(Location[Len]=="index.php" || Location[Len]=="photogallery.php"){
			subMenu.start({'height': '31px'});
			enter=1;
		}
		
												
	});
	
	$('subMenu').addEvent('mouseleave', function(e){
										
		if(Location[Len]=="index.php" || Location[Len]=="photogallery.php"){
			subMenu.start({'height': '0px'});
			subEnter=1;
		}
		
		subMenuOurResort.start({'height': '0px'});
		subMenuMexico.start({'height': '0px'});
		subMenuTeam.start({'height': '0px'});
		subMenuInvestment.start({'height': '0px'});
		subMenuPress.start({'height': '0px'});
		subMenuContact.start({'height': '0px'});
		
		if(Location[Len]=="ourresort_overview.php"){
			subMenuOurResort.start({'height': '31px'});
		}
		if(Location[Len]=="ourresort_lifestyle.php"){
			subMenuOurResort.start({'height': '31px'});
		}
		if(Location[Len]=="ourresort_amenities.php"){
			subMenuOurResort.start({'height': '31px'});
		}
		if(Location[Len]=="ourresort_marina.php"){
			subMenuOurResort.start({'height': '31px'});
		}
		if(Location[Len]=="ourresort_golfcourse.php"){
			subMenuOurResort.start({'height': '31px'});
		}
		
		
		
		if(Location[Len]=="mexico_loscabos.php"){
			subMenuMexico.start({'height': '31px'});
		}
		if(Location[Len]=="mexico_eastcape.php"){
			subMenuMexico.start({'height': '31px'});
		}
		if(Location[Len]=="mexico_cabopulmo.php"){
			subMenuMexico.start({'height': '31px'});
		}
		
		
		if(Location[Len]=="contactus_contactinfo.php"){
			subMenuContact.start({'height': '31px'});
		}
		if(Location[Len]=="contactus_request.php"){
			subMenuContact.start({'height': '31px'});
		}
		if(Location[Len]=="theteam_architects.php"){
			subMenuTeam.start({'height': '31px'});
		}
		if(Location[Len]=="theteam_developer.php"){
			subMenuTeam.start({'height': '31px'});
		}
		if(Location[Len]=="theteam_partners.php"){
			subMenuTeam.start({'height': '31px'});
		}
		if(Location[Len]=="theteam_engineering.php"){
			subMenuTeam.start({'height': '31px'});
		}
		if(Location[Len]=="theteam_legal.php"){
			subMenuTeam.start({'height': '31px'});
		}
		if(Location[Len]=="investment_titleinformation.php"){
			subMenuInvestment.start({'height': '31px'});
		}
		if(Location[Len]=="ourresort_masterplan.php"){
			subMenuInvestment.start({'height': '31px'});
		}
		if(Location[Len]=="investment_closingagent.php"){
			subMenuInvestment.start({'height': '31px'});
		}
		if(Location[Len]=="investment_closingagent.php"){
			subMenuInvestment.start({'height': '31px'});
		}
		if(Location[Len]=="pressandmedia_pressreleases.php"){
			subMenuPress.start({'height': '31px'});
		}		
		if(Location[Len]=="pressandmedia_events.php"){
			subMenuPress.start({'height': '31px'});
		}		
	});
	
	
	$('ourresort').addEvent('mousedown', function(e){
		
		if(Location[Len]=="index.php" || Location[Len]=="photogallery.php"){
			subMenu.start({'height': '31px'});
		}
		subMenuOurResort.start({'height': '31px'});
		subMenuMexico.start({'height': '0px'});
		subMenuTeam.start({'height': '0px'});
		subMenuInvestment.start({'height': '0px'});
		subMenuPress.start({'height': '0px'});
		subMenuContact.start({'height': '0px'});
		
	});
	
	$('mexico').addEvent('mousedown', function(e){
		
		if(Location[Len]=="index.php" || Location[Len]=="photogallery.php"){
			subMenu.start({'height': '31px'});
		}
		subMenuOurResort.start({'height': '0px'});
		subMenuMexico.start({'height': '31px'});
		subMenuTeam.start({'height': '0px'});
		subMenuInvestment.start({'height': '0px'});
		subMenuPress.start({'height': '0px'});
		subMenuContact.start({'height': '0px'});
		
	});
	
	$('theteam').addEvent('mousedown', function(e){
		
		if(Location[Len]=="index.php" || Location[Len]=="photogallery.php"){
			subMenu.start({'height': '31px'});
		}
		subMenuOurResort.start({'height': '0px'});
		subMenuMexico.start({'height': '0px'});
		subMenuTeam.start({'height': '31px'});
		subMenuInvestment.start({'height': '0px'});
		subMenuPress.start({'height': '0px'});
		subMenuContact.start({'height': '0px'});
		
	});
	
	$('investment').addEvent('mousedown', function(e){
		
		if(Location[Len]=="index.php" || Location[Len]=="photogallery.php"){
			subMenu.start({'height': '31px'});
		}
		subMenuOurResort.start({'height': '0px'});
		subMenuMexico.start({'height': '0px'});
		subMenuTeam.start({'height': '0px'});
		subMenuInvestment.start({'height': '31px'});
		subMenuPress.start({'height': '0px'});
		subMenuContact.start({'height': '0px'});
		
	});
	
	$('pressandmedia').addEvent('mousedown', function(e){
		
		if(Location[Len]=="index.php" || Location[Len]=="photogallery.php"){
			subMenu.start({'height': '31px'});
		}
		subMenuOurResort.start({'height': '0px'});
		subMenuMexico.start({'height': '0px'});
		subMenuTeam.start({'height': '0px'});
		subMenuInvestment.start({'height': '0px'});
		subMenuPress.start({'height': '31px'});
		subMenuContact.start({'height': '0px'});
		
	});
	
	$('contactus').addEvent('mousedown', function(e){
		
		if(Location[Len]=="index.php" || Location[Len]=="photogallery.php"){
			subMenu.start({'height': '31px'});
		}
		subMenuOurResort.start({'height': '0px'});
		subMenuMexico.start({'height': '0px'});
		subMenuTeam.start({'height': '0px'});
		subMenuInvestment.start({'height': '0px'});
		subMenuPress.start({'height': '0px'});
		subMenuContact.start({'height': '31px'});
		
	});

	if(window.ie){
	// $('subMenuMexico').style.marginLeft='-264px';	
	}
	else{
	// $('subMenuMexico').style.marginLeft='218px';
	}
		if(Location[Len]=="ourresort_overview.php"){
			subMenuOurResort.start({'height': '31px'});
		}
		if(Location[Len]=="ourresort_lifestyle.php"){
			subMenuOurResort.start({'height': '31px'});
		}
		if(Location[Len]=="ourresort_amenities.php"){
			subMenuOurResort.start({'height': '31px'});
		}
		if(Location[Len]=="ourresort_marina.php"){
			subMenuOurResort.start({'height': '31px'});
		}
		if(Location[Len]=="ourresort_golfcourse.php"){
			subMenuOurResort.start({'height': '31px'});
		}
		
		if(Location[Len]=="mexico_loscabos.php"){
			subMenuMexico.start({'height': '31px'});
		}
		if(Location[Len]=="mexico_eastcape.php"){
			subMenuMexico.start({'height': '31px'});
		}
		if(Location[Len]=="mexico_cabopulmo.php"){
			subMenuMexico.start({'height': '31px'});
		}
		
		
		if(Location[Len]=="contactus_contactinfo.php"){
			subMenuContact.start({'height': '31px'});
		}
		if(Location[Len]=="contactus_request.php"){
			subMenuContact.start({'height': '31px'});
		}
		if(Location[Len]=="theteam_architects.php"){
			subMenuTeam.start({'height': '31px'});
		}
		if(Location[Len]=="theteam_developer.php"){
			subMenuTeam.start({'height': '31px'});
		}
		if(Location[Len]=="theteam_partners.php"){
			subMenuTeam.start({'height': '31px'});
		}
		if(Location[Len]=="theteam_engineering.php"){
			subMenuTeam.start({'height': '31px'});
		}
		if(Location[Len]=="theteam_legal.php"){
			subMenuTeam.start({'height': '31px'});
		}
		if(Location[Len]=="investment_titleinformation.php"){
			subMenuInvestment.start({'height': '31px'});
		}
		if(Location[Len]=="ourresort_masterplan.php"){
			subMenuInvestment.start({'height': '31px'});
		}
		if(Location[Len]=="investment_closignagent.php"){
			subMenuInvestment.start({'height': '31px'});
		}
		if(Location[Len]=="investment_closingagent.php"){
			subMenuInvestment.start({'height': '31px'});
		}
		if(Location[Len]=="pressandmedia_pressreleases.php"){
			subMenuPress.start({'height': '31px'});
		}	
		
		if(Location[Len]=="pressandmedia_events.php"){
			subMenuPress.start({'height': '31px'});
		}	
});
*/
function validate_contact(){
	var msg = "";
	var Error = 0;
	if($('[name=name]').val().trim()==''){
		Error=1;
    	msg+="Name is a mandatory field.\n";
	}
	if($('[name=email]').val().trim()==''){
		Error=1;
    	msg+="Email is a mandatory field.\n";
	}else{
		if ($('[name=email]').val().indexOf('@')==-1 || $('[name=email]').val().indexOf('.')==-1 ){ 
			Error=1;
			msg+="Email is not valid.\n";
		}
	}
	/*if($('phone').value.trim()==''){
		Error=1;
    	msg+="Phone is a mandatory field.\n";
	}
	if($('city').value.trim()==''){
		Error=1;
    	msg+="City is a mandatory field.\n";
	}
	if($('state').value.trim()==''){
		Error=1;
    	msg+="State is a mandatory field.\n";
	}
	if($('comments').value.trim()==''){
		Error=1;
    	msg+="Comments is a mandatory field.\n";
	}
	if($('tmptxt').value.trim()==''){
		Error=1;
    	msg+="Safety of Code is a mandatory field.\n";
	}
	if($('tmptxt').value.trim() != $('code').value.trim()){
		Error=1;
    	msg+="Safety of Code is Incorrect.\n";
	}*/
	if(Error==0){
		$('[name=frmcontact]').submit();
	}else{
		alert(msg);
	}	
}
