function doRedirect(langval){
	var url = 'http://www.marcopolobeachresort.com/assets/setlang.php?setlang=' + langval;
	document.location.href = url;
	return false;
}

window.onload = function()
{
	setcurrent(document.location.pathname);
	//document.oncontextmenu = function() {return false;}; 
}

/*function for image pre-loading*/

<!--
var myimages = new Array();
function preloading(){
for (x=0; x<preloading.arguments.length; x++){
myimages[x] = new Image();
myimages[x].src = preloading.arguments[x];
}
}
var getImages = document.images;

for (var i=0; i<= getImages.length; i++  )
{
preloading(getImages[i]);
}


//form validate
//checkmail
function checkemail(str){
var testresults
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if (filter.test(str))
    testresults=true
    else{
    
      testresults=false;
      }
      return (testresults)
}
//phone number 


// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;


function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
function trim(s)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not a whitespace, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (c != " ") returnString += c;
    }
    return returnString;
}
function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}


function checkInternationalPhone(strPhone){
var bracket=3;
strPhone=trim(strPhone);
if(strPhone.indexOf("+")>1) return false;
if(strPhone.indexOf("-")!=-1)bracket=bracket+1;
if(strPhone.indexOf("(")!=-1 && strPhone.indexOf("(")>bracket)return false;
var brchr=strPhone.indexOf("(");
if(strPhone.indexOf("(")!=-1 && strPhone.charAt(brchr+2)!=")")return false;
if(strPhone.indexOf("(")==-1 && strPhone.indexOf(")")!=-1)return false;
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}


 // Removes leading whitespaces
     function LTrim( value ) {
     	
   	var re = /\s*((\S+\s*)*)/;
    	return value.replace(re, "$1");
  	
 }
  
    // Removes ending whitespaces
    function RTrim( value ) {
   	
  	var re = /((\s*\S+)*)\s*/;
  	return value.replace(re, "$1");
   	
   }
  
  // Removes leading and ending whitespaces
  function trim( value ) {
   	
   	return LTrim(RTrim(value));
   	
   }
function validate_form(obj)
{

if(trim(obj.name.value)=="")
{
  alert("Please Enter Name");
obj.name.value="";
		obj.name.focus();
return false;
}



if(trim(obj.email.value)=="")
{
  alert("Please Enter Email");
obj.email.value="";
		obj.email.focus();
return false;
}
else
{
     if(!checkemail(obj.email.value))
   {
    alert("Please Enter Valid Email");
obj.email.value="";
		obj.email.focus();
    return false;
   }
}


  if(trim(obj.phone.value)!="")
{



                if (checkInternationalPhone(obj.phone.value)==false){
		alert("Please Enter a Valid Phone Number");
		obj.phone.value="";
		obj.phone.focus();
		return false;
               }
}



return true;
   
}



/*navgation*/

function extractPageName(hrefString)
{
	var arr = hrefString.split('/');
	return  (arr.length < 2) ? hrefString :  arr[arr.length-2].toLowerCase() + arr[arr.length-1].toLowerCase();                    
}
		function setActiveMenu(arr, crtPage, obj)
{        

                   var flag;
                     flag=0;


	for (var i=0; i<arr.length; i++)
	{     

		if(extractPageName(arr[i].href) == crtPage)
		{
                 
/*
                  var  parent1=arr[i].parentNode;
          	   var thisChild = arr[i].parentNode.firstChild;
        
                  while ( thisChild != parent1.lastChild )
	         {
		             if ( thisChild.nodeType == 1 )
		              {
			               
                                  if(thisChild.id=="sub_id")
                                  {
                                    
                                         flag=1;
                                   }
		             }
		              thisChild = thisChild.nextSibling;
	             }
*/
                  
			if (arr[i].parentNode.tagName != "DIV")
			{//alert(arr[i].className);
				arr[i].className = "current";
				arr[i].parentNode.className = "current";
			}
		}
	}
/*
if(flag==1)
{

  document.getElementByClass("sub").style.display="block";
}
else
{
  alert(obj);
        if(obj==5 || obj==6 || obj==7 || obj==8 || obj==11 ||  obj==4)
    { alert("hi2");
       document.getElementById("sub_id").style.display="block";
      //document.getElementById("sub").style.border="1px solid red"; 
    //  document.getElementByClass("sub").style.display="block"; 
     
    }
   else
      { alert("else");
       alert(document.getElementById("sub_id").style.display);
      document.getElementById("sub_id").className="sub";
      document.getElementById("sub_id").style.display="none"; 
    document.getElementById("sub_id").className="sub";
     }
}
 if(obj==13 || obj==12 || obj==3)
       {  document.getElementById("sub_id1").style.display="block";}
      else
     {  //  if( document.getElementById("sub_id1").style.display=="block" || document.getElementById("sub_id1").style.display=='')  document.getElementById("sub_id1").style.display="none";
       }
*/
}

		function setPage(obj)
		{
   			 hrefString = document.location.href ? document.location.href : document.location;
   //  alert(hrefString);
		
    		if (document.getElementById("pro_line2_id")!=null)
       			{
			
				 setActiveMenu(document.getElementById("pro_line2_id").getElementsByTagName("a"), extractPageName(hrefString),obj);
				}
}
    

function setSubMenu()
{
  document.getElementById("sub_id").style.display="block";
 
}
 function go(obj)
   {




   if(obj==1)
   {
       // if(document.getElementById("pro_line3"))     document.getElementById("pro_line3").style.display="block";
	 document.getElementById("sub_id1").style.display="block";	
   }
  if(obj==2)
   {
     /* if( document.getElementById("pro_line3"))  document.getElementById("pro_line3").style.display="none";*/
	 document.getElementById("sub_id1").style.display="none";
	 
   }
   if(obj==0)
   {
   }
 } 
	function MM_openBrWindow(theURL,winName,features) { //v2.0
//alert(theURL);
  window.open(theURL,winName,features);
}







function validate_form_spanish(obj)
{

if(trim(obj.name.value)=="")
{
  alert("Por favor, escribe Nombre");
obj.name.value="";
		obj.name.focus();
return false;
}



if(trim(obj.email.value)=="")
{
  alert("Por favor, escribe Correo electrónico");
obj.email.value="";
		obj.email.focus();
return false;
}
else
{
     if(!checkemail(obj.email.value))
   {
    alert(" Por favor, escriba Correo Valida");
obj.email.value="";
		obj.email.focus();
    return false;
   }
}

 if(trim(obj.phone.value)!="")
{
                if (checkInternationalPhone(obj.phone.value)==false){
		alert("Por favor, escriba un número de teléfono válido");
		obj.phone.value="";
		obj.phone.focus();
		return false;
               }
}



return true;
   
}

function setcurrent(pageID){

//alert('Location2 = ' + document.location.href);
	if(pageID.indexOf('spanish') >= 0){ // Spanish site
		if(pageID.indexOf('home') >= 0) {
			document.getElementById('home-sp').style.backgroundImage = "url(/assets/images-sp/nav-home-hov.gif)";
		}
		if(pageID.indexOf('reservations') >= 0) {
			document.getElementById('res-sp').style.backgroundImage = "url(/assets/images-sp/nav-res-hov.gif)";
		}
		if(pageID.indexOf('contact') >= 0) {
			document.getElementById('contact-sp').style.backgroundImage = "url(/assets/images-sp/nav-contact-hov.gif)";
		}
		if(pageID.indexOf('services') >= 0) {
			document.getElementById('serv-sp').style.backgroundImage = "url(/assets/images-sp/nav-serv-hov.gif)";
			document.getElementById("sub_id1").style.display="block";
		}
		if(pageID.indexOf('accommodations') >= 0) {
			document.getElementById('accom-sp').style.backgroundImage = "url(/assets/images-sp/nav-accom-hov.gif)";
			document.getElementById("sub_id2").style.display="block";
		}
		if(pageID.indexOf('meetings') >= 0) {
			document.getElementById('meet-sp').style.backgroundImage = "url(/assets/images-sp/nav-meet-hov.gif)";
			document.getElementById("sub_id3").style.display="block";
		}
		if((pageID.indexOf('location') >= 0)||(pageID.indexOf('history') >= 0)) {
			document.getElementById('loc-sp').style.backgroundImage = "url(/assets/images-sp/nav-loc-hov.gif)";
			document.getElementById("sub_id4").style.display="block";
		}
	}else{ // English site
		if(pageID.indexOf('home') >= 0) {
			document.getElementById('home').style.backgroundImage = "url(/assets/images/nav-home-hov.gif)";
		}
		if(pageID.indexOf('reservations') >= 0) {
			document.getElementById('res').style.backgroundImage = "url(/assets/images/nav-res-hov.gif)";
		}
		if((pageID.indexOf('contact') >= 0 ) ||(pageID.indexOf('press') >= 0) ||(pageID.indexOf('blog') >= 0)) {
			document.getElementById('contact').style.backgroundImage = "url(/assets/images/nav-contact-hov.gif)";
            document.getElementById("sub_id5").style.display="block"; 
            //alert("subid5");
		}
      
		if(pageID.indexOf('services') >= 0) {
			document.getElementById('serv').style.backgroundImage = "url(/assets/images/nav-serv-hov.gif)";
			document.getElementById("sub_id1").style.display="block";
		}
		if(pageID.indexOf('accommodations') >= 0) {
			document.getElementById('accom').style.backgroundImage = "url(/assets/images/nav-accom-hov.gif)";
			document.getElementById("sub_id2").style.display="block";
		}
		if(pageID.indexOf('meetings') >= 0) {
			document.getElementById('meet').style.backgroundImage = "url(/assets/images/nav-meet-hov.gif)";
			document.getElementById("sub_id3").style.display="block";
		}
		if((pageID.indexOf('location') >= 0)||(pageID.indexOf('history') >= 0)) {
			document.getElementById('loc').style.backgroundImage = "url(/assets/images/nav-loc-hov.gif)";
			document.getElementById("sub_id4").style.display="block";
		}
       
	}
}

function go1(obj){

setcurrent(document.location.pathname);
	   
if(obj==0){
	document.getElementById("sub_id1").style.display="none";
	document.getElementById("sub_id2").style.display="none";
	document.getElementById("sub_id3").style.display="none";
	document.getElementById("sub_id4").style.display="none";
    document.getElementById("sub_id5").style.display="none"; 
}

if(obj==1){
	document.getElementById("sub_id2").style.display="none";
	document.getElementById("sub_id3").style.display="none";
	document.getElementById("sub_id4").style.display="none";
    document.getElementById("sub_id5").style.display="none"; 
	
	document.getElementById("sub_id1").style.display="block";
	document.getElementById("sub_id1").style.top="20px";
	document.getElementById("sub_id1").style.position="absolute";
	document.getElementById("sub_id1").style.left="0px";
	document.getElementById("sub_id1").style.width="750px";
	document.getElementById("sub_id1").style.paddingLeft="80px";

}

if(obj==2){
   document.getElementById("sub_id1").style.display="none";
	document.getElementById("sub_id3").style.display="none";
	document.getElementById("sub_id4").style.display="none";
    document.getElementById("sub_id5").style.display="none"; 
		
	document.getElementById("sub_id2").style.display="block";
	document.getElementById("sub_id2").style.top="20px";
	document.getElementById("sub_id2").style.position="absolute";
	document.getElementById("sub_id2").style.left="0px";
	document.getElementById("sub_id2").style.width="750px";
	document.getElementById("sub_id2").style.paddingLeft="80px";
		
}
if(obj==3)
{

   document.getElementById("sub_id1").style.display="none";
	document.getElementById("sub_id2").style.display="none";
	document.getElementById("sub_id4").style.display="none";
    document.getElementById("sub_id5").style.display="none"; 
		
	document.getElementById("sub_id3").style.display="block";
	document.getElementById("sub_id3").style.top="20px";
	document.getElementById("sub_id3").style.position="absolute";
	document.getElementById("sub_id3").style.left="0px";
	document.getElementById("sub_id3").style.width="750px";
	document.getElementById("sub_id3").style.paddingLeft="80px";
}
if(obj==4)
{

   document.getElementById("sub_id1").style.display="none";
	document.getElementById("sub_id2").style.display="none";
	document.getElementById("sub_id3").style.display="none";
	document.getElementById("sub_id5").style.display="none"; 
    	
	document.getElementById("sub_id4").style.display="block";
	document.getElementById("sub_id4").style.top="20px";
	document.getElementById("sub_id4").style.position="absolute";
	document.getElementById("sub_id4").style.left="0px";
	document.getElementById("sub_id4").style.width="750px";
	document.getElementById("sub_id4").style.paddingLeft="380px";
}

if(obj==5)
{

   document.getElementById("sub_id1").style.display="none";
    document.getElementById("sub_id2").style.display="none";
    document.getElementById("sub_id3").style.display="none";
    document.getElementById("sub_id4").style.display="none"; 
        
    document.getElementById("sub_id5").style.display="block";
    document.getElementById("sub_id5").style.top="20px";
    document.getElementById("sub_id5").style.position="absolute";
    document.getElementById("sub_id5").style.left="0px";
    document.getElementById("sub_id5").style.width="750px";
    document.getElementById("sub_id5").style.paddingLeft="450px";
}
} 



function go2(obj){
setcurrent(document.location.pathname);

       
if(obj==0){
    document.getElementById("sub_id1").style.display="none";
    document.getElementById("sub_id2").style.display="none";
    document.getElementById("sub_id3").style.display="none";
    document.getElementById("sub_id4").style.display="none";
    document.getElementById("sub_id5").style.display="none"; 
}

if(obj==1){



    document.getElementById("sub_id2").style.display="none";
    document.getElementById("sub_id3").style.display="none";
    document.getElementById("sub_id4").style.display="none";

    
    document.getElementById("sub_id1").style.display="block";
    document.getElementById("sub_id1").style.top="20px";
    document.getElementById("sub_id1").style.position="absolute";
    document.getElementById("sub_id1").style.left="0px";
    document.getElementById("sub_id1").style.width="750px";
    document.getElementById("sub_id1").style.paddingLeft="80px";
      
}

if(obj==2){
   document.getElementById("sub_id1").style.display="none";
    document.getElementById("sub_id3").style.display="none";
    document.getElementById("sub_id4").style.display="none";
 
        
    document.getElementById("sub_id2").style.display="block";
    document.getElementById("sub_id2").style.top="20px";
    document.getElementById("sub_id2").style.position="absolute";
    document.getElementById("sub_id2").style.left="0px";
    document.getElementById("sub_id2").style.width="750px";
    document.getElementById("sub_id2").style.paddingLeft="80px";
        
}
if(obj==3)
{

   document.getElementById("sub_id1").style.display="none";
    document.getElementById("sub_id2").style.display="none";
    document.getElementById("sub_id4").style.display="none";

        
    document.getElementById("sub_id3").style.display="block";
    document.getElementById("sub_id3").style.top="20px";
    document.getElementById("sub_id3").style.position="absolute";
    document.getElementById("sub_id3").style.left="0px";
    document.getElementById("sub_id3").style.width="750px";
    document.getElementById("sub_id3").style.paddingLeft="80px";
}
if(obj==4)
{

   document.getElementById("sub_id1").style.display="none";
    document.getElementById("sub_id2").style.display="none";
    document.getElementById("sub_id3").style.display="none";

        
    document.getElementById("sub_id4").style.display="block";
    document.getElementById("sub_id4").style.top="20px";
    document.getElementById("sub_id4").style.position="absolute";
    document.getElementById("sub_id4").style.left="0px";
    document.getElementById("sub_id4").style.width="750px";
    document.getElementById("sub_id4").style.paddingLeft="380px";
}

if(obj==5)
{

   document.getElementById("sub_id1").style.display="none";
    document.getElementById("sub_id2").style.display="none";
    document.getElementById("sub_id3").style.display="none";
    document.getElementById("sub_id4").style.display="none"; 
        
    document.getElementById("sub_id5").style.display="block";
    document.getElementById("sub_id5").style.top="20px";
    document.getElementById("sub_id5").style.position="absolute";
    document.getElementById("sub_id5").style.left="0px";
    document.getElementById("sub_id5").style.width="750px";
    document.getElementById("sub_id5").style.paddingLeft="450px";
}
} 



//For res
function validate_form_res(obj)
{

if(trim(obj.group_name.value)=="")
{
  alert("Please Enter Group Name");
obj.group_name.value="";
		obj.group_name.focus();
return false;
}

if(trim(obj.first_name.value)=="")
{
  alert("Please Enter First Name");
obj.first_name.value="";
		obj.first_name.focus();
return false;
}
if(trim(obj.last_name.value)=="")
{
  alert("Please Enter Last Name");
obj.last_name.value="";
		obj.last_name.focus();
return false;
}

if(trim(obj.email.value)=="")
{
  alert("Please Enter Email");
obj.email.value="";
		obj.email.focus();
return false;
}
else
{
     if(!checkemail(obj.email.value))
   {
    alert("Please Enter Valid Email");
obj.email.value="";
		obj.email.focus();
    return false;
   }
}


  if(trim(obj.phone_home.value)!="")
{



                if (checkInternationalPhone(obj.phone_home.value)==false){
		alert("Please Enter a Valid Home Phone Number");
		obj.phone_home.value="";
		obj.phone_home.focus();
		return false;
               }
}

  if(trim(obj.phone_off.value)!="")
{



                if (checkInternationalPhone(obj.phone_off.value)==false){
		alert("Please Enter a Valid Office Phone Number");
		obj.phone_off.value="";
		obj.phone_off.focus();
		return false;
               }
}


obj.flag.value='1';  

if(trim(obj.start_date.value)=="")
{
  alert("Please Enter Start Date");
obj.start_date.value="";
		obj.start_date.focus();
return false;
}


if(trim(obj.end_date.value)=="")
{
  alert("Please Enter End Date");
obj.end_date.value="";
		obj.end_date.focus();
return false;
}

if(trim(obj.rooms.value)=="")
{
	alert("Please Enter Rooms");
	obj.rooms.value="";
	obj.rooms.focus();
return false;
}
else
{
	if(isInteger(obj.rooms.value)==false)
	{
		alert("Please Enter Rooms only in integer");
		obj.rooms.value="";
		obj.rooms.focus();
		return false;
	}
}
if(trim(obj.guests.value)=="")
{
  alert("Please Enter Guests");
obj.guests.value="";
		obj.guests.focus();
return false;
}
else
{
	if(isInteger(obj.guests.value)==false)
	{
		alert("Please Enter Guests only in integer");
		obj.guests.value="";
		obj.guests.focus();
		return false;
	}
}



return true;
   
}

//res sp
function validate_form_res_sp(obj)
{

if(trim(obj.group_name.value)=="")
{
  alert("Por favor, escriba el nombre de grupo");
obj.group_name.value="";
		obj.group_name.focus();
return false;
}

if(trim(obj.first_name.value)=="")
{
  alert("Por favor, escriba Nombre");
obj.first_name.value="";
		obj.first_name.focus();
return false;
}
if(trim(obj.last_name.value)=="")
{
  alert("Por favor, escribe Apellido");
obj.last_name.value="";
		obj.last_name.focus();
return false;
}

if(trim(obj.email.value)=="")
{
  alert("Por favor, escriba Correo electrónico");
obj.email.value="";
		obj.email.focus();
return false;
}
else
{
     if(!checkemail(obj.email.value))
   {
    alert("Por favor, escriba Correo Valida");
obj.email.value="";
		obj.email.focus();
    return false;
   }
}


  if(trim(obj.phone_home.value)!="")
{



                if (checkInternationalPhone(obj.phone_home.value)==false){
		alert("Escriba su Teléfono de Casa");
		obj.phone_home.value="";
		obj.phone_home.focus();
		return false;
               }
}

  if(trim(obj.phone_off.value)!="")
{



                if (checkInternationalPhone(obj.phone_off.value)==false){
		alert("Por favor, escriba un número de teléfono válido Oficina");
		obj.phone_off.value="";
		obj.phone_off.focus();
		return false;
               }
}


if(trim(obj.start_date.value)=="")
{
  alert("Por favor, escriba Fecha de inicio");
obj.start_date.value="";
		obj.start_date.focus();
return false;
}


if(trim(obj.end_date.value)=="")
{
  alert("Por favor, escriba Fecha de término");
obj.end_date.value="";
		obj.end_date.focus();
return false;
}

if(trim(obj.rooms.value)=="")
{
	alert("Por favor, escribe Habitaciones");
	obj.rooms.value="";
	obj.rooms.focus();
return false;
}
else
{
	if(isInteger(obj.rooms.value)==false)
	{
		alert("Por favor, escribe sólo en Habitaciones enter");
		obj.rooms.value="";
		obj.rooms.focus();
		return false;
	}
}
if(trim(obj.guests.value)=="")
{
  alert("Por favor, escribe huéspedes");
obj.guests.value="";
		obj.guests.focus();
return false;
}
else
{
	if(isInteger(obj.guests.value)==false)
	{
		alert("Por favor, escriba los huéspedes sólo en entero");
		obj.guests.value="";
		obj.guests.focus();
		return false;
	}
}



return true;
   
}








//For meeting
function validate_form_meet(obj)
{

if(trim(obj.event_name.value)=="")
{
  alert("Please Enter Event Name/Type");
obj.event_name.value="";
		obj.event_name.focus();
return false;
}

if(trim(obj.first_name.value)=="")
{
  alert("Please Enter First Name");
obj.first_name.value="";
		obj.first_name.focus();
return false;
}
if(trim(obj.last_name.value)=="")
{
  alert("Please Enter Last Name");
obj.last_name.value="";
		obj.last_name.focus();
return false;
}

if(trim(obj.email.value)=="")
{
  alert("Please Enter Email");
obj.email.value="";
		obj.email.focus();
return false;
}
else
{
     if(!checkemail(obj.email.value))
   {
    alert("Please Enter Valid Email");
obj.email.value="";
		obj.email.focus();
    return false;
   }
}


  if(trim(obj.phone_home.value)!="")
{



                if (checkInternationalPhone(obj.phone_home.value)==false){
		alert("Please Enter a Valid Home Phone Number");
		obj.phone_home.value="";
		obj.phone_home.focus();
		return false;
               }
}

  if(trim(obj.phone_off.value)!="")
{



                if (checkInternationalPhone(obj.phone_off.value)==false){
		alert("Please Enter a Valid Office Phone Number");
		obj.phone_off.value="";
		obj.phone_off.focus();
		return false;
               }
}

/*
if(trim(obj.event_date.value)=="")
{
  alert("Please Enter Event Date");
obj.event_date.value="";
		obj.event_date.focus();
return false;
}

*/
return true;
   
}





//For meeting sp
function validate_form_meet_sp(obj)
{

if(trim(obj.event_name.value)=="")
{
  alert("Por favor, escriba Nombre del Evento / Tipo");
obj.event_name.value="";
		obj.event_name.focus();
return false;
}

if(trim(obj.first_name.value)=="")
{
  alert("Por favor, escriba Nombre");
obj.first_name.value="";
		obj.first_name.focus();
return false;
}
if(trim(obj.last_name.value)=="")
{
  alert("Por favor, escribe Apellido");
obj.last_name.value="";
		obj.last_name.focus();
return false;
}

if(trim(obj.email.value)=="")
{
  alert("Por favor, escriba Correo electrónico");
obj.email.value="";
		obj.email.focus();
return false;
}
else
{
     if(!checkemail(obj.email.value))
   {
    alert("Por favor, escriba Correo Valida");
obj.email.value="";
		obj.email.focus();
    return false;
   }
}


  if(trim(obj.phone_home.value)!="")
{



                if (checkInternationalPhone(obj.phone_home.value)==false){
		alert("Escriba su Teléfono de Casa");
		obj.phone_home.value="";
		obj.phone_home.focus();
		return false;
               }
}

  if(trim(obj.phone_off.value)!="")
{



                if (checkInternationalPhone(obj.phone_off.value)==false){
		alert("Por favor, escriba un número de teléfono válido Oficina");
		obj.phone_off.value="";
		obj.phone_off.focus();
		return false;
               }
}

/*
if(trim(obj.event_date.value)=="")
{
  alert("Por favor, escriba Fecha Evento");
obj.event_date.value="";
		obj.event_date.focus();
return false;
}
*/

return true;
   
}
