function popUpContacto(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=960,height=600,left = 230,top = 100');");
}
function slide(idCont, tip){
	
	//array de imagenes para cambiar
	var imgs = new Array(4);
	
	//imagenes que van a cambiar
	imgs[1] = 'img/slide1.jpg';
	imgs[2] = 'img/slide2.jpg';
	imgs[3] = 'img/slide3.jpg';
	imgs[4] = 'img/slide2.jpg';
	
	//array de los links de cada imagen
	var url = new Array(4);
	
	//imagenes que van a cambiar
	url[1] = 'cotizador.php';
	url[2] = 'view_dest.php?cat=4';
	url[3] = 'javascript: proximamente();';
	url[4] = 'view_dest.php?cat=4';

	
	//array de los btn del control
	var btn_slide = new Array(4);
	
	//imagenes del control de cambio de imagen
	btn_slide[1] = document.getElementById('btn1_slide');
	btn_slide[2] = document.getElementById('btn2_slide');
	btn_slide[3] = document.getElementById('btn3_slide');
	btn_slide[4] = document.getElementById('btn4_slide');

	if(tip == 'auto'){
	//si la imagen i es igual a 4 lo restauramos a 1 para que siga el proceso.
	if(i>3){
		i=1;
		}
	else{
		i++;
		}
	//cambiamos todos los controles a color blanco
	btn_slide[1].src = 'img/btn_blanco.png';
	btn_slide[2].src = 'img/btn_blanco.png';
	btn_slide[3].src = 'img/btn_blanco.png';
	btn_slide[4].src = 'img/btn_blanco.png';
	
	//cambiamos la imagen del slide y el control correspondiente a azul o activo.
	document.getElementById('slide').innerHTML = "<a href='"+url[i]+"'><img border='0' src='"+imgs[i]+"'></a>";
	//document.getElementById('img_slide').src = imgs[i];
	btn_slide[i].src = 'img/btn_azul.png';
	}
	else{
	
	//cambiamos todos los controles a color blanco
	btn_slide[1].src = 'img/btn_blanco.png';
	btn_slide[2].src = 'img/btn_blanco.png';
	btn_slide[3].src = 'img/btn_blanco.png';
	btn_slide[4].src = 'img/btn_blanco.png';	
		
	document.getElementById('slide').innerHTML = "<a href='"+url[idCont]+"'><img border='0' src='"+imgs[idCont]+"'></a>";
	btn_slide[idCont].src = 'img/btn_azul.png';
	i = idCont;
		}
	}
	
function cargar(vItems){
	jQuery.noConflict();
	var con = "con_" + vItems;
	var archivo ="forms_cotizador/" + vItems + ".php";
	if(document.getElementById(vItems).checked){
	jQuery.post(archivo, {},
     function(data){
 		document.getElementById(con).innerHTML = data;
      });
		}
	else{
		document.getElementById(con).innerHTML = '';
	//	$("#div_tiquetes").hide(3000);
		}
	}
//fin ajax
var num = 0;
function cambiar(nro){
	var nro = window['num'] + 1;
	document.getElementById('nro_txt').value= nro;
	window['num'] = nro;
	}
	
// Esta funcion cambia la propiedad display de un div o elemento de la pagina.
function ver_div(id){
	document.getElementById(id).style.display='';
	}
	
// Esta funcion cambia la propiedad display de '' a none para desaparecer el div o el elemento.
function cerrar_div(id){
	document.getElementById(id).style.display='none';
	}

//funcion para abrir el formulario de al dar clic en servicios individuales o en paquetes turisticos.
function ver_ocultar_ser_paq(id){
	if(id == 'servicios_individuales'){
		if(
		   document.getElementById(id).style.display=='none'){
	  	   document.getElementById(id).style.display='';
	   	   document.getElementById('paquetes_turisticos').style.display='none';
		}
	else{
		document.getElementById(id).style.display='none';
		}
	}
	else{
		if(document.getElementById(id).style.display=='none'){
	  	   document.getElementById(id).style.display='';
	   	   document.getElementById('servicios_individuales').style.display='none';
		}
	else{
		document.getElementById(id).style.display='none';
		}
		}
}

//funcion que selecciona qeu Divs va a cargar con respecto a la seleccion del usuario.
function crear_form(){
	
var tot =  document.getElementById('tiquetes').checked
	tot += document.getElementById('autos').checked
	tot += document.getElementById('hoteles').checked
	tot += document.getElementById('tarjeta').checked
	tot += document.getElementById('traslados').checked
	tot += document.getElementById('tours').checked
	tot += document.getElementById('tramites').checked;
	if(tot == 0){
		alert("Por favor uno de nuestros servicios para continuar");
		}
	if(document.getElementById('tiquetes').checked){
		ver_div('div_tiquetes');
		}	else{
			cerrar_div('div_tiquetes');
			}
	if(document.getElementById('autos').checked){
		alert("se cargaran al formulario los datos de " + document.getElementById('autos').value);
		}	
	if(document.getElementById('hoteles').checked){
		alert("se cargaran al formulario los datos de " + document.getElementById('hoteles').value);
		}
	if(document.getElementById('tarjeta').checked){
		alert("se cargaran al formulario los datos de " + document.getElementById('tarjeta').value);
		}	
	if(document.getElementById('traslados').checked){
		alert("se cargaran al formulario los datos de " + document.getElementById('traslados').value);
		}	
	if(document.getElementById('tours').checked){
		alert("se cargaran al formulario los datos de " + document.getElementById('tours').value);
		}	
	if(document.getElementById('tramites').checked){
		alert("se cargaran al formulario los datos de " + document.getElementById('tramites').value);
		}	
	}
function cargar_item(check, archivo){
	jQuery.noConflict();
	if(document.getElementById(check).checked){
		jQuery("#items").load(items/tiquetes.html);
		}
	}
//funciones de aca asia abajo son generadas por dreams weaver para el cambio de imagenes u otros scripts
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 validar_correo(){
	if(document.getElementById('mail').value != document.getElementById('con_mail').value){
		alert("El correo no coincide por favor verificalo.");
		}
	if(document.getElementById('mail').value == ''){
		alert("Este campo no puede estar en vacio");
		}
	}
function validar_form(a){
	if(a.value == ''){
		a.style.border = '#FF0000 thin solid'
		}
	else{
		a.style.border = ''
		}
	}
function enviar(){
	if(
	document.getElementById('pri_nom').value == '' || document.getElementById('pri_ape').value == '' || document.getElementById('nro_doc').value == '' || document.getElementById('mail').value == '' || document.getElementById('fec_nac').value == '' || document.getElementById('pas').value == ''){
		alert("Por favor llena todos los campos obligatorios correctamente.");
		}
	else{
		document.forms[1].submit();
		}
	}

function validarCotizador(){
	
		tiquetes = document.getElementById('tiquetes');
		tramites = document.getElementById('tramites');
		tarjeta = document.getElementById('tarjeta');
		autos = document.getElementById('autos');
		traslados = document.getElementById('traslados');
		hoteles = document.getElementById('hoteles');
		tours = document.getElementById('tours');
		cotError = "no";
	
	if(tiquetes.checked){
		
		pais_origen_tiquetes = document.getElementById('pais_origen_tiquetes');
		tx_ciudad_origen_tiquetes = document.getElementById('tx_ciudad_origen_tiquetes');
		Pais_destino_tiquetes = document.getElementById('Pais_destino_tiquetes');
		tx_ciudad_destino_tiquetes = document.getElementById('tx_ciudad_destino_tiquetes');
		fecha_ida_tiquetes = document.getElementById('fecha_ida_tiquetes');
		fecha_regreso_tiquetes = document.getElementById('fecha_regreso_tiquetes');
		
		if(pais_origen_tiquetes.value == ''){
		pais_origen_tiquetes.style.border = '#ff000';
		cotError = "ok";
			}
			
		if(tx_ciudad_origen_tiquetes.value == ''){
		tx_ciudad_origen_tiquetes.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(Pais_destino_tiquetes.value == ''){
		Pais_destino_tiquetes.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(tx_ciudad_destino_tiquetes.value == ''){
		tx_ciudad_destino_tiquetes.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(fecha_ida_tiquetes.value == ''){
		fecha_ida_tiquetes.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(fecha_regreso_tiquetes.value == ''){
		fecha_regreso_tiquetes.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
		}
	
	if(tramites.checked){
		
		Pais_destino_tramites = document.getElementById('Pais_destino_tramites');
		tx_des_ciu = document.getElementById('tx_des_ciu');
		fecha_viaje_tramites = document.getElementById('fecha_viaje_tramites');
		
		if(Pais_destino_tramites.value == ''){
		Pais_destino_tramites.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(tx_des_ciu.value == ''){
		tx_des_ciu.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(fecha_viaje_tramites.value == ''){
		fecha_viaje_tramites.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
		
		}
		

	if(tarjeta.checked){
		
		Pais_destino_tarjeta = document.getElementById('Pais_destino_tarjeta');
		tx_ciu_des_tarjeta = document.getElementById('tx_ciu_des_tarjeta');
		fecha_ida_tarjeta = document.getElementById('fecha_ida_tarjeta');
		fecha_reg_tarjeta = document.getElementById('fecha_reg_tarjeta');
		
		if(Pais_destino_tarjeta.value == ''){
		Pais_destino_tarjeta.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(tx_ciu_des_tarjeta.value == ''){
		tx_ciu_des_tarjeta.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(fecha_ida_tarjeta.value == ''){
		fecha_ida_tarjeta.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
		
		if(fecha_reg_tarjeta.value == ''){
		fecha_reg_tarjeta.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
		}


	if(autos.checked){
		
		tx_recoje_autos = document.getElementById('tx_recoje_autos');
		auto_entrega_autos = document.getElementById('auto_entrega_autos');
		tx_entrega_autos = document.getElementById('tx_entrega_autos');
		
		if(tx_recoje_autos.value == ''){
		tx_recoje_autos.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(auto_entrega_autos.value == ''){
		auto_entrega_autos.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(tx_entrega_autos.value == ''){
		tx_entrega_autos.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		}
		
	if(traslados.checked){
		
		pais_origen_traslados = document.getElementById('pais_origen_traslados');
		pais_destino_traslados = document.getElementById('pais_destino_traslados');
		fecha_salida_traslados = document.getElementById('fecha_salida_traslados');
		hora_salida_traslados = document.getElementById('hora_salida_traslados');
		fecha_regreso_traslados = document.getElementById('fecha_regreso_traslados');
		
		if(pais_origen_traslados.value == ''){
		pais_origen_traslados.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(pais_destino_traslados.value == ''){
		pais_destino_traslados.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(fecha_salida_traslados.value == ''){
		fecha_salida_traslados.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
		
		if(hora_salida_traslados.value == ''){
		hora_salida_traslados.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(fecha_regreso_traslados.value == ''){
		fecha_regreso_traslados.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		}

	if(hoteles.checked){
		
		dest_hoteles = document.getElementById('dest_hoteles');
		hotel_ciudad_hoteles = document.getElementById('hotel_ciudad_hoteles');
		checkin_hoteles = document.getElementById('checkin_hoteles');
		checkout_hoteles = document.getElementById('checkout_hoteles');
		
		if(dest_hoteles.value == ''){
		dest_hoteles.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(hotel_ciudad_hoteles.value == ''){
		hotel_ciudad_hoteles.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(checkin_hoteles.value == ''){
		checkin_hoteles.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
		
		if(checkout_hoteles.value == ''){
		checkout_hoteles.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}			
		}

	if(tours.checked){
		
		pasis_destino_tours = document.getElementById('pasis_destino_tours');
		tx_ciudad_destino_tours = document.getElementById('tx_ciudad_destino_tours');
		fecha_tours = document.getElementById('fecha_tours');
		
		if(pasis_destino_tours.value == ''){
		pasis_destino_tours.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}
			
		if(tx_ciudad_destino_tours.value == ''){
		tx_ciudad_destino_tours.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}

		if(fecha_tours.value == ''){
		fecha_tours.style.border = '#ff0000 thin solid';
		cotError = "ok";
			}	
		}
		
		if(cotError == 'ok'){
		alert('Debes llenar todos los datos obligatorios');
			}
		else{document.getElementById('form_cotizador').submit();}
	}
	
var errorForm = "";
function validar_campo(campo){
field = document.getElementById(campo);
	if(field.value =='' || field.value=='0' ){
		field.style.border = '#F00 thin solid';
		alert('Este campo es obligatorio.');
		errorForm = 'ok';
		}
	else{
		field.style.borderLeft = '#999 thin solid';
		field.style.borderTop = '#999 thin solid';
		field.style.borderRight = '#ccc thin solid';
		field.style.borderBottom = '#ccc thin solid';
		errorForm = 'no';
		}
	}
function mouseOverPlan(divs){
	divs.style.border= '1px #CCC  solid';
	}
function mouseOutPlan(divs){
	divs.style.border= '1px #FFFFFF solid';
	}
function redirectPlan(idPlan, idCat, idDes){
	window.location.href= "view_plan.php?"+"plan="+idPlan+"&cat="+idCat+"&des="+idDes;
	}
function changeContPesta(pestana){
	document.getElementById('cuad_pest').innerHTML = pestana;
	}
function proximamente(){
	alert("Proximamente...");
	}
function cotizarPlan(idPlan){
	document.getElementById('popUps').innerHTML = "<form action=\""+location.href+"&action=cotizar"+"\"  method='post' id='formCotizarPlan'><div id='popUpCotizar'><div style='position:absolute; left: 376px; top: 0px; font-size:12px; cursor:pointer;' onClick=\"document.getElementById('popUps').style.display='none'\">Cerrar</div><div style='position:absolute; left: 10px; top: 13px; font-size:20px; width: 126px;'>Cotizaci&oacute;n:</div><div style='position:absolute; left: 11px; top: 55px; font-size:12px; width: 169px; height: 155px;'><p><strong>Nro Personas:</strong></p><p><select name='edadAd' style='width:40px;'><option value='1' selected='selected'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option>  <option value='7'>7</option>  <option value='8'>8</option>  <option value='9'>9</option>  <option value='10'>10</option></select>      <select name='edadNin' id='edadNin' style='width:40px;'>        <option value='0' selected='selected'>0</option>        <option value='1'>1</option>        <option value='2'>2</option>        <option value='3'>3</option>        <option value='4'>4</option>        <option value='5'>5</option>        <option value='6'>6</option>        <option value='7'>7</option>        <option value='8'>8</option>        <option value='9'>9</option>        <option value='10'>10</option>      </select>      <select name='edadInf' id='edadInf' style='width:40px;'>        <option value='0' selected='selected'>0</option>        <option value='1'>1</option>        <option value='2'>2</option>        <option value='3'>3</option>        <option value='4'>4</option>        <option value='5'>5</option>        <option value='6'>6</option>        <option value='7'>7</option>        <option value='8'>8</option>        <option value='9'>9</option>        <option value='10'>10</option>      </select>    <div style='position:relative; float:left; font-size:11px; margin-right:8px; line-height:12px; color:#999'>Adultos<br />      (+12)    </div>    <div style='position:relative; float:left; font-size:11px; margin-right:12px; line-height:12px; color:#999'>Ni&ntilde;os<br />      (2 - 11) </div>    <div style='position:relative; float:left; font-size:11px; margin-right:4px; line-height:12px; color:#999'>Infantes<br />      (0-23 Meses)</div>      <p>&nbsp;</p>      <p>&nbsp;</p>      <p><strong>Actividades a realizar:</strong><br>        <input name='actividades' type='text' id='actividades' />      </p>      <p>&nbsp;</p>      <p><strong>Presupuesto X persona:</strong><br>        <input name='presupuesto' type='text' id='presupuesto' />      </p></div><div style='position:absolute; left: 214px; top: 51px; width: 188px;'>  <p><strong>Fecha Salida:</strong></p>  <p>    <input name='fechaSalida' type='text' id='fechaSalida' />    <img style='vertical-align:text-bottom' src='img/calendario/menu_calendario.png' width='24' height='24' onclick=\"displayCalendar(document.forms[1].fechaSalida,'dd/mm/yyyy',this)\" /></p>  <p>&nbsp;</p>  <p><strong>Fecha de llegada:  </strong></p>  <p>    <input name='fechaLlegada' type='text' id='fechaLlegada' />    <img style='vertical-align:text-bottom' src='img/calendario/menu_calendario.png' width='24' height='24' onclick=\"displayCalendar(document.forms[1].fechaLlegada,'dd/mm/yyyy',this)\"/>  </p></div><div style='position:absolute; top: 230px; width: 396px;'>   <p><strong>Comentarios:</strong></p>        <p>    <textarea name='comentarios' cols='60' rows='2'></textarea></p> <center><a href=\"javascript: document.getElementById('formCotizarPlan').submit() \"><img border='0' src='img/btn_cotizar.png' style='margin-top:20px;'/></a><input type='hidden' id='nomUser' name='nomUser' value='"+nomUser+"'><input type='hidden' id='telUser' name='telUser' value='"+telUser+"'><input type='hidden' id='ciuUser' name='ciuUser' value='"+ciuUser+"'><input type='hidden' id='urlPlan' name='urlPlan' value=\""+urlPlan+"\"></center> </p></div><div style='position:absolute; left: 259px; top: 20px; font-size:12px; width: 126px;'><strong>Producto:</strong>&nbsp;PREV00"+plan+"</div></div></form>";
	document.getElementById('popUps').style.display="";
	}
function reservarPlan(plan, cat, des){

	window.open('http://www.contactme.com/4f28517f3d4919000100025d/embed?plan='+plan+'&cat='+cat+'&des='+des, '', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=500,left = 390,top = 110');

	}
function crearFormLogin(){
	document.getElementById('popUps').innerHTML ="<div id='popUpLogin'>  <form style='margin-top:30px; margin-left:20px;' method='get' action=\""+window.location+"\" id='form_login_cot'>  <div style='position:absolute; left: 570px; top: 1px; font-size:12px; cursor:pointer;' onClick=\"document.getElementById('popUps').style.display='none'\"><strong>Cerrar</strong></div>  <div style='width:600px;'>    <div style='width:300px; float:left; text-align:left; border-right:#CCC thin solid; height:220px; position:relative'>      <p style='font-size:18px; font-weight:bold'>Usuario Registrado</p>      <p style='font-size:18px; font-weight:bold'>&nbsp; </p>      <p>Correo:<br />        <input name='mail' type='text' id='mail' style='width:250px; font-size:12px; height:28px;' />      </p>      <p>&nbsp;</p>      <p>Password:<br />        <input name='pass' type='password' id='pass' style='width:250px; font-size:12px; height:28px;' />      </p>      <p><span style='font-size:12px;'><a href='recoverPass.php' onClick='window.open(this.href,\"Password\",\"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300\"); return false;'>Olvido su contrase&ntilde;a &raquo;</a> </span></p>      <div align='center' style='margin-top:20px; width:300px;'><img src='img/btn_ingresar.jpg' width='85' height='24' style='cursor:pointer' onclick=\"document.getElementById('form_login_cot').submit();\"/>        <input type='hidden' name='login' id='login' value='1'  />  <input type='hidden' name='urlRef' id='urlRef' value=\""+location.href+"\"  />  </div>    </div>    <div style='width:280px; float:left; height:250px;'>      <table width='100%' border='0' cellspacing='0' cellpadding='0' height='250'>        <tr>          <td align='center'><p style='font-size:18px; font-weight:bold'>Usuario Nuevo</p>            <p style='font-size:18px; font-weight:bold'>&nbsp;</p>            <p style='font-size:18px; font-weight:bold'><a href='form_registro.php'><img src='img/btn_registrarse.jpg' width='84' height='23' border='0' /></a></p>            <p style='font-size:18px; font-weight:bold'>&nbsp;</p>            <p style='font-size:18px; font-weight:bold'>&nbsp;</p></td>        </tr>      </table>    </div>    <div style='clear:both'></div>  </div>  </form></div>";
	document.getElementById('popUps').style.display="";
	}
	
function loadDestinos(idDes){
	jQuery.noConflict();
	jQuery("#divDestinos").load('include/funciones/ajax/builder.php?idDes='+idDes);
}	
