// Funcion generica para abrir ventanas
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, "", strAtributos);
	if(intWndID!=null) intWndID.focus();
}

// Funcion generica para navegacion
function A_ProcesaClave(strClave){
	switch (strClave){
		case "PAIS":
			strLiga = "paises.asp"
			location.href = strLiga;
		break;
		case "IGREEN_ES":
			strLiga = "http://www.interceramicgreen.com/MEX"
			var intVentana = window.open(strLiga);
			intVentana.focus();
		break;
		case "IGREEN_IN":
			strLiga = "http://www.interceramicgreen.com/USA"
			var intVentana = window.open(strLiga);
			intVentana.focus();
		break;
	}
}

//* 100419 JCV - Se agrega funcion para procesar ligas y abrir ventanas de Decorador DIGITAL*/
function A_ProcesaLigaDecDigital(intLen){
	//alert("Voy a decorador digital en idioma = "+intLen);
	if (intLen == 1){
		strLiga = "http://www.interceramic.degha.com/deghaweb/deghamlweb.htm?Idioma=0&lbhb=1";
		A_AbreVentana(strLiga, 810, 690);
	}
	else
		strLiga = "http://www.interceramicusa.degha.com/deghaweb/deghamlweb.php?Idioma=1&lbhb=1";
		A_AbreVentana(strLiga, 810, 690);
}

//* 100420 JCV - Se agrega funcion para procesar ligas y abrir ventanas de Decorador VIRTUAL*/
//* 100506 JCV - Se cambia funcion y se actualizan ligas de acuerdo a email recibido */
function A_ProcesaLigasDecVirtual(strPais, strTipo, intNumLiga){
	//alert("Pais = "+strPais+" | Tipo = "+strTipo+" | Numero liga = "+intNumLiga);
	if (strPais == "MEX")
		A_ProcesaLigasMEX(strTipo, intNumLiga);
	else
		A_ProcesaLigasUSA(strTipo, intNumLiga);
}

function A_ProcesaLigasMEX(strTipo, intNumLiga){
	//alert("estoy en MEX");
	switch (strTipo){
		case "HOG_COL":
			var strLigaBase = "http://www.webvdecor.com/clientsites/rlogin.asp?CatID=7&amp;Lang=es&amp;RUserID=1&amp;Prog=2&amp;FileName=%25custom%25interceramic_std/Project%20Templates/Designer%20Rooms/";
			var Proyecto = new Array (
			/*posicion 0*/"Bano%20Principal-17.v2t",
			/*posicion 1*/"Bano%20Principal-80.v2t",
			/*posicion 2*/"Medio%20Bano.v2t",
			/*posicion 3*/"Bano%20Rec%20Principal%2073-80.v2t",
			/*posicion 4*/"Sala%20Comedor%20Entrada.v2t",
			/*posicion 5*/"Decorado%20Muro%20Sala%20-%20Comedor.v2t",
			/*posicion 6*/"Cocina.v2t",
			/*posicion 7*/"Fachada.v2t"
			);
			//alert(Proyecto[intNumLiga-1]);
			var strLiga = strLigaBase + Proyecto[intNumLiga-1];
			A_AbreVentana(strLiga);
		break;
		case "HOG_PLA":
			var strLigaBase = "http://www.webvdecor.com/clientsites/rlogin.asp?CatID=7&amp;Lang=es&amp;RUserID=1&amp;Prog=1&amp;FileName=%25custom%25virtualdecor/data/Project%20Templates/general/";
			var strLigaProyecto5 = "http://www.webvdecor.com/clientsites/rlogin.asp?CatID=7&amp;Lang=es&amp;RUserID=1";
			var Proyecto = new Array (
			/*posicion 0*/"Rectangular%20Plan.v2t",
			/*posicion 1*/"L%20Plan.v2t",
			/*posicion 2*/"Double%20Square.v2t",
			/*posicion 3*/"U%20Plan.v2t",
			/*posicion 4*/""
			);
			//alert("Num Liga = "+intNumLiga + " | Proyecto = " + Proyecto [intNumLiga-1]);
			if (intNumLiga == 5){ 
				A_AbreVentana(strLigaProyecto5);
			}
			else {
				var strLiga = strLigaBase + Proyecto[intNumLiga-1];
				A_AbreVentana(strLiga);
			}
		break;
		case "PRO":
			var strLiga = "http://www.webvdecor.com/clientsites/rlogin.asp?CatID=23&amp;Lang=es&amp;RUserID=2";
			A_AbreVentana(strLiga);
		break;
	}
}
function A_ProcesaLigasUSA(strTipo, intNumLiga){
	//alert("estoy en USA");
	switch (strTipo){
		case "HOG_COL":
			var strLigaBase = "http://www.webvdecor.com/clientsites/rlogin.asp?CatID=60&amp;Lang=uk&amp;RUserID=3&amp;Prog=2&amp;FileName=%25custom%25interceramic_std/Project%20Templates/Designer%20Rooms/";
			var Proyecto = new Array (
			/*posicion 0*/"Bano%20Principal-17.v2t",
			/*posicion 1*/"Bano%20Principal-80.v2t",
			/*posicion 2*/"Medio%20Bano.v2t",
			/*posicion 3*/"Bano%20Rec%20Principal%2073-80.v2t",
			/*posicion 4*/"Sala%20Comedor%20Entrada.v2t",
			/*posicion 5*/"Decorado%20Muro%20Sala%20-%20Comedor.v2t",
			/*posicion 6*/"Cocina.v2t",
			/*posicion 7*/"Fachada.v2t"
			);
			//alert(Proyecto[intNumLiga-1]);
			var strLiga = strLigaBase + Proyecto[intNumLiga-1];
			A_AbreVentana(strLiga);
		break;
		case "HOG_PLA":
			var strLigaBase = "http://www.webvdecor.com/clientsites/rlogin.asp?CatID=60&amp;Lang=uk&amp;RUserID=3&amp;Prog=1&amp;FileName=%25custom%25virtualdecor/data/Project%20Templates/general/";
			var strLigaProyecto5 = "http://www.webvdecor.com/clientsites/rlogin.asp?CatID=60&amp;Lang=uk&amp;RUserID=3";
			var Proyecto = new Array (
			/*posicion 0*/"Rectangular%20Plan.v2t",
			/*posicion 1*/"L%20Plan.v2t",
			/*posicion 2*/"Double%20Square.v2t",
			/*posicion 3*/"U%20Plan.v2t",
			/*posicion 4*/""
			);
			//alert("Num Liga = "+intNumLiga + " | Proyecto = " + Proyecto [intNumLiga-1]);
			if (intNumLiga == 5){ 
				A_AbreVentana(strLigaProyecto5);
			}
			else {
				var strLiga = strLigaBase + Proyecto[intNumLiga-1];
				A_AbreVentana(strLiga);
			}
		break;
		case "PRO":
			var strLiga = "http://www.webvdecor.com/clientsites/rlogin.asp?CatID=58&amp;Lang=uk&amp;RUserID=4";
			A_AbreVentana(strLiga);
		break;
	}
}

// 100507 JCV - Funcion para mostrar mapas de tiendas
function A_ProcesaMapa(strLiga){
	//alert(strLiga);
	//A_AbreVentana(strLiga,  500, 500);
	var IntVent = window.open(strLiga,"mapatiendas","menubar=0,toolbar=0,location=0,status=0,resizable=0,titlebar=0,width=604,height=454")
	IntVent.focus();
}
