$(document).ready(function(){
	iniciar();
	
	//CODIGO QUE CAMBIA EL MENU DIA TIPICO
	$("#dia_tipico").css({'overflow':'hidden','width':'640px', 'float':'left'});
	$("#verotrodia").live("click",function(){
		SoloEnviar($(this).attr("href"),"",function(con){
			$("#dia_tipico > div").animate({'marginLeft':'700px','opacity':'0'},400,function(){
				$("#dia_tipico").html(con.responseText);
				$("#dia_tipico > div").css({'marginLeft':'-700px'});
				$("#dia_tipico > div").animate({'marginLeft':'0px'},400);
				iniciar();
			});
		});
		return false;
	});
	$("#pagemuestromenu [href=Nuestro-Menu]").attr("href","javascript:history.go(-1)");
	
});
function iniciar(){
	$(".diatiple a").click(function(){
		return false;
	});
	$(".diatiple a").hover(function(){
		$(".diatiple a").removeClass("selected");
		$(this).addClass("selected");
		cl = "."+($(this).attr("rel"));
		$(".diatipri div").hide();
		$(cl).fadeIn("fast");
		return false;
	},function(){
			
	});
//	$("#diatip01").addClass("active");
}
	
	
//Main.js - Gonzalo Zúñiga De-Spirito 2009
function AJAXPOST(Pagina, Variables,Obj, MsjLoad, FuncionListo, FuncionCarga, Conexion){
	if (MsjLoad == null || MsjLoad == false){MsjLoad= MsjTipico;}
	var Conexion = crearXMLHttpRequest();
	Conexion.open("POST",Pagina, true);
	Conexion.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	Conexion.send("ajx=1&"+Variables);
	
	Conexion.onreadystatechange = ProcesarCambioEstado;
		function ProcesarCambioEstado(){
			if (Conexion.readyState == 4){
				if(Obj != false){
					$(Obj).fadeOut("fast",function(){$(Obj).html(Conexion.responseText);});
					$(Obj).fadeIn("normal",function(){
						if (FuncionListo != null && FuncionListo != false){
							x = FuncionListo;
							x(Conexion);
						}else{
							if(typeof(carga_pagina) == "function")carga_pagina();	
						}
					});
				}else{
					if (FuncionListo != null){
						x = FuncionListo;
						x(Conexion);
					}
				}
				
			}else{
				if (FuncionCarga == null){
					//if(Obj != false){Obj.innerHTML = MsjLoad;}
				}else{
					x = FuncionCarga;
					x(Conexion);
				}
			}
		}
	return Conexion;
}

function SoloEnviar(Pagina, Variables, Callback){
	var Conexion = crearXMLHttpRequest();
	if(typeof(Variables) == "undefined")Variables = "";
	Conexion.open("POST",Pagina, true);
	Conexion.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	Conexion.send("ajx=1&"+Variables);
	Conexion.onreadystatechange = function(){
		if(Conexion.readyState == 4){
			if(Callback != null){
				x = Callback;
				x(Conexion);
			}
		}
	}
	return Conexion;
}

function crearXMLHttpRequest(){
  var xmlHttp=null;
  if (window.ActiveXObject) 
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  else 
    if (window.XMLHttpRequest) 
      xmlHttp = new XMLHttpRequest();
  return xmlHttp;
}