function JsInicio(){
	$(document.location).attr("href","index.php")

	
	}
	/////////////////dialog personalizado/////////////////////////////////////////////////////////	
	// Abre un cuadro de dialogo con una carga dinámica (sustituto de jsWindowIt)
	function jsDialogIt(url, id, titulo, ancho, alto, bloquear, cerrar, arrastra, resize){
		//alert(url);
		var dlgId = id || 'ididid';
		ancho = ancho || 600;
		alto = alto || 130;
		titulo = titulo || '';
		bloquear = bloquear===undefined?true:bloquear;
		cerrar = cerrar===undefined?true:cerrar;
		arrastra = arrastra===undefined?true:arrastra;
		resize = resize===undefined?false:resize;
		if ($('#'+dlgId).length == 0) {
			var newDialog = document.createElement('DIV');
			newDialog.id = dlgId;
			$('body').prepend(newDialog);
			$('#'+newDialog.id).html('<div class="loading"><img src="http://apps.iepcjalisco.org.mx/comun/img/loading.gif"><br />Procesando...</div>');
			$('#'+newDialog.id).load(url);
			$('#'+newDialog.id).dialog({
				modal: bloquear,
				width: ancho,
				height: alto,
				closeOnEscape: cerrar,
				draggable: arrastra,
				resizable: resize,
				title: titulo,
				zIndex: 100000000,
				hide: 'fold',
				close: function(){
					$('#'+newDialog.id).remove();
				}
			});
		}
		else {
			$('#'+dlgId).effect('shake',{},50);
		}
	}

/////////////////////termina dialog////////////////////////////////////	


	
	function ValidaFormu(nombre,correo,telefono,comentarios)
	{
			if(nombre.value=='')
					{
						alert("El nombre es obligatorio")
						document. getElementById("nombre").focus()
						 return 1; 
					}
					
			var telefono =document. getElementById("telefono").value;	
			if(!Esnumerito(telefono)){
     		alert("telefono no es un numerico");
			document. getElementById("telefono").focus()
      		return 1;
									}
			
			
			if(correo.value=='')
					{
						alert("El correo es obligatorio")
						document. getElementById("correo").focus()
						 return 1; 
					}
					
			
			
				if(comentarios.value=='')
					{
						alert("Los comentarios son obligatorio")
						document. getElementById("comentarios").focus()
						 return 1; 
					}
					
				
			
			
	}
	
	
function Esnumerito(telefono)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < telefono.length && IsNumber == true; i++) 
      { 
      Char = telefono.charAt( i ); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
}



function SacaCategorias(id_catego){
		var  id_catego=id_catego;
		alert(id_catego);
		var url='todocategorias.php?id_catego='+id_catego;
		$("#res_turismo").hide().load(url,{},function () {
														 $(this).show(500);
												 		});
				}			
					
					
function JsBuscaServicios(destino,categoria){
	var destino =document. getElementById("destino").value;
	var categoria =document. getElementById("categoria").value;
	var url='todoservicios.php?id_catego='+categoria+'&id_destino='+destino;
	alert(url)
		$("#res_turismo").hide().load(url,{},function () {
														 $(this).show(500);
												 		});
	}
	
	
	
////////////////////////////reservaciones/////////////////////////////////////////////////
	function JsReservacion(){		
		
	alert("holas")
	
	}
	
	
	/////////////////////
	
	function validarpromo(){
		
	
		var  promo=document.getElementById("promo").value
		alert(promo);
		var url='validapromo.php?idpromo='+promo;
		$("#repuesta").hide().load(url,{},function () {
														 $(this).show(500);
												 		});
		}
	
		

		//ajax.open("GET", "validapromo.php?idpromo="+promo, true);
//		ajax.onreadystatechange=function() 
//		{ 
//			if (ajax.readyState==1)
//			{
//				// Mientras carga elimino la opcion "Elige pais" y pongo una que dice "Cargando"
//				document.getElementById("estado2").value = "Cargando";
//				
//			}
//			if (ajax.readyState==4)
//			{ 
//				
//				
//						valor = parseInt(ajax.responseText);
//					if(valor==0){
//					
//						
//					document.getElementById("estado2").innerHTML = "<font color='red'>El código no es válido</font><input name='superpromo' type='hidden' id='superpromo' value='0' />";
//					} else {
//						document.getElementById("promo").readonly = true;
//						
//						
//						//////////
//						
//							ajax2=nuevoAjax();
//	
//
//		ajax2.open("GET", "obtenpromos.php?idpromo="+promo, true);
//		ajax2.onreadystatechange=function() 
//		{ 
//			if (ajax2.readyState==1)
//			{
//				// Mientras carga elimino la opcion "Elige pais" y pongo una que dice "Cargando"
//				document.getElementById("estado2").value = "Cargando";
//				
//			}
//			if (ajax2.readyState==4)
//			{ 
//											
//						document.getElementById("estado2").innerHTML = ajax2.responseText;
//				
//			} 
//			
//			
//		}
//		ajax2.send(null);
//						
//						
//						/////////////////
//						
//						
//						
//						
//						
//						
//						
//						
//						document.getElementById("estado2").innerHTML = "<font color=black><b>El código es válido</b></font>";
//						
//					}
//				
//			
//			} 
//			
//			
//		}
//		ajax.send(null);
//	
//	
//	
//}



	