/* Irving Gabriel Estrada Medina */



function MenuNavegacionSuperior()  {

	$.ajax({

		url: "calls/call_MenuNavSuperior.php",

		cache: false,

		success: function(html){

			$("#menu_navegacion_superior").append(html);

		},

		error: function(objeto, quepaso, otroobj){

            alert("Error Obtener Datos");

        }

	});

}

function Go(p,s){
	document.getElementById("st").value=p;
	document.getElementById("p").value=s;
	var cadena = document.getElementById("form").action;
	var protocolo = window.location.protocol;
	var ruta = window.location.pathname;
	protocolo = protocolo.replace("https", "http");
	ruta = ruta.replace("index2.php", "index.php");
	var newURL = protocolo + "//" + window.location.host + ruta;
	document.getElementById("form").action = newURL;
	document.getElementById("form").submit();
}





function gtPF()  {

	var t = document.getElementById('cmbtema').value;

	switch(t){

		case "0":

		break;

		default:

				document.getElementById('preguntas').innerHTML="<div width='100%' height='100%' align='center' valign='middle'><img src='images/btns/loading.gif'></div>";

				$.post("calls/_pf.php", {t: ""+t+""}, function(data)    {

					document.getElementById('preguntas').innerHTML="";

					$("#preguntas").append(data); 

				}

			);

		break;

	}

}



function gtS()  {

	var e = document.getElementById('estados').value;

	var c = document.getElementById('ciudades').value;

	var zp;

	

	try{

		zp= document.getElementById('cp').value;

	}catch(err){}



	if (isNaN(zp)){

		zp = 0;

	}

	document.getElementById('retListado1').innerHTML="<div width='100%' height='100%' align='center' valign='middle'><img src='images/btns/loading.gif'></div>";

	$.post("calls/_gS.php", {e: ""+e+"",c: ""+c+"",zp: ""+zp+""}, function(data)    {

			document.getElementById('retListado1').innerHTML="";

			$("#retListado1").append(data); 

		}

	);

}



function gtCitys()  {

	var e = document.getElementById('estados').value;

	switch(e){

		case "0":

		break;

		default:

				$.post("calls/_cts.php", {e: ""+e+""}, function(data)    {

					document.getElementById('retciudad').innerHTML="";

					$("#retciudad").append(data); 

				}

			);

		break;

	}

}



function ToUrl(u)  {

	location.href=u;

}



function States(p,s){

	document.getElementById("st").value=p;

	document.getElementById("p").value=document.getElementById("cestados").value;

	document.getElementById("form").submit();

}



function gtHA()  {

	var t = document.getElementById("p").value;

	$.post("calls/_HA.php", {t: ""+t+""}, 

		function(data)    {

			var d = data.split("|");
			switch(d[0]){

				case "1":

					abreSesion(parseInt(d[1]), d[2]);

				break;

				default:

					ventana("Banca en Linea",9);

				break;

			}

		}

	);



}



function ventana(msj,op){

	var page ='';

	var configuration='toolbar=0,scrollbars=0,location=0,status=0,menubars=0,resizable=0,width=442,height=275';

	if (op==0){

		page = 'http://www.coppel.com';

	}else{

		page = 'calls/_HAM.php';

	}

	imageWindow=window.open (page,'windowname',configuration );

}



