
var RutaBase = 'index.asp?intSec=1'
var strClaveGenActiva = "";

function A_ProcesaClaveGen(intSitio, strClave)
{
	//alert(intSitio);
	strClaveGenActiva = strClave;
	location.href = RutaBase + '&SedId=AUTOSNUEVOS&ClaveGen=' + strClave;
	//alert(RutaBase + '&SedId=AUTOSNUEVOS&ClaveGen=' + strClave);
}

var ajxMan = null;
var objSWFCol = null, objSWFGal = null;
var intRadWindowTimeOut = 0;
function A_ProcesaClave(strClave) {
    if(intRadWindowTimeOut!=0) clearTimeout(intRadWindowTimeOut);
	switch (strClave) {
		case "CORP_COTIZA":
			location.href = RutaBase + '&SedId=MAPA_COT';
			/*
			if(typeof(intDisID)!="undefined" && intDisID!=0)
				location.href = strURLDisCot;
			else
				//A_AbreVentanaLayer(strURLDistCotHome, 780, 480, '');
				location.href = RutaBase + '&SedId=COTIZADOR&ClaveGen=' + strClave;
			*/
			break;
		case "CORP_SERV":
				location.href = RutaBase + '&SedId=MAPA_CITAS';
				//location.href = RutaBase + '&SedId=SERVICIO&ClaveGen=' + strClave;
			break;
		case "CORP_PRBMAN":
				location.href = RutaBase + '&SedId=MAPA_PRBMAN';
				//location.href = RutaBase + '&SedId=PRUEBAMAN&ClaveGen=' + strClave;
			break;
		case "MAPA":
			location.href = RutaBase + '&SedId=' + strClave;
			break;
		case "FINANCIAMIENTO":
			location.href = RutaBase + '&SedId=MAPA_FIN';
			//location.href = RutaBase + '&SedId=' + strClave;
			break;
		case "POLITICAS":
			location.href = RutaBase + '&SedId=' + strClave;
			break;
		case "LEGALES":
			location.href = RutaBase + '&SedId=' + strClave;
			break;
		case "PROMOS_ANUEVOS":
			location.href = RutaBase + '&SedId=' + strClave;
			break;
		//JCV se agregan casos para hipermacroventa agosto 2010
		case "PROMO1":
			location.href = RutaBase + '&SedId=' + strClave;
			break;
		case "PROMO2":
			location.href = RutaBase + '&SedId=' + strClave;
			break;

		case "CONTACTO":
			location.href = RutaBase + '&SedId=' + strClave;
			break;
		case "NUEVOS":
			location.href = RutaBase + '&SedId=' + strClave;
			//location.href = "index.asp";
			break;
		case "SEMINUEVOS":
			location.href = RutaBase + '&SedId=' + strClave;
			break;
		case "LANZA_ANUEVOS":
			location.href = RutaBase + '&SedId=' + strClave;
			break;
	}
}

function A_RedireccionaHoja(strLiga, intH) {
    var bolNoUsarTop =false;
    if(strLiga.indexOf("?")<0) strLiga += "?";
    if(typeof(strOrg)!="undefined" && strOrg!="") strLiga += ("&strOrg=" + strOrg);
    if(typeof(intDisID)!="undefined" && intDisID!=0) strLiga += ("&disID=" + intDisID);
    if(typeof(strXml)!="undefined" && strXml!="") strLiga += ("&strXml=" + strXml);
    strLiga = "hoja.aspx?strHoja=" + escape(strLiga);
    if (intH != undefined) strLiga += ("&intH=" + intH);
    //
    if(typeof(strOrg)!="undefined" && strOrg!="") { strLiga += ("&strOrg=" + strOrg); bolNoUsarTop = true;}
    if(typeof(intDisID)!="undefined" && intDisID!=0) strLiga += ("&disID=" + intDisID);
    if(typeof(strXml)!="undefined" && strXml!="") strLiga += ("&strXml=" + strXml);
    ///
    (bolNoUsarTop?this:top).location.href = strLiga;
}

function A_AbreVentana(strLiga, intAncho, intAlto, strAttrs) {
    var strAtributos = "";
    if (intAncho != undefined) strAtributos += ("width=" + intAncho + ", height=" + intAlto);
    if (strAttrs != undefined) strAtributos += strAttrs;
    var intWndID = window.open(strLiga, "", "scrollbars=1,"+strAtributos);
    if(intWndID!=null) intWndID.focus();
}

function A_AbreVentanaLayer(strLiga) {
	var intAncho, intAlto;
    if(intRadWindowTimeOut!=0) clearTimeout(intRadWindowTimeOut);
	A_ProcesaClave('LIMPIA');
    if(typeof(A_AbreVentanaLayer.arguments[1])=="undefined") intAncho = 0; else intAncho = A_AbreVentanaLayer.arguments[1];
    if(typeof(A_AbreVentanaLayer.arguments[2])=="undefined") intAlto = 0; else intAlto = A_AbreVentanaLayer.arguments[2];
	if(typeof(window.radopen)!="undefined")
	{
		try { 
			var winV = window.radopen(strLiga, "winCoum");
			if(winV!=null) {
				if(intAncho>0) winV.set_width(intAncho);
				if(intAlto>0) winV.set_height(intAlto);
				if(intAncho>0 || intAlto>0) winV.center();
			}
		}
		catch(e) { intRadWindowTimeOut = setTimeout("A_AbreVentanaLayer('" + strLiga +"', " + intAncho + ", " + intAlto + ");", 200); }
	}
    else
        A_AbreVentana(strLiga, intAncho, intAlto);
}