function crearXMLHTTP(){
			var cxm = null;
			try{
				cxm = new XMLHttpRequest();
			}catch(e){
				cxm = new ActiveXObject("Microsoft.XMLHTTP");
			}
			return cxm;
}
function serachEvent(e)
{
      tecla = (document.all) ? e.keyCode : e.which;
      if (tecla==13) search();
}
function search()
{
  var obcxm = crearXMLHTTP();
  var keys = document.getElementById("search").value;
  var s_ref = document.getElementById("search-ref").value;
        var Url = String(document.location);
        Url = Url.replace("http://", "");
        var Url_S = Url.split("index.html");
        
  url = "http://"+Url_S[0]+"/inc/functions_ajax.php"; //Archivo donde se irá comprobando el estado
	paramentros = "search="+keys; //el parámetro que le pasamos al arhivo anterior
	tipo_contenido = "application/x-www-form-urlencoded";
	//Se podría hacer también en get
  metodo = "post";			
  //Obtenemos nuestro objeto XMLHttp
  //Abrimos la conexión
  obcxm.open(metodo, url, true);
  obcxm.setRequestHeader('Content-Type', tipo_contenido);
  //Mientras hayan cambios de estado ejecutamos la función estadoPeticion()
  obcxm.onreadystatechange = function(){
     if (obcxm.readyState == 4){
				if(obcxm.status == 200){	
					if(obcxm.responseText!=""){
            	location.href = s_ref+obcxm.responseText;
					}		
				}
			}};
  obcxm.send(paramentros);             
}
function send_email()
{
        var Url = String(document.location);
        Url = Url.replace("http://", "");
        var Url_S = Url.split("index.html");
    //Chequeamos el email con una expresion regular
    var obcxm = crearXMLHTTP();

    var inf_email = document.getElementById("txt_email").innerHTML;
    var keys = document.getElementById("mmm").value;
    var obcxm = crearXMLHTTP();


    url = "http://"+Url_S[0]+"/inc/functions_ajax.php"; //Archivo donde se irá comprobando el estado
  	paramentros = "email="+keys; //el parámetro que le pasamos al arhivo anterior
  	tipo_contenido = "application/x-www-form-urlencoded";
  	//Se podría hacer también en get
    metodo = "post";			
    //Obtenemos nuestro objeto XMLHttp
    //Abrimos la conexión
    obcxm.open(metodo, url, true);
    obcxm.setRequestHeader('Content-Type', tipo_contenido);
    //Mientras hayan cambios de estado ejecutamos la función estadoPeticion()
    obcxm.onreadystatechange = function(){
       if (obcxm.readyState == 4){
  				if(obcxm.status == 200){	
  					if(obcxm.responseText=="1"){
              	document.getElementById("txt_email").innerHTML= 
              	"<span style='margin:20px;'>Thank you for subscribing to our newsletter.</span>";
                //location.href = s_ref+obcxm.responseText;
  					}		
  				}
  			}};
    obcxm.send(paramentros);
}
function mostrarFlash(w, h, archivo, nombre, noemb){

	var flash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';
	flash += 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+w+'" ';
	flash += 'height="'+h+'";id="'+nombre+'" align="middle">';
	flash += '<param name="allowScriptAccess" value="sameDomain" />';
	flash += '<param name="movie" value="'+archivo+'" />';
	flash += '<param name="quality" value="high" />';
	flash += '<param name="bgcolor" value="#ffffff" />';
	flash += '<param name="wmode" value="transparent" />';
	flash += '<embed src="'+archivo+'" quality="high" bgcolor="#ffffff" width="'+w+'" height="'+h+'" name="'+nombre+'';
	flash += 'align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" ';
	flash += 'pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" />';
	flash += '<noembed>';
	flash += ' '+ noemb +' ';
	flash += '</noembed>';
	flash += '</object>';
	
	document.write(flash);
}
function validate_required(field, alerttxt)
{
      with (field)
      {
      apos=value.indexOf("@");
      dotpos=value.lastIndexOf(".");
      if (apos<1||dotpos-apos<2) 
        {alert(alerttxt);return false;}
      else {return true;}
      }

}
function checkInfoMail(){
    var name = document.getElementById("f_name");
    var l_name = document.getElementById("l_name");
    
    var email = document.getElementById("email");
    var sub = document.getElementById("subject");
    var mess = document.getElementById("message");
    var formulario = document.getElementById("formulario");

    if(name.value == ""){
      alert("please, enter your first name");
      name.focus();
      return;
    }
      
    if(validate_required(email,"please, enter your email")==false){
      email.focus();
      return;
    }  
    if(l_name.value == ""){
      alert("please, enter your last name");
      l_name.focus();
      return;
    }  
    if(sub.value == ""){
      alert("please, enter the subject");
      sub.focus();
      return;
    }
    if(mess.value == ""){
      alert("please, enter the message");
      mess.focus();
      return;
    }
    formulario.submit();                   
}
function cambiaCapa()
{
        document.getElementById("menuflash").style.zIndex = 0;
        document.getElementById("img-body").style.zIndex = 12;
}
function cambiaCapa2()
{

        document.getElementById("menuflash").style.zIndex = 10;
        document.getElementById("img-body").style.zIndex = 0;
}
function val(){

 patron_mail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;

 if(document.formulario.company.value == 0){
 alert("please, enter the company name");
 document.formulario.company.focus();
 return false;
 }else if(document.formulario.email.value == ""){
alert("Please, enter an e-mail address");
 document.formulario.email.focus();
 return false;
 }else if(!patron_mail.test(document.formulario.email.value)){
 alert("Please, enter a valid email address");
 document.formulario.email.focus();
 return false;
 }else{
 return true;
 }
}
var Url = String(document.location);
Url = Url.replace("http://", "");
var Url_S = Url.split("index.html");
if(Url_S[0]=="www.luxuryexplorer.com" || Url_S[0]=="luxuryexplorer.com")
{
    var ppp="";
    for(var e=1;e<Url_S.length;e++)
    {
        if(Url_S[e]!="")
        {
            if(e==Url_S.length-1)
              ppp += Url_S[e];
            else
              ppp += Url_S[e]+"/";    
      }
    }
    location.href = "http://franklynhotels.com/inc/exit.php";
}