

// JavaScript Document
function load_content () {
        if (parent.document.getElementById('main_div')) {				
	       parent.document.getElementById('main_div').innerHTML=document.getElementById('inner_div').innerHTML;		   
        }
        if (!parent.document.getElementById('main_div')) {
           window.location=('index.html') ;
        }
}
function validate(frm, lang) {
	if(frm.nombre.value==""){
		 if(lang=="es"){
		   alert("Por favor ingrese su Nombre");
			}
			else{
				 alert("Please insert your Name");
	  }
			return false; 
	}
	if(frm.email.value==""){
		 if(lang=="es"){
		   alert("Por favor ingrese su E-mail");
			}
			else{
				 alert("Please insert your E-mail");
	  }
			return false; 
	}
	if(frm.payment[0].checked){
			if(frm.cardnum.value==""){
					if(lang=="es"){
							alert("Por favor ingrese su N�mero de Tarjeta");
					}
					else{
							alert("Please insert your Card Number");
					}
					return false; 
			}				
	}	
	//alert("Validate");
	return true; 
}
function CalShow(frmName, dteBox, btnImg) {
	var time=new Date();
	var day=time.getDate();
	var month=time.getMonth()+1;	
	var year=time.getYear();
		
	if (year < 2000)  year = year + 1900; 
	showCalendar(frmName,dteBox,btnImg,'',day,month,year,'31','03','2011');
	return false;
}




/*
function newWindow(URL) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=350,left = 240,top = 200');");
}

function EnableCtrl(frm){
 
  // frm.hotel.readOnly=true;
  // frm.habitacion.readOnly=true;
  // frm.fecha.readOnly=true;
  // frm.fecha1.readOnly=true;
  
  // frm.tarifa.readOnly=true;
  // frm.menor1.readOnly=true;
  // frm.plan.readOnly=true;
  
  creditcard(frm); 
  reservar(frm.reservadopor[0]); 
}
function creditcard(frm){
  var color="", bgcolor="", Disabled="";

  if(frm.payment[0].checked){
    color='gray'; 
	bgcolor='#EFEFEF';   
    Disabled=true;
  }
  else{
    color='black'  
	bgcolor='white';    
    Disabled=false;
  }

  t_cardnum.style.color=color    
  frm.cardnum.disabled=Disabled
  frm.cardnum.style.backgroundColor=bgcolor

  t_cardtype.style.color=color  
  frm.cardtype.disabled=Disabled
  frm.cardtype.style.backgroundColor=bgcolor

  t_expirationdate.style.color=color  
  frm.expirationmonth.disabled=Disabled  
  frm.expirationyear.disabled=Disabled
  frm.expirationmonth.style.backgroundColor=bgcolor
  frm.expirationyear.style.backgroundColor=bgcolor
    
}
function reservar(opcion){
  var color="", bgcolor="", Disabled="";
  frm=opcion.form;
     
  if((opcion.value==1) || (opcion.value==2)){
    
    color='gray'; 
	bgcolor='#EFEFEF';   
    Disabled=true;
	
	if(opcion.value==1){
	  t_nombrepor.style.color=color  
      frm.nombrepor.disabled=Disabled
      frm.nombrepor.style.backgroundColor=bgcolor      
    }
    
	t_agencia.style.color=color  
    frm.agencia.disabled=Disabled
    frm.agencia.style.backgroundColor=bgcolor 	
	t_agente.style.color=color  
    frm.agente.disabled=Disabled
    frm.agente.style.backgroundColor=bgcolor
	
	color='black'  
    bgcolor='white';    
    Disabled=false; 
	
	if(opcion.value==2){
	  t_nombrepor.style.color=color  
      frm.nombrepor.disabled=Disabled
      frm.nombrepor.style.backgroundColor=bgcolor      
    }
	
	t_direccion.style.color=color  
	frm.direccion.disabled=Disabled
	frm.direccion.style.backgroundColor=bgcolor
	t_ciudad.style.color=color  
	frm.ciudad.disabled=Disabled
	frm.ciudad.style.backgroundColor=bgcolor
	frm.estado.disabled=Disabled
	frm.estado.style.backgroundColor=bgcolor
  }
  else if(opcion.value==3){
    color='gray'; 
	bgcolor='#EFEFEF';   
    Disabled=true;
	
	t_nombrepor.style.color=color  
    frm.nombrepor.disabled=Disabled
    frm.nombrepor.style.backgroundColor=bgcolor 
	t_direccion.style.color=color  
	frm.direccion.disabled=Disabled
	frm.direccion.style.backgroundColor=bgcolor
	t_ciudad.style.color=color  
	frm.ciudad.disabled=Disabled
	frm.ciudad.style.backgroundColor=bgcolor
	frm.estado.disabled=Disabled
	frm.estado.style.backgroundColor=bgcolor
	
	color='black'  
    bgcolor='white';    
    Disabled=false; 
	
	t_agencia.style.color=color  
    frm.agencia.disabled=Disabled
    frm.agencia.style.backgroundColor=bgcolor 	
	t_agente.style.color=color  
    frm.agente.disabled=Disabled
    frm.agente.style.backgroundColor=bgcolor  
  }
}

function fillForm(hotel,tipo,tarifa,menor1,plan) {
  o_form = document.forms['frm1'];
  o_form.hotel.value=hotel; 
  o_form.tipo.value=tipo; 
  o_form.tarifa.value=tarifa; 
  o_form.menor1.value=menor1; 
  o_form.plan.value=plan;  
  o_form.submit();
}



*/