$(function() {
	$("#accordion").accordion({
		autoHeight: false
	});
	$("#tabs2").tabs();	
});

$(function(){
	$("ul#ticker01").liScroll();
});

$(document).ready(function(){	
	
	$(window).unload(function(){	
							  
	   $("#info_pagina").css({"visibility":"hidden"});		
	   
	});
	
	$.fx.speeds._default = 1000;
	
	$(function() {
	
		$("#dialog").dialog({
			autoOpen: false,
			show: "fadeIn",
			hide: "explode",
			height: 530,
			width: 800,
			title : "Cotizacion en Linea",
			modal: true
		});
	
		$("a[name=online]").click(function(){
			$("#dialog").dialog("open");
			return false;
		});
		
		$("#pdf_colombia").dialog({
			autoOpen: false,
			show: "fadeIn",
			hide: "explode",
			height: 530,
			width: 800,
			title : "Tarifas",
			modal: true
		});
	
		$("a[name=colombia]").click(function(){
			$("#pdf_colombia").dialog("open");
			return false;
		});
		
		$("#preguntale").dialog({
			autoOpen: false,
			show: "fadeIn",
			hide: "explode",
			height: 530,
			width: 800,
			title : "Preguntale a Beatriz",
			modal: true
		});
	
		$("a[name=preguntale]").click(function(){
			
			$("#preguntale").dialog("open");
			return false;
		});		
		
   	});
	
						   
	$("a[id!='']").click(function(){
								  
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs").css({"visibility":"visible"});
		$("#tabs3").css({"visibility":"hidden"});
		
		$("#tabs").tabs();						  
								  
		pais=$(this).attr("id");			  		
		
		$("#info_pagina").hide("fast");
		$("#info_pagina").empty();
		
		$("#info_pagina_2").hide("fast");
		$("#info_pagina_2").empty();
		
		$("#tabs2").hide();
		$("#tabs3").hide();
		$("#tabs").show();
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "info_pais.php", /* Transaction URL. */
				data: "pais="+String(pais)+"",/* Data to send to the URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){	
					$("#info_pagina").empty();
					$("#info_pagina").append(result);
					$("#info_pagina").show("slow");					
				} /* Shows the result message. */
		});
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "ciudades.php", /* Transaction URL. */
				data: "pais="+String(pais)+"",/* Data to send to the URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){	
					$("#info_pagina_2").empty();
					$("#info_pagina_2").append(result);
					$("#info_pagina_2").show("slow");
				} /* Shows the result message. */
		});
		
	});
	
	$("a[href*=tabs]").click(function(){
									  
		$("#info_pagina").show(200);
		$("#info_pagina_2").show(200);
		
	});
	
	$("a[href*=inicio]").click(function(){
										
		//$("#info_inicio").hide("fast");
		//$("#info_inicio").show(200);
		//$("#tabs").hide("slow");		
		
		$("#tabs").css({"display":"none"});
		$("#tabs").css({"visibility":"hidden"});
		
		$("#tabs3").css({"display":"none"});
		$("#tabs3").css({"visibility":"hidden"});
		
		$("#tabs2").show();
		$("#tabs2").css({"visibility":"visible"});
		
	});
	
	$("a[href*=nacional]").click(function(){		
		aux=$(this).attr("href").split("#");		
		
		if (aux[1]=="nacional") sw="true";
		else sw="false";
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "programas.php", /* Transaction URL. */
				data: "nacional="+sw,/* Data to send to the URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){	
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");
				} /* Shows the result message. */
		});	
	});
	
	//operacion
	$("a[href*=operacion]").click(function(){		
		tipo=$(this).attr("name");
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "operacion.php", /* Transaction URL. */
				data: "tipo="+tipo,/* Data to send to the URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){	
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	//crucero
	$("a[href*=crucero]").click(function(){		
		tipo=$(this).attr("name");
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();		
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "cruceros.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){			
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	//circuitos
	
	$("a[href*=santiagoturistico]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "santiago_chile.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){	
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=santiagovinos]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "santiago_chile.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){	
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=florida2]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "florida2.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){	
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=cruce_lagos]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "cruce_lagos.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){	
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=ecuador]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "ecuador.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){	
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=peru]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "peru.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){		
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=cubaA]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "cubaA.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){		
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=cubaB]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "cubaB.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){		
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=ceste]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "este_americano.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){			
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=costac]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "costa_california.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){		
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=plata]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "este_americano_plata.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){	
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=coeste]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "oeste_americano.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){		
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	//fin circuitos
	
	
	//certificaciones reconocimientos
	
	$("a[href*=certificaciones]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "certificaciones.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){		
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=reconocimientos]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "reconocimientos.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){		
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	
	$("a[href*=oper_oficiales]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "oper_oficiales.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){		
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});	
	//fin certificaciones reconocimientos
	
	
	//Cotizaciones distintas a USA Online
	$("a[href*=int_online]").click(function(){				
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();	
		
		/*$("#info_programas").append("CIRCUITO2");
		$("#info_programas").show("slow");*/
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "cotOnline.php", /* Transaction URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){		
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	//Fin cotizacines
	
	//informacion
	$("a[href*=informacion]").click(function(){		
		tipo=$(this).attr("name");
		
		$("#info_programas").hide("fast");
		$("#info_programas").empty();	
		
		$("#tabs").css({"visibility":"hidden"});	
		$("#tabs2").css({"visibility":"hidden"});
		$("#tabs3").css({"visibility":"visible"});
		
		$("#tabs3").tabs();
		
		$("#tabs2").hide();
		$("#tabs").hide();
		$("#tabs3").show();		
		
		$.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "informacion.php", /* Transaction URL. */
				data: "tipo="+tipo+"",
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){		
					$("#info_programas").empty();
					$("#info_programas").append(result);
					$("#info_programas").show("slow");					
				} /* Shows the result message. */
		});				
	});
	//fin informacion	
	
	//p_online
	
	$(window).unload(function(){	   	   
		   $("#chk").css("visibility","hidden");	   		   
	   	 });
	   
	   
	   $("#destino").change(function(){ /* Paises [load info into select: id > destino2]. */
 	      $("#destino2").empty(); /* Clear field. */
	      $("#resultado2").val($("#destino").val());	      
	
		  $.ajax({ /* AJAX. */
				type: "POST", /* Method. */
				url: "destinos.php", /* Transaction URL. */
				data: "id2="+String($("#destino").val())+"",/* Data to send to the URL. */
				/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
				error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
				/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
				success: function(result){ $("#destino2").append(result); } /* Shows the result message. */
		  });
		
			return false;
	    });
	   
	   $("#fecha_in").change(function(){
		   var today=new Date();							  
		   var hoy = new Date(today.getFullYear(),today.getMonth(),today.getDate());
		   
		   fecha = $(this).val().split("/");
	  	  	   
	  	   var f=new Date(fecha[2],fecha[0]-1,fecha[1]);
	  
	  	   var one_day=1000*60*60*24;
	  
	       dias=Math.ceil((f.getTime()-hoy.getTime())/(one_day));
		   
		   if (dias<1){
			 alert("Debe escoger una fecha mayor al día de hoy");
			 $(this).val("");
		   }
		   //$("#div_detal2").load("destinos.php", {id2: $("#destino").val()});		   
		 });
		
		$("#fecha_out").change(function(){
		   var today=new Date();							  
		   var hoy = new Date(today.getFullYear(),today.getMonth(),today.getDate());
		   
		   fecha = $(this).val().split("/");
		   
		   fecha_in = $("#fecha_in").val().split("/");
	  	  	   
	  	   var f=new Date(fecha[2],fecha[0]-1,fecha[1]);
		   
		   var f_in=new Date(fecha_in[2],fecha_in[0]-1,fecha_in[1]);
	  
	  	   var one_day=1000*60*60*24;
	  
	       dias=Math.ceil((f.getTime()-hoy.getTime())/(one_day));
		   
		   dias_est=Math.ceil((f.getTime()-f_in.getTime())/(one_day));
		   
		   if (dias<1 || dias_est<0){
			 alert("Debe escoger una fecha mayor al día de hoy ó verifique que la fecha de entrada es mayor o igual a la de salida");
			 $(this).val("");
		   }
		   //$("#div_detal2").load("destinos.php", {id2: $("#destino").val()});		   
		 });
       /*$("#destino").change(function(){		   
		   $("#resultado2").val($("#destino").val());
		   alert($("#destino").val());
		   $("#div_detal2").load("destinos.php", {id2: $("#destino").val()});		   
		 });*/
		 
	   $("#destino2").change(function(){		   
		   $("#resultado3").val($("#destino2").val());
		   $("#div_detal").hide("slow");
		   $("#div_detal2").hide("slow");
		   $("#div_detal_t").hide("slow");
		   $("#checkb1").attr("checked","");
		   $("#checkb2").attr("checked","");
		   $("#checkb3").attr("checked","");
		   //$("#div_detal2").load("destinos.php", {id2: $("#destino").val()});		   
		 });
	   
	   $("#npax").change(function(){		   
		   $("#resultado3").val($("#npax").val());
		   $("#div_detal").hide("slow");
		   $("#div_detal2").hide("slow");
		   $("#div_detal_t").hide("slow");
		   $("#checkb1").attr("checked","");
		   $("#checkb2").attr("checked","");
		   $("#checkb3").attr("checked","");
		   //$("#div_detal2").load("destinos.php", {id2: $("#destino").val()});		   
		 });
		 
	   $("#resultado").keyup(function(){
	       if($("#resultado").val()!="") valor=Number($("#resultado").val());
		   else $("#resultado").val(0);
		   $("#resultado3").val(valor);
		 });    	   
	 	   
	   //toures
	   $("#checkb1").click(function(){ 	
	   	    //var activos=$("input[name^="checkbt"]").is(":checked");	
			if($("#fecha_in").val()!="" && $("#fecha_out").val()!="" && $("#destino").val()!="" && $("#destino2").val()!=""){
				if($("#checkb1").is(":checked")){			 			    
					$.ajax({ /* AJAX. */
						type: "POST", /* Method. */
						url: "toures.php", /* Transaction URL. */
						data: "id="+$("#destino").val()+"&id2="+$("#destino2").val()+""+"&npax="+$("#npax").val()+"", /* Data to send to the URL. */
						/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
						error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
						/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
						success: function(result){$("#checkb1").attr("checked","checked"); $("#div_detal").empty();$("#div_detal").append(result); $("#div_detal").show("slow");} /* Shows the result message. */
					});
					return false;
				}else{
				 $("#div_detal").hide("slow");
				}
			}else{
				alert("Verifique que escogió una Fecha de entrada, una Fecha de salida y el Destino");
				return false;
			}
		});	
	   
	   //traslados
	   $("#checkb2").click(function(){ 	
	   	    //var activos=$("input[name^="checkbt"]").is(":checked");	
			if($("#fecha_in").val()!="" && $("#fecha_out").val()!="" && $("#destino").val()!="" && $("#destino2").val()!=""){
				if($("#checkb2").is(":checked")){			 			    
					$.ajax({ /* AJAX. */
						type: "POST", /* Method. */
						url: "traslados.php", /* Transaction URL. */
						data: "id="+$("#destino").val()+"&id2="+$("#destino2").val()+"&f_in="+$("#fecha_in").val()+"&f_out="+$("#fecha_out").val()+""+"&npax="+$("#npax").val()+"", /* Data to send to the URL. */
						/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
						error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
						/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
						success: function(result){$("#checkb2").attr("checked","checked"); $("#div_detal_t").empty();$("#div_detal_t").append(result); $("#div_detal_t").show("slow");} /* Shows the result message. */
					});
					return false;
				}else{
				 $("#div_detal_t").hide("slow");
				}
			}else{
				alert("Verifique que escogió una Fecha de entrada, una Fecha de salida y el Destino");
				return false;
			}
		});	
	   
	    //Hoteles		
	   $("#checkb3").click(function(){ 	
	   	    //var activos=$("input[name^="checkbt"]").is(":checked");	
			if($("#fecha_in").val()!="" && $("#fecha_out").val()!="" && $("#destino").val()!="" && $("#destino2").val()!=""){
				if($("#checkb3").is(":checked")){			 			    
					$.ajax({ /* AJAX. */
						type: "POST", /* Method. */
						url: "hoteles.php", /* Transaction URL. */
						data: "id="+$("#destino").val()+"&id2="+$("#destino2").val()+"&f_in="+$("#fecha_in").val()+"&f_out="+$("#fecha_out").val()+"&npax="+$("#npax").val()+"", /* Data to send to the URL. */
						/* When an error ocurrs [E.G. When the url DOES NOT exists]. */				
						error: function(){ alert("> Ha ocurrido un error en el sistema.\n\nError al conectarse a la Base de Datos. Para resolver este problema contacte a su IT Manager."); },
						/* When the connection file is processed it can bring a result [SUCCESS/ERROR] -> DB Connection. */
						success: function(result){$("#checkb3").attr("checked","checked"); $("#div_detal2").empty();$("#div_detal2").append(result); $("#div_detal2").show("slow");} /* Shows the result message. */
					});
					return false;
				}else{
				 $("#div_detal2").hide("slow");
				}
			}else{
				alert("Verifique que escogió una Fecha de entrada, una Fecha de salida y el Destino");
				return false;
			}
		});
	
	 
	$("#checkbt2").click(function(){ if(this.is(":checked")){ alert($(this).get(0).value);} }); 
	
	
	//enviar 
	$("#boton").click(function(){
		$("#info_cotizacion").empty();
	  
	  	$("#resultado").val(0);
	  
	  	tour="";
	  
	  	$("input:checkbox[name^=checkbt]:checked").each(function(){ 
		//alert("p"+$(this).val()); 
			$("#resultado").val(parseInt($("#resultado").val())+parseInt($(this).val()));
			if($(this).val()!="") tour=$(this).val()+"<br>"+tour;
	  	});
	  
	 	trasl="";
	  
		$("input:checkbox[name^=scheckbt]:checked").each(function(){ 
		//alert("s"+$(this).val()); 
			$("#resultado").val(parseInt($("#resultado").val())+parseInt($(this).val()));
		
			if($(this).val()!="") trasl=$(this).val()+"<br>"+trasl;
		});
	  	    
		f_in = $("#fecha_in").val().split("/");
		f_out = $("#fecha_out").val().split("/");
	  
		var fin=new Date(f_in[2],f_in[0]-1,f_in[1]);
		var fout=new Date(f_out[2],f_out[0]-1,f_out[1]);
	  
		var one_day=1000*60*60*24;
	  
		dias=Math.ceil((fout.getTime()-fin.getTime())/(one_day));
	  
		val=$("input:radio[name=radiob]:checked").val().split("|");
	 /* $("input:radio[name=radiob]:checked").each(function(){ 
		alert("t"+$(this).val()); */
		$("#resultado").val(parseInt($("#resultado").val())+parseInt(val[0]*dias));
	/*	infoh=$(this).val();
	  });*/  
	  
	  //alert($("input:radio[name=radiob]:checked").val());
	  
		infoh=$("input:radio[name=radiob]:checked").val().split("|");
		  
		info="Hotel: "+infoh[1]+"<br>";
		info=info+"Direccion: "+infoh[2]+"<br>";
		info=info+"Categoria: "+infoh[3]+"<br>";
		info=info+"Tipo de Habitación: "+infoh[4]+"<br>";
		info=info+"Tipo de Plan: "+infoh[5]+"<br>";
		info=info+"No. Pasajeros "+$("#npax").val()+"<br>";
		info=info+"Fecha In: "+$("#fecha_in").val()+"<br>";
		info=info+"Fecha Out: "+$("#fecha_out").val()+"<br>";
		info=info+"Número de Noches: "+dias+"<br>";
		info=info+"Traslado(s): "+trasl+"<br>";
		info=info+"Tour(es): "+tour+"<br>";
		info=info+"Valor: "+$("#resultado").val()+" "+infoh[6]+" Por Persona por Noche";
	  
	  	$("#info_cotizacion").append(info);
		if ($("#resultado").val()>0){
			$("#info_cotizacion").hide("slow"); //show("slow");  
	  		$("#info_cotizacion").show("slow"); //show("slow");
		}
	  
	  //alert(dias);
	  
    });	
	//fin_enviar
	
	//fin_p_online	
});



