

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("est").value=document.getElementById('cedos').value;
	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()  {
	document.getElementById('tablaEstados').innerHTML='';
	document.getElementById('tablaEstados').innerHTML='<center><span class="nombre_suc">Espere un momento, por favor..</span><br><br><img src="../imagenes/estructura/ajax-loader.gif"></center>';
	band=false;
	var e = document.getElementById('txtbuscador').value;
	var c = document.getElementById('ciudades').value;
	var zp;

	try{

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

	}catch(err){}

	if (isNaN(zp)){
		zp = 0;
	}
	
	$.post("../calls/_gS.php", {e: ""+e+"",c: ""+c+"",zp: ""+zp+""}, function(data)    {
		numArchivo=data.substring(data.indexOf('+',0)+1,data.length);
		band = true;
		}
		
	);
	//band=true;

}

function gtEdos(){
	var e = document.getElementById('txtbuscador').value;
	$.post("../calls/_gE.php", {e: ""+e+""}, function(data)    {

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

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

		});

}

function gtCitys()  {

	var e = document.getElementById('txtbuscador').value;
	//"#tablaEstados").hide; 
	document.getElementById('tablaEstados').innerHTML='';
	$("#pageNavPosition").hide();
	//alert(document.getElementById('txtbuscador')[1].innerHTML);
	
	switch(e){

		case "0":
			var cadena="";
			cadena+='<select style="width:220px;" name="ciudades" id="ciudades" onchange="States(6,0);">';
			cadena+="<option value = '0'>En la Ciudad...</option>";
			cadena+="</select>";
			document.getElementById('retciudad').innerHTML=cadena;
		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 );

}




