var xmlHttpPopUp;
var xmlHttpPGrande;
var xmlHttpPChicos;
var xmlHttpProductos;
var xmlHttpProductoDetalle;
var xmlHttpProductoPaleta;
var xmlHttpMenu;

var cPageActualProductos = 1;

function fncReplaceBR( cValue )
{
	if ( cValue != "" )
	{
		var cBR10 = String.fromCharCode(10);
		var cBR13 = String.fromCharCode(13);
	
		if ( cValue.indexOf("\n") > -1 || cValue.indexOf(cBR10) > -1 || cValue.indexOf(cBR13) > -1 )
		{
			cValue = cValue.replace("\n", "<br>");
			cValue = cValue.replace(cBR10, "<br>");
			cValue = cValue.replace(cBR13, "<br>");
		}
	}
	
	return cValue;
}

function fncValidaCaracter(src)
{
	var strTemp = "";
	
	if ( src.value == "" )
		strTemp = 0;
	
	for ( var i = 0; i < src.value.length; i++ )
		if ( fncSoloNumeros( src.value.substring(i, i + 1) ) == true )
			strTemp += src.value.substring(i, i + 1);
	
	src.value = strTemp;
}

function fncSoloNumeros(src)
{
	if ( src == "0" || src == "1" || src == "2" || src == "3" || src == "4" || src == "5" || src == "6" || src == "7" || src == "8" || src == "9" )
		return true;
	else
		return false;
}

function CheckNumericKeyInfo( schar, mozChar )
{
	if ( mozChar != null )
	{
		if ( ( mozChar >= 48 && mozChar <= 57 ) || mozChar == 0 || schar == 8 || mozChar == 13)
			RetVal = true;
		else
		{
			RetVal = false;
			alert("Please enter a numeric value.");
		}
	}
	else
	{
		if ( ( schar >= 48 && schar <= 57 ) || schar == 13 )
			RetVal = true;
		else
		{
			RetVal = false;
			alert("Please enter a numeric value.");
		}
	}
													
	return RetVal;
}

function fncAbreVentana(src, width, height)
{
	var intLeft = window.screen.availWidth / 2 - width / 2;
	var intTop = window.screen.availHeight / 2 - height / 2;
	
	window.open( src, "WinSecciones", "width=" + width + ", height=" + height + ", top=" + intTop + ", left=" + intLeft + ", toolbar=0, location=0, directories=0, status=0, menuBar=0, scrollBars=1, resizable=0");
}

function fncAbrePopUpDiv(cIdSeccion, cIdIdioma, cWidth, cHeight, cTitulo)
{
	xmlHttpPopUp = GetXmlHttpObject();
	
	if ( xmlHttpPopUp == null )
	{
		alert (cAJAXNoValido);
		return;
	}
	
	var cUrl = "axPopUp.asp" + 
		"?" + 
		"ID_Idioma=" + cIdIdioma + 
		"&" + 
		"ID_Seccion=" + cIdSeccion + 
		"&" + 
		"cIdRandom=" + Math.random();
	
	xmlHttpPopUp.onreadystatechange = fncPopUpAJAX;
	xmlHttpPopUp.open("GET", cUrl, true);
	xmlHttpPopUp.send(null);
	
	if ( document.getElementById("tablePopUpInterno") )
	{
		document.getElementById("tablePopUpInterno").style.width = cWidth + "px";
		document.getElementById("tablePopUpInterno").style.height = cHeight + "px";
		
		if ( document.getElementById("tdTituloPopUp") )
			document.getElementById("tdTituloPopUp").innerHTML = cTitulo;
		
		fncAcomodaPopUpDiv();
	}
	
	if ( document.getElementById("divPopUp") )
		document.getElementById("divPopUp").style.display = "";
	
	if ( document.getElementById("divPopUpInterno") )
		document.getElementById("divPopUpInterno").style.display = "";
}

function fncPopUpAJAX()
{
	if (xmlHttpPopUp.readyState == 4)
	{
		if (xmlHttpPopUp.status == 200)
		{
			if ( xmlHttpPopUp.responseText != "ERROR" )
				document.getElementById("divPopUpHTML").innerHTML = xmlHttpPopUp.responseText;
			else
			{
				document.getElementById("tablePopUpInterno").style.width = "164px";
				document.getElementById("tablePopUpInterno").style.height = "94px";
				
				fncAcomodaPopUpDiv();
				
				document.getElementById("divPopUpHTML").innerHTML = "<br><span class='CError'>Ocurrio un error al cargar la sección</span>";
			}
		}
		else
		{
			document.getElementById("tablePopUpInterno").style.width = "164px";
			document.getElementById("tablePopUpInterno").style.height = "94px";
			
			fncAcomodaPopUpDiv();
			
			document.getElementById("divPopUpHTML").innerHTML = "<br><span class='CError'>Ocurrio un error al cargar la sección</span>";
		}
	}
}

function fncCargaProductosRecomendados(cImgPath, cIdIdioma, cIdCategoria, cIdProducto, cTxtBusqueda, cIdPage)
{
	if ( document.getElementById("divMuestraProductosRecomendados") )
	{
		document.getElementById("divMuestraProductosRecomendados").innerHTML = "<table border='0' cellspacing='0' cellpadding='0' width='100%'><tr><td align='center'><img src='" + cImgPath + "img/iCargandoGde.gif' width='66' height='66' border='0' /></td></tr></table>"
		
		xmlHttpProductos = GetXmlHttpObject();
		
		if ( xmlHttpProductos == null )
		{
			alert (cAJAXNoValido);
			return;
		}
		var cUrl = "axCargaProductosXML.asp" + 
			"?" + 
			"ID_Idioma=" + cIdIdioma + 
			"&" + 
			"ID_Categoria=" + cIdCategoria + 
			"&" + 
			"ID_Producto=" + cIdProducto + 
			"&" + 
			"cTxtBusqueda=" + cTxtBusqueda + 
			"&" + 
			"ID_Page=" + cIdPage + 
			"&" + 
			"cIdRandom=" + Math.random();
		xmlHttpProductos.onreadystatechange = fncCargaProductosRecomendadosXMLAJAX;
		xmlHttpProductos.open("GET", cUrl, true);
		xmlHttpProductos.send(null);
	}
}

function fncCargaProductosRecomendadosXMLAJAX()
{
	if (xmlHttpProductos.readyState == 4)
	{
		if (xmlHttpProductos.status == 200)
		{
			if ( xmlHttpProductos.responseXML.documentElement != null )
			{
				var cHTMLDiv = "";
				var cXMLResponse = xmlHttpProductos.responseXML.documentElement;
				
				if ( cXMLResponse.getElementsByTagName("cError")[0].childNodes[0].nodeValue == "0" )
				{
					cHTMLDiv = cHTMLDiv + 
						"<table border=\"0\" bordercolor=\"red\" cellspacing=\"0\" cellpadding=\"0\" width=\"539\">" + 
						"";
					
					var cRowCountChicos = 2;
					var bPrimerRegistro = true;
					var cConteoActual = cRowCountChicos;
					var cMaxConteo = 1;
					
					var cX = 0;
					while ( cX < cXMLResponse.getElementsByTagName("cProductos").length )
					{
						if ( cConteoActual == cRowCountChicos )
						{
							cConteoActual = 0;
							if ( bPrimerRegistro == false )
							{
								cHTMLDiv = cHTMLDiv + 
									"</tr>" + 
									"<tr>" + 
										"<td colspan=\"3\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"15\" border=\"0\" /></td>" + 
									"</tr>" + 
									"";
							}
							else
							{
								bPrimerRegistro = false;
							}
							
							cHTMLDiv = cHTMLDiv + 
								"<tr>" + 
								"";
						}
						else if ( cConteoActual > 0 )
						{
							cHTMLDiv = cHTMLDiv + 
								"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"19\" height=\"1\" border=\"0\" /></td>" + 
								"";
						}
						
						cHTMLDiv = cHTMLDiv + 
							"<td width=\"260\" align=\"center\" valign=\"top\" height=\"100%\">" + 
							"";
						
						cHTMLDiv = cHTMLDiv + 
							"<table border=\"0\" bordercolor=\"red\" cellspacing=\"0\" cellpadding=\"0\" width=\"260\" height=\"100%\">" + 
								"<tr>" + 
									"<td valign=\"top\">" + 
										"<table class=\"CProdOver\" border=\"0\" bordercolor=\"red\" cellspacing=\"0\" cellpadding=\"0\" width=\"135\" height=\"100%\" onclick=\"javascript:fncInteriorRecomendado(" + cXMLResponse.getElementsByTagName("cProductos")[cX].childNodes[0].childNodes[0].nodeValue + ", " + cXMLResponse.getElementsByTagName("cProductos")[cX].childNodes[1].childNodes[0].nodeValue + ", " + cXMLResponse.getElementsByTagName("cIdioma")[0].childNodes[0].nodeValue + ", '" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "');\">" + 
											"<tr bgcolor=\"#a6a6a6\">" + 
												"<td>" + 
													"<table border=\"0\" bordercolor=\"red\" cellspacing=\"0\" cellpadding=\"0\" width=\"135\" height=\"100%\">" + 
														"<tr>" + 
															"<td valign=\"top\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iProdIzq.png\" width=\"30\" height=\"30\" border=\"0\" /></td>" + 
															"<td width=\"100%\" class=\"CProdNombreProductoChi\" align=\"center\">" + cXMLResponse.getElementsByTagName("cProductos")[cX].childNodes[2].childNodes[0].nodeValue + "</td>" + 
															"<td valign=\"top\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iProdDer.png\" width=\"30\" height=\"30\" border=\"0\" /></td>" + 
														"</tr>" + 
													"</table>" + 
												"</td>" + 
											"</tr>" + 
											"<tr height=\"100%\">" + 
												"<td>" + 
													"<table border=\"0\" bordercolor=\"green\" cellspacing=\"0\" cellpadding=\"0\" width=\"135\" height=\"100%\" background=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iFondoImg.jpg\">" + 
														"<tr height=\"100%\">" + 
															"<td background=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iMarcoBID.png\" style=\"background-position: top left;background-repeat: repeat-y;\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"1\" border=\"0\" /></td>" + 
															"<td width=\"100%\">" + 
																"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"91\" height=\"100%\">" + 
																	"<tr>" + 
																		"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"15\" border=\"0\" /></td>" + 
																	"</tr>" + 
																	"<tr>" + 
																		"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/" + cXMLResponse.getElementsByTagName("cProductos")[cX].childNodes[3].childNodes[0].nodeValue + "\" alt=\"" + cXMLResponse.getElementsByTagName("cProductos")[cX].childNodes[1].childNodes[0].nodeValue + "\" width=\"91\" height=\"114\" border=\"0\" onmousedown=\"javascript:DarClick(this, '2004-" + cXMLResponse.getElementsByTagName("cAnio")[0].childNodes[0].nodeValue + "');\"></td>" + 
																	"</tr>" + 
																	"<tr height=\"100%\">" + 
																		"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"1\" border=\"0\" /></td>" + 
																	"</tr>" + 
																"</table>" + 
															"</td>" + 
															"<td background=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iMarcoBID.png\" style=\"background-position: top right;background-repeat: repeat-y;\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"1\" border=\"0\" /></td>" + 
														"</tr>" + 
														"<tr>" + 
															"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iMarcoAEII.png\" width=\"22\" height=\"22\" border=\"0\" /></td>" + 
															"<td width=\"100%\" background=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iMarcoBSI.png\" style=\"background-position: bottom center;background-repeat: repeat-x;\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"1\" border=\"0\" /></td>" + 
															"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iMarcoAEID.png\" width=\"22\" height=\"22\" border=\"0\" /></td>" + 
														"</tr>" + 
													"</table>" + 
												"</td>" + 
											"</tr>" + 
										"</table>" + 
									"</td>" + 
									"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"5\" height=\"1\" border=\"0\" /></td>" + 
									"<td width=\"100%\" valign=\"top\" class=\"CProdRecomiendaDescripcion\">" + 
										fncReplaceBR(cXMLResponse.getElementsByTagName("cProductos")[cX].childNodes[4].childNodes[0].nodeValue) + 
									"</td>" + 
								"</tr>" + 
							"</table>";
						
						cHTMLDiv = cHTMLDiv + 
							"</td>" + 
							"";
						
						cMaxConteo = cMaxConteo + 1;
						cConteoActual = cConteoActual + 1;
						
						cX = cX + 1;
					}
					
					while ( cConteoActual != cRowCountChicos )
					{
						cHTMLDiv = cHTMLDiv + 
							"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"5\" height=\"1\" border=\"0\" /></td>" + 
							"<td width=\"260\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"1\" border=\"0\" /></td>" + 
							"";
						
						cConteoActual = cConteoActual + 1;
					}
					
					cHTMLDiv = cHTMLDiv + 
							"</tr>" + 
							"<tr>" + 
								"<td colspan=\"3\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"20\" border=\"0\" /></td>" + 
							"</tr>" + 
							"<tr>" + 
								"<td colspan=\"3\" align=\"center\" class=\"CNavRegresar\">[ <a href=\"javascript:" + 
									"fncMenuCargaProductos('" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "', " + cXMLResponse.getElementsByTagName("cIdioma")[0].childNodes[0].nodeValue + ", " + cXMLResponse.getElementsByTagName("cIdCategoria")[0].childNodes[0].nodeValue + ", 0, '', " + cXMLResponse.getElementsByTagName("cIdPage")[0].childNodes[0].nodeValue + ")" + 
								";\" class=\"CNavRegresar\">Regresar</a> ]</td>" + 
							"</tr>" + 
						"</table>" + 
						"";
					
					if ( document.getElementById("divMuestraProductosRecomendados") )
						document.getElementById("divMuestraProductosRecomendados").innerHTML = cHTMLDiv;
				}
				else
				{
					if ( document.getElementById("divMuestraProductosRecomendados") )
						document.getElementById("divMuestraProductosRecomendados").innerHTML = "<span class='CError'>Ocurrio un error al cargar los productos - err1</span>";
				}
			}
			else
			{
				if ( document.getElementById("divMuestraProductosRecomendados") )
					document.getElementById("divMuestraProductosRecomendados").innerHTML = "<span class='CError'>Ocurrio un error al cargar los productos - err2</span>";
			}
		}
		else
		{
			if ( document.getElementById("divMuestraProductosRecomendados") )
				document.getElementById("divMuestraProductosRecomendados").innerHTML = "<span class='CError'>Ocurrio un error al cargar los productos - err3</span>";
		}
	}
}

function fncCargaProductos(cImgPath, cIdIdioma, cIdCategoria, cIdProducto, cTxtBusqueda, cIdPage)
{
	if ( document.getElementById("divMuestraProductos") )
	{
		document.getElementById("divMuestraProductos").innerHTML = "<table border='0' cellspacing='0' cellpadding='0' width='100%'><tr><td align='center'><img src='" + cImgPath + "img/iCargandoGde.gif' width='66' height='66' border='0' /></td></tr></table>"
		
		xmlHttpProductos = GetXmlHttpObject();
		
		if ( xmlHttpProductos == null )
		{
			alert (cAJAXNoValido);
			return;
		}
		
		var cUrl = "axCargaProductosXML.asp" + 
			"?" + 
			"ID_Idioma=" + cIdIdioma + 
			"&" + 
			"ID_Categoria=" + cIdCategoria + 
			"&" + 
			"ID_Producto=" + cIdProducto + 
			"&" + 
			"cTxtBusqueda=" + cTxtBusqueda + 
			"&" + 
			"ID_Page=" + cIdPage + 
			"&" + 
			"cIdRandom=" + Math.random();
		
		xmlHttpProductos.onreadystatechange = fncCargaProductosXMLAJAX;
		xmlHttpProductos.open("GET", cUrl, true);
		xmlHttpProductos.send(null);
	}
}

function fncCargaProductosXMLAJAX()
{
	if (xmlHttpProductos.readyState == 4)
	{
		if (xmlHttpProductos.status == 200)
		{
			if ( xmlHttpProductos.responseXML.documentElement != null )
			{
				var cHTMLDiv = "";
				var cXMLResponse = xmlHttpProductos.responseXML.documentElement;
				
				if ( cXMLResponse.getElementsByTagName("cError")[0].childNodes[0].nodeValue == "0" )
				{
					cHTMLDiv = cHTMLDiv + 
						"<table border=\"0\" bordercolor=\"red\" cellspacing=\"0\" cellpadding=\"0\" width=\"539\">" + 
						"";
					
					if ( cXMLResponse.getElementsByTagName("bMuestraPag")[0].childNodes[0].nodeValue == "1" && Number(cXMLResponse.getElementsByTagName("cTotalPage")[0].childNodes[0].nodeValue) > 1 )
					{
						cHTMLDiv = cHTMLDiv + 
							"<tr id=\"trPaginacionProductos\">" + 
								"<td colspan=\"5\" align=\"right\"><div id=\"divPaginacionProductos\" class=\"CDivPaginacionPChicos\"></div></td>" + 
							"</tr>" + 
							"";
					}
					
					var cRowCountChicos = Number(cXMLResponse.getElementsByTagName("cRowCountChicos")[0].childNodes[0].nodeValue);
					var bPrimerRegistro = true;
					var cConteoActual = cRowCountChicos;
					var cMaxConteo = 1;
					
					var cX = 0;
					while ( cX < cXMLResponse.getElementsByTagName("cProductos").length )
					{
						if ( cConteoActual == cRowCountChicos )
						{
							cConteoActual = 0;
							if ( bPrimerRegistro == false )
							{
								cHTMLDiv = cHTMLDiv + 
									"</tr>" + 
									"<tr>" + 
										"<td colspan=\"5\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"15\" border=\"0\" /></td>" + 
									"</tr>" + 
									"";
							}
							else
							{
								bPrimerRegistro = false;
							}
							
							cHTMLDiv = cHTMLDiv + 
								"<tr>" + 
								"";
						}
						else if ( cConteoActual > 0 )
						{
							cHTMLDiv = cHTMLDiv + 
								"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"5\" height=\"1\" border=\"0\" /></td>" + 
								"";
						}
						
						cHTMLDiv = cHTMLDiv + 
							"<td width=\"175\" align=\"center\" valign=\"top\" height=\"100%\">" + 
							"";
						
						cHTMLDiv = cHTMLDiv + 
							"<table class=\"CProdOver\" border=\"0\" bordercolor=\"red\" cellspacing=\"0\" cellpadding=\"0\" width=\"175\" height=\"100%\" onclick=\"javascript:fncInterior(" + cXMLResponse.getElementsByTagName("cProductos")[cX].childNodes[0].childNodes[0].nodeValue + ", " + cXMLResponse.getElementsByTagName("cProductos")[cX].childNodes[1].childNodes[0].nodeValue + ");\">" + 
								"<tr bgcolor=\"#a6a6a6\">" + 
									"<td>" + 
										"<table border=\"0\" bordercolor=\"red\" cellspacing=\"0\" cellpadding=\"0\" width=\"175\" height=\"100%\">" + 
											"<tr>" + 
												"<td valign=\"top\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iProdIzq.png\" width=\"30\" height=\"30\" border=\"0\" /></td>" + 
												"<td width=\"100%\" class=\"CProdNombreProducto\" align=\"center\">" + cXMLResponse.getElementsByTagName("cProductos")[cX].childNodes[2].childNodes[0].nodeValue + "</td>" + 
												"<td valign=\"top\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iProdDer.png\" width=\"30\" height=\"30\" border=\"0\" /></td>" + 
											"</tr>" + 
										"</table>" + 
									"</td>" + 
								"</tr>" + 
								"<tr height=\"100%\">" + 
									"<td>" + 
										"<table border=\"0\" bordercolor=\"red\" cellspacing=\"0\" cellpadding=\"0\" width=\"175\" height=\"100%\" background=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iFondoImg.jpg\">" + 
											"<tr height=\"100%\">" + 
												"<td background=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iMarcoBID.png\" style=\"background-position: top left;background-repeat: repeat-y;\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"1\" border=\"0\" /></td>" + 
												"<td width=\"100%\">" + 
													"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"131\" height=\"100%\">" + 
														"<tr>" + 
															"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"15\" border=\"0\" /></td>" + 
														"</tr>" + 
														"<tr>" + 
															"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/" + cXMLResponse.getElementsByTagName("cProductos")[cX].childNodes[3].childNodes[0].nodeValue + "\" alt=\"" + cXMLResponse.getElementsByTagName("cProductos")[cX].childNodes[1].childNodes[0].nodeValue + "\" width=\"131\" height=\"164\" border=\"0\" onmousedown=\"javascript:DarClick(this, '2004-" + cXMLResponse.getElementsByTagName("cAnio")[0].childNodes[0].nodeValue + "');\"></td>" + 
														"</tr>" + 
														"<tr height=\"100%\">" + 
															"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"1\" border=\"0\" /></td>" + 
														"</tr>" + 
													"</table>" + 
												"</td>" + 
												"<td background=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iMarcoBID.png\" style=\"background-position: top right;background-repeat: repeat-y;\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"1\" border=\"0\" /></td>" + 
											"</tr>" + 
											"<tr>" + 
												"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iMarcoAEII.png\" width=\"22\" height=\"22\" border=\"0\" /></td>" + 
												"<td width=\"100%\" background=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iMarcoBSI.png\" style=\"background-position: bottom center;background-repeat: repeat-x;\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"1\" border=\"0\" /></td>" + 
												"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/iMarcoAEID.png\" width=\"22\" height=\"22\" border=\"0\" /></td>" + 
											"</tr>" + 
										"</table>" + 
									"</td>" + 
								"</tr>" + 
							"</table>" + 
							"";
						
						cHTMLDiv = cHTMLDiv + 
							"</td>" + 
							"";
						
						cMaxConteo = cMaxConteo + 1;
						cConteoActual = cConteoActual + 1;
						
						cX = cX + 1;
					}
					
					while ( cConteoActual != cRowCountChicos )
					{
						cHTMLDiv = cHTMLDiv + 
							"<td><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"10\" height=\"1\" border=\"0\" /></td>" + 
							"<td width=\"175\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"1\" border=\"0\" /></td>" + 
							"";
						
						cConteoActual = cConteoActual + 1;
					}
					
					cHTMLDiv = cHTMLDiv + 
							"</tr>" + 
							"<tr>" + 
								"<td colspan=\"5\"><img src=\"" + cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"15\" border=\"0\" /></td>" + 
							"</tr>" + 
						"</table>" + 
						"";
					
					if ( document.getElementById("divMuestraProductos") )
						document.getElementById("divMuestraProductos").innerHTML = cHTMLDiv;
					
					if ( cXMLResponse.getElementsByTagName("bMuestraPag")[0].childNodes[0].nodeValue == "1" && Number(cXMLResponse.getElementsByTagName("cTotalPage")[0].childNodes[0].nodeValue) > 1 )
					{
						if ( document.getElementById("trPaginacionProductos") )
							document.getElementById("trPaginacionProductos").style.display = "";
						
						var cPaginacionTxtBusqueda = "";
						if ( cXMLResponse.getElementsByTagName("cTxtBusqueda")[0].childNodes[0] )
							cPaginacionTxtBusqueda = cXMLResponse.getElementsByTagName("cTxtBusqueda")[0].childNodes[0].nodeValue;
						
						fncCreaPaginacion( cXMLResponse.getElementsByTagName("cIdioma")[0].childNodes[0].nodeValue, cXMLResponse.getElementsByTagName("cIdCategoria")[0].childNodes[0].nodeValue, cXMLResponse.getElementsByTagName("cIdProducto")[0].childNodes[0].nodeValue, cPaginacionTxtBusqueda, cXMLResponse.getElementsByTagName("cDivPaginacion")[0].childNodes[0].nodeValue, cXMLResponse.getElementsByTagName("cTotalPage")[0].childNodes[0].nodeValue, cXMLResponse.getElementsByTagName("cIdPage")[0].childNodes[0].nodeValue, cXMLResponse.getElementsByTagName("cPath")[0].childNodes[0].nodeValue );
					}
					else
					{
						if ( document.getElementById("trPaginacionProductos") )
							document.getElementById("trPaginacionProductos").style.display = "none";
					}
					
				}
				else
				{
					if ( document.getElementById("divMuestraProductos") )
						document.getElementById("divMuestraProductos").innerHTML = "<span class='CError'>Ocurrio un error al cargar los productos - err4</span>";
				}
			}
			else
			{
				if ( document.getElementById("divMuestraProductos") )
					document.getElementById("divMuestraProductos").innerHTML = "<span class='CError'>Ocurrio un error al cargar los productos - err5</span>";
			}
		}
		else
		{
			if ( document.getElementById("divMuestraProductos") )
				document.getElementById("divMuestraProductos").innerHTML = "<span class='CError'>Ocurrio un error al cargar los productos - err6</span>";
		}
	}
}

function fncCargaProductoInterno(cImgPath, cIdIdioma, cIdProducto)
{
	if ( document.getElementById("divMuestraProductoDetalle") )
	{
		document.getElementById("divMuestraProductoDetalle").innerHTML = "<table border='0' cellspacing='0' cellpadding='0' width='100%'><tr><td align='center'><img src='" + cImgPath + "img/iCargandoGde.gif' width='66' height='66' border='0' /></td></tr></table>"
		
		xmlHttpProductoDetalle = GetXmlHttpObject();
		
		if ( xmlHttpProductoDetalle == null )
		{
			alert (cAJAXNoValido);
			return;
		}
		
		var cUrl = "axCargaProductoDetalle.asp" + 
			"?" + 
			"ID_Idioma=" + cIdIdioma + 
			"&" + 
			"ID_Producto=" + cIdProducto + 
			"&" + 
			"cIdRandom=" + Math.random();
		
		pageTracker._trackPageview("/interior.asp?cIdProducto=" + cIdProducto);
		
		xmlHttpProductoDetalle.onreadystatechange = fncCargaProductoInternoAJAX;
		xmlHttpProductoDetalle.open("GET", cUrl, true);
		xmlHttpProductoDetalle.send(null);
	}
}

function fncCargaProductoInternoAJAX()
{
	if (xmlHttpProductoDetalle.readyState == 4)
	{
		if (xmlHttpProductoDetalle.status == 200)
		{
			if ( xmlHttpProductoDetalle.responseText != "ERROR" )
			{
				if ( document.getElementById("divMuestraProductoDetalle") )
					document.getElementById("divMuestraProductoDetalle").innerHTML = xmlHttpProductoDetalle.responseText.substring(5);
				
				fncCargaPaletaColores(xmlHttpProductoDetalle.responseText.substring(0, 5));
			}
			else
			{
				if ( document.getElementById("divMuestraProductoDetalle") )
					document.getElementById("divMuestraProductoDetalle").innerHTML = "<br><span class='CError'>Ocurrio un error al cargar el producto</span>";
			}
		}
		else
		{
			if ( document.getElementById("divMuestraProductoDetalle") )
				document.getElementById("divMuestraProductoDetalle").innerHTML = "<br><span class='CError'>Ocurrio un error al cargar el producto</span>";
		}
	}
}

function fncCargaPaletaColores( cIdProducto )
{
	if ( document.getElementById("trPaletaColores") )
	{
		document.getElementById("trPaletaColores").style.display = "none";
		document.getElementById("imgPaletaColores").innerHTML = "";
		
		xmlHttpProductoPaleta = GetXmlHttpObject();
		
		if ( xmlHttpProductoPaleta == null )
		{
			alert (cAJAXNoValido);
			return;
		}
		
		var cUrl = "axCargaProductoPaleta.asp" + 
			"?" + 
			"ID_Producto=" + cIdProducto + 
			"&" + 
			"cIdRandom=" + Math.random();
		
		xmlHttpProductoPaleta.onreadystatechange = fncCargaProductoPaletaColoresAJAX;
		xmlHttpProductoPaleta.open("GET", cUrl, true);
		xmlHttpProductoPaleta.send(null);
	}
}

function fncCargaProductoPaletaColoresAJAX()
{
	if (xmlHttpProductoPaleta.readyState == 4)
	{
		if (xmlHttpProductoPaleta.status == 200)
		{
			if ( xmlHttpProductoPaleta.responseText != "ERROR" )
			{
				if ( xmlHttpProductoPaleta.responseText.substring(0, 1) == "1" )
				{
					if ( document.getElementById("imgPaletaColores") )
						document.getElementById("imgPaletaColores").innerHTML = xmlHttpProductoPaleta.responseText.substring(1);
					
					if ( document.getElementById("trPaletaColores") )
						document.getElementById("trPaletaColores").style.display = "";
				}
			}
		}
	}
}

function fncCargaMenuLibros(cImgPath, cIdIdioma, cIdCategoria)
{
	if ( document.getElementById("divMenuCategorias") )
	{
		document.getElementById("divMenuCategorias").innerHTML = "<img src='" + cImgPath + "img/iCargandoMnu.gif' width='56' height='21' border='0' />"
		
		xmlHttpMenu = GetXmlHttpObject();
		
		if ( xmlHttpMenu == null )
		{
			alert (cAJAXNoValido);
			return;
		}
		
		var cUrl = "axCargaMenuLibrosXML.asp" + 
			"?" + 
			"ID_Idioma=" + cIdIdioma + 
			"&" + 
			"ID_Categoria=" + cIdCategoria + 
			"&" + 
			"cIdRandom=" + Math.random();
		
		pageTracker._trackPageview("/libros.asp?cIdCategoria=" + cIdCategoria);
		
		xmlHttpMenu.onreadystatechange = fncCargaMenuCategoriasAJAX;
		xmlHttpMenu.open("GET", cUrl, true);
		xmlHttpMenu.send(null);
	}
}

function fncCargaMenuCategorias(cImgPath, cIdIdioma, cIdCategoria)
{
	if ( document.getElementById("divMenuCategorias") )
	{
		document.getElementById("divMenuCategorias").innerHTML = "<img src='" + cImgPath + "img/iCargandoMnu.gif' width='56' height='21' border='0' />"
		
		xmlHttpMenu = GetXmlHttpObject();
		
		if ( xmlHttpMenu == null )
		{
			alert (cAJAXNoValido);
			return;
		}
		
		var cUrl = "axCargaMenuXML.asp" + 
			"?" + 
			"ID_Idioma=" + cIdIdioma + 
			"&" + 
			"ID_Categoria=" + cIdCategoria + 
			"&" + 
			"cIdRandom=" + Math.random();
		
		pageTracker._trackPageview("/catalogo.asp?cIdCategoria=" + cIdCategoria);
		
		xmlHttpMenu.onreadystatechange = fncCargaMenuCategoriasAJAX;
		xmlHttpMenu.open("GET", cUrl, true);
		xmlHttpMenu.send(null);
		
		//alert(cUrl)
	}
}

function fncCargaMenuCategoriasAJAX()
{
	if (xmlHttpMenu.readyState == 4)
	{
		if (xmlHttpMenu.status == 200)
		{
			if ( xmlHttpMenu.responseXML.documentElement != null )
			{
				var cHTMLDiv = "";
				var cXMLResponse = xmlHttpMenu.responseXML.documentElement;
				
				cHTMLDiv = cHTMLDiv + 
					"<table border=\"0\" bordercolor=\"red\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">" + 
						"<tr>" + 
						"";
				
				var cAlignText = "";
				var cSpaceOnText = "";
				
				var bPrimerMenu = true;
				var cX = 0;
				while ( cX < cXMLResponse.getElementsByTagName("cMenu").length )
				{
					if ( bPrimerMenu == true )
						bPrimerMenu = false;
					else
					{
						if ( cX == 1 )
							cHTMLDiv = cHTMLDiv + 
								"<tr>" + 
									"<td><img src=\"" + cXMLResponse.getElementsByTagName("cDatosGral")[0].childNodes[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"10\" border=\"0\" /></td>" + 
								"</tr>" + 
								"";
						else
							cHTMLDiv = cHTMLDiv + 
								"<tr>" + 
									"<td><img src=\"" + cXMLResponse.getElementsByTagName("cDatosGral")[0].childNodes[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"1\" height=\"2\" border=\"0\" /></td>" + 
								"</tr>" + 
								"";
					}
					
					cHTMLDiv = cHTMLDiv + 
						"<tr>" + 
						"";
					
					if ( cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[1].childNodes[0].nodeValue == "0" )
					{
						if ( cX == 0 )
						{
							cAlignText = " align=\"center\"";
							cSpaceOnText = "";
						}
						else
						{
							cAlignText = "";
							cSpaceOnText = "<img src=\"" + cXMLResponse.getElementsByTagName("cDatosGral")[0].childNodes[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"5\" height=\"1\" border=\"0\" />";
						}
						
						cHTMLDiv = cHTMLDiv + 
							"<td id=\"tdMenu" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "\" class=\"CMenuIzqOver\"" + cAlignText + ">" + 
								"<div id=\"dMenuSI" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "\" class=\"CMenuIzqMarcoSIOn\">" + 
									"<div id=\"dMenuSD" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "\" class=\"CMenuIzqMarcoSDOn\">" + 
										"<div id=\"dMenuII" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "\" class=\"CMenuIzqMarcoIIOn\">" + 
											"<div id=\"dMenuID" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "\" class=\"CMenuIzqMarcoIDOn\">" + 
												"<div id=\"dMenuC" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "\" class=\"CMenuIzqCenOver\">" + cSpaceOnText + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[2].childNodes[0].nodeValue + cSpaceOnText + "</div>" + 
											"</div>" + 
										"</div>" + 
									"</div>" + 
								"</div>" + 
							"</td>" + 
							"";
					}
					else
					{
						if ( cX == 0 )
						{
							cAlignText = " align=\"center\"";
							cSpaceOnText = "";
						}
						else
						{
							cAlignText = "";
							cSpaceOnText = "<img src=\"" + cXMLResponse.getElementsByTagName("cDatosGral")[0].childNodes[0].childNodes[0].nodeValue + "img/1px.gif\" width=\"5\" height=\"1\" border=\"0\" />";
						}
						
						cHTMLDiv = cHTMLDiv + 
							"<td id=\"tdMenu" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "\" class=\"CMenuIzq\"" + cAlignText + " onmouseover=\"javascript:fncOverClassName(this, 'CMenuIzqOn', 'CMenuIzqCenOn', 'CMenuIzqMarcoSIOn', 'CMenuIzqMarcoSDOn', 'CMenuIzqMarcoIIOn', 'CMenuIzqMarcoIDOn');\" onmouseout=\"javascript:fncOverClassName(this, 'CMenuIzq', 'CMenuIzqCen', 'CMenuIzqMarcoSI', 'CMenuIzqMarcoSD', 'CMenuIzqMarcoII', 'CMenuIzqMarcoID');\" onclick=\"javascript:fncMenuCargaProductos('" + cXMLResponse.getElementsByTagName("cDatosGral")[0].childNodes[0].childNodes[0].nodeValue + "', '" + cXMLResponse.getElementsByTagName("cDatosGral")[0].childNodes[1].childNodes[0].nodeValue + "', '" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "', '', '', 1);\">" + 
								"<div id=\"dMenuSI" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "\" class=\"CMenuIzqMarcoSI\">" + 
									"<div id=\"dMenuSD" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "\" class=\"CMenuIzqMarcoSD\">" + 
										"<div id=\"dMenuII" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "\" class=\"CMenuIzqMarcoII\">" + 
											"<div id=\"dMenuID" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "\" class=\"CMenuIzqMarcoID\">" + 
												"<div id=\"dMenuC" + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[0].childNodes[0].nodeValue + "\" class=\"CMenuIzqCen\">" + cSpaceOnText + cXMLResponse.getElementsByTagName("cMenu")[cX].childNodes[2].childNodes[0].nodeValue + cSpaceOnText + "</div>" + 
											"</div>" + 
										"</div>" + 
									"</div>" + 
								"</div>" + 
							"</td>" + 
							"";
					}
					
					cHTMLDiv = cHTMLDiv + 
						"</tr>" + 
						"";
					
					cX = cX + 1;
				}
				
				cHTMLDiv = cHTMLDiv + 
						"</tr>" + 
					"</table>" + 
					"";
				
				if ( document.getElementById("divMenuCategorias") )
					document.getElementById("divMenuCategorias").innerHTML = cHTMLDiv;
			}
			else
			{
				if ( document.getElementById("divMenuCategorias") )
					document.getElementById("divMenuCategorias").innerHTML = "<span class='CError'>Ocurrio un error al cargar el Menú</span>";
			}
		}
		else
		{
			if ( document.getElementById("divMenuCategorias") )
				document.getElementById("divMenuCategorias").innerHTML = "<span class='CError'>Ocurrio un error al cargar el Menú</span>";
		}
	}
}

function fncLoadGeneral()
{
	fncAcomodaPopUpDiv();
}

function fncResizeGeneral()
{
	fncAcomodaPopUpDiv();
}

function fncScrollGeneral()
{
	fncAcomodaPopUpDiv();
}

function fncAcomodaPopUpDiv()
{
	if ( document.getElementById("divPopUp") )
	{
		document.getElementById("divPopUp").style.width = f_clientWidth() + f_scrollLeft();
		document.getElementById("divPopUp").style.height = f_clientHeight() + f_scrollTop();
	}
	
	if ( document.getElementById("divPopUpInterno") )
	{
		//document.getElementById("divPopUpInterno").style.left = ( f_clientWidth() / 2 ) - ( fncQuitaPixel(document.getElementById("tablePopUpInterno").style.width) / 2 ) + f_scrollLeft();
		//document.getElementById("divPopUpInterno").style.top = ( f_clientHeight() / 2 ) - ( fncQuitaPixel(document.getElementById("tablePopUpInterno").style.height) / 2 ) + f_scrollTop();
		
		document.getElementById("divPopUpInterno").style.left = f_scrollLeft();
		document.getElementById("divPopUpInterno").style.top = f_scrollTop();
	}
	
	if ( document.getElementById("divPopUpHTML") )
	{
		document.getElementById("divPopUpHTML").style.width = fncQuitaPixel(document.getElementById("tablePopUpInterno").style.width) - 64 + "px";
		document.getElementById("divPopUpHTML").style.height = fncQuitaPixel(document.getElementById("tablePopUpInterno").style.height) - 167 + "px";
	}
}

function fncPopUpCerrar()
{
	if ( document.getElementById("divPopUpHTML") )
		document.getElementById("divPopUpHTML").innerHTML = "";
	
	if ( document.getElementById("divPopUp") )
		document.getElementById("divPopUp").style.display = "none";
	
	if ( document.getElementById("divPopUpInterno") )
		document.getElementById("divPopUpInterno").style.display = "none";
}

function fncGoHome()
{
	document.frmHome.action = "default.asp";
	document.frmHome.submit();
}

function fncContactanos()
{
	document.frmHome.action = "contactanos.asp";
	document.frmHome.submit();
}

function fncExposiciones()
{
	document.frmHome.action = "exposiciones.asp";
	document.frmHome.submit();
}

function fncIrACarrito()
{
	//return;
	
	document.frmIrACarrito.submit();
}

function fncIrAServicioCliente()
{
	document.frmIrAMiCuenta.action = "serviciocliente.asp";
	document.frmIrAMiCuenta.submit();
}

function fncContactanos()
{
	document.frmFooter.action = "contactanos.asp";
	document.frmFooter.submit();
}

function fncBusquedaPorTexto( cImgPath, cIdIdioma )
{
	if ( document.frmBusquedaTexto.cTxtBusqueda.value != "" )
	{
		if ( document.getElementById("divMuestraProductos") )
		{
			fncMenuCargaProductos(cImgPath, cIdIdioma, 0, 0, document.frmBusquedaTexto.cTxtBusqueda.value, 1);
		}
		else
		{
			document.frmBusquedaTexto.action = "catalogo.asp";
			document.frmBusquedaTexto.submit();
		}
	}
}

function fncIrAMiCuenta()
{
	document.frmIrAMiCuenta.submit();
}

function fncVerHistorial()
{
	document.frmIrACarrito.action = "historial.asp";
	document.frmIrACarrito.submit();
}

function fncInteriorRecomendado(ID_Categoria, ID_Producto, ID_Idioma, cPath)
{
	fncCargaProductoInterno(cPath, ID_Idioma, ID_Producto);
	fncCargaProductosRecomendados(cPath, ID_Idioma, ID_Categoria, ID_Producto, '', 1);
}

function fncInterior(ID_Categoria, ID_Producto)
{
	if ( ID_Categoria == 209 )
		document.frmInterior.action = "interiorlibros.asp"
	
	document.frmInterior.ID_Categoria.value = ID_Categoria;
	document.frmInterior.ID_Producto.value = ID_Producto;
	document.frmInterior.submit();
}

function DarClick(src, cYear)
{
	if ( event.button == 2 )
	{
		//alert("Casa Serra ®\nTodos los Derechos Reservados\nMéxico, D.F. " + cYear);
		//return false;
	}
}

function fncMenuCargaProductos(cImgPath, cIdIdioma, cIdCategoria, cIdProducto, cTxtBusqueda, cIdPage)
{
	if ( document.getElementById("divMuestraProductos") )
	{
		fncCargaMenuCategorias(cImgPath, cIdIdioma, cIdCategoria);
		fncCargaProductos(cImgPath, cIdIdioma, cIdCategoria, cIdProducto, cTxtBusqueda, cIdPage);
	}
	else
	{
		document.frmCambiaCategoria.ID_Categoria.value = cIdCategoria;
		document.frmCambiaCategoria.submit();
	}
}

function fncVerCategoria(src)
{
	document.frmCambiaCategoria.ID_Categoria.value = src;
	document.frmCambiaCategoria.submit();
}

function fncCreaPaginacion( cIdIdioma, cIdCategoria, cIdProducto, cTxtBusqueda, oDivPaginacion, cPagesTotal, cPagesActual, cImgPath )
{
	var cStringTable = "";
	var cStringTable01 = "";
	var cStringTable02 = "";
	var cPageConteo = 1;
	var bPaginacionPuntos;
	
	var cStringFunctionBase = "javascript:";
	var cStringFunctionPaginacion = "fncCargaProductos('" + cImgPath + "', " + cIdIdioma + ", " + cIdCategoria + ", " + cIdProducto + ", '" + cTxtBusqueda + "', QWERT);";
	
	if ( Number(cPagesTotal) > 1 )
	{
		cStringTable01 = cStringTable01 + 
			"<table border=\"0\" bordercolor=\"red\" cellspacing=\"0\" cellpadding=\"0\">" + 
				"<tr>" + 
			"";
		
		cStringTable01 = cStringTable01 + 
			"<td class=\"CTdPaginacion\">[</td>" + 
			"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
			"<td class=\"CTdPaginacion\">Página:</td>" + 
			"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
			"";
		
		if ( Number(cPagesTotal) <= 9 )
		{
			while ( cPageConteo <= Number(cPagesTotal) )
			{
				if ( cPageConteo == Number(cPagesActual) )
				{
					cStringTable01 = cStringTable01 + 
						"<td class=\"CTdPaginacionOn\">" + 
							cPageConteo + 
						"</td>" + 
						"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
						"";
				}
				else
				{
					cStringTable01 = cStringTable01 + 
						"<td class=\"CTdPaginacion\">" + 
							"<a href=\"" + cStringFunctionBase + cStringFunctionPaginacion.replace("QWERT", cPageConteo) + "\" class=\"CTdPaginacion\">" + 
								cPageConteo + 
							"</a>" + 
						"</td>" + 
						"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
						"";
				}
				
				cPageConteo = cPageConteo + 1;
			}
		}
		else
		{
			if ( Number(cPagesActual) <= 5 )
			{
				bPaginacionPuntos = false;
				
				while ( cPageConteo <= Number(cPagesTotal) )
				{
					if ( cPageConteo <= 7 || cPageConteo == Number(cPagesTotal) )
					{
						if ( cPageConteo == Number(cPagesActual) )
						{
							cStringTable01 = cStringTable01 + 
								"<td class=\"CTdPaginacionOn\">" + 
									cPageConteo + 
								"</td>" + 
								"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
								"";
						}
						else
						{
							cStringTable01 = cStringTable01 + 
								"<td class=\"CTdPaginacion\">" + 
									"<a href=\"" + cStringFunctionBase + cStringFunctionPaginacion.replace("QWERT", cPageConteo) + "\" class=\"CTdPaginacion\">" + 
										cPageConteo + 
									"</a>" + 
								"</td>" + 
								"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
								"";
						}
					}
					else
					{
						if ( bPaginacionPuntos == false )
						{
							cStringTable01 = cStringTable01 + 
								"<td class=\"CTdPaginacionOn\">" + 
									"..." + 
								"</td>" + 
								"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
								"";
							
							bPaginacionPuntos = true;
						}
					}
					
					cPageConteo = cPageConteo + 1;
				}
			}
			else
			{
				if ( Number(cPagesActual) > Number(cPagesTotal) -  5 )
				{
					bPaginacionPuntos = false;
					
					while ( cPageConteo <= Number(cPagesTotal) )
					{
						if ( cPageConteo == 1 || cPageConteo >= Number(cPagesTotal) - 7 )
						{
							if ( cPageConteo == Number(cPagesActual) )
							{
								cStringTable01 = cStringTable01 + 
									"<td class=\"CTdPaginacionOn\">" + 
										cPageConteo + 
									"</td>" + 
									"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
									"";
							}
							else
							{
								cStringTable01 = cStringTable01 + 
									"<td class=\"CTdPaginacion\">" + 
										"<a href=\"" + cStringFunctionBase + cStringFunctionPaginacion.replace("QWERT", cPageConteo) + "\" class=\"CTdPaginacion\">" + 
											cPageConteo + 
										"</a>" + 
									"</td>" + 
									"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
									"";
							}
						}
						else
						{
							if ( bPaginacionPuntos == false )
							{
								cStringTable01 = cStringTable01 + 
									"<td class=\"CTdPaginacionOn\">" + 
										"..." + 
									"</td>" + 
									"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
									"";
								
								bPaginacionPuntos = true;
							}
						}
						
						cPageConteo = cPageConteo + 1;
					}
				}
				else
				{
					bPaginacionPuntos = false;
					
					while ( cPageConteo <= Number(cPagesTotal) )
					{
						if ( cPageConteo == 1 || cPageConteo == Number(cPagesTotal) )
						{
							if ( cPageConteo == Number(cPagesActual) )
							{
								cStringTable01 = cStringTable01 + 
									"<td class=\"CTdPaginacionOn\">" + 
										cPageConteo + 
									"</td>" + 
									"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
									"";
							}
							else
							{
								cStringTable01 = cStringTable01 + 
									"<td class=\"CTdPaginacion\">" + 
										"<a href=\"" + cStringFunctionBase + cStringFunctionPaginacion.replace("QWERT", cPageConteo) + "\" class=\"CTdPaginacion\">" + 
											cPageConteo + 
										"</a>" + 
									"</td>" + 
									"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
									"";
							}
						}
						else
						{
							if ( cPageConteo >= Number(cPagesActual) - 2 && cPageConteo <= Number(cPagesActual) + 2 )
							{
								if ( cPageConteo == Number(cPagesActual) )
								{
									cStringTable01 = cStringTable01 + 
										"<td class=\"CTdPaginacionOn\">" + 
											cPageConteo + 
										"</td>" + 
										"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
										"";
								}
								else
								{
									cStringTable01 = cStringTable01 + 
										"<td class=\"CTdPaginacion\">" + 
											"<a href=\"" + cStringFunctionBase + cStringFunctionPaginacion.replace("QWERT", cPageConteo) + "\" class=\"CTdPaginacion\">" + 
												cPageConteo + 
											"</a>" + 
										"</td>" + 
										"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
										"";
								}
								
								bPaginacionPuntos = false;
							}
							else
							{
								if ( bPaginacionPuntos == false )
								{
									cStringTable01 = cStringTable01 + 
										"<td class=\"CTdPaginacionOn\">" + 
											"..." + 
										"</td>" + 
										"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
										"";
									
									bPaginacionPuntos = true;
								}
							}
						}
						
						cPageConteo = cPageConteo + 1;
					}
				}
			}
		}
		
		cStringTable01 = cStringTable01 + 
			"<td class=\"CTdPaginacion\">]</td>" + 
			"";
		
		cStringTable01 = cStringTable01 + 
				"</tr>" + 
			"</table>" + 
			"";
	}
	else
	{
		cStringTable01 = cStringTable01 + 
			"<img src=\"" + cImgPath + "img/1px.gif\" width=\"10\" height=\"13\" border=\"0\">" + 
			"";
	}
	
	if ( Number(cPagesTotal) > 1 )
	{
		cStringTable02 = cStringTable02 + 
			"<table border=\"0\" bordercolor=\"red\" cellspacing=\"0\" cellpadding=\"0\">" + 
				"<tr>" + 
			"";
		
		cStringTable02 = cStringTable02 + 
			"<td class=\"CTdPaginacion\">[</td>" + 
			"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
			"";
		
		if ( Number(cPagesActual) > 1 )
		{
			cStringTable02 = cStringTable02 + 
				"<td class=\"CTdPaginacion\" width=\"54\" nowrap>" + 
					"<a href=\"" + cStringFunctionBase + cStringFunctionPaginacion.replace("QWERT", Number(cPagesActual) - 1) + "\" class=\"CTdPaginacion\">" + 
						"anterior" + 
					"</a>" + 
				"</td>" + 
				"";
		}
		else
		{
			cStringTable02 = cStringTable02 + 
				"<td class=\"CTdPaginacion\" width=\"54\" nowrap><img src=\"" + cImgPath + "img/1px.gif\" width=\"54\" height=\"1\" border=\"0\"></td>" + 
				"";
		}
		
		if ( Number(cPagesActual) > 1 && Number(cPagesActual) < Number(cPagesTotal) )
		{
			cStringTable02 = cStringTable02 + 
				"<td class=\"CTdPaginacion\" width=\"14\" nowrap>&nbsp;-&nbsp;</td>" + 
				"";
		}
		else
		{
			cStringTable02 = cStringTable02 + 
				"<td class=\"CTdPaginacion\" width=\"14\" nowrap><img src=\"" + cImgPath + "img/1px.gif\" width=\"14\" height=\"1\" border=\"0\"></td>" + 
				"";
		}
		
		if ( Number(cPagesActual) < Number(cPagesTotal) )
		{
			cStringTable02 = cStringTable02 + 
				"<td class=\"CTdPaginacion\" width=\"61\" nowrap>" + 
					"<a href=\"" + cStringFunctionBase + cStringFunctionPaginacion.replace("QWERT", Number(cPagesActual) + 1) + "\" class=\"CTdPaginacion\">" + 
						"siguiente" + 
					"</a>" + 
				"</td>" + 
				"";
		}
		else
		{
			cStringTable02 = cStringTable02 + 
				"<td class=\"CTdPaginacion\" width=\"54\" nowrap><img src=\"" + cImgPath + "img/1px.gif\" width=\"61\" height=\"1\" border=\"0\"></td>" + 
				"";
		}
		
		cStringTable02 = cStringTable02 + 
			"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"3\" height=\"1\" border=\"0\"></td>" + 
			"<td class=\"CTdPaginacion\">]</td>" + 
			"";
		
		cStringTable02 = cStringTable02 + 
				"</tr>" + 
			"</table>" + 
			"";
	}
	else
	{
		cStringTable02 = cStringTable02 + 
			"<img src=\"" + cImgPath + "img/1px.gif\" width=\"1\" height=\"13\" border=\"0\">" + 
			"";
	}
	
	cStringTable = "";
	
	cStringTable = cStringTable + 
		"<table border=\"0\" bordercolor=\"blue\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">" + 
			"<tr>" + 
				"<td width=\"100%\"><img src=\"" + cImgPath + "img/1px.gif\" width=\"1\" height=\"1\" border=\"0\"></td>" + 
				"<td>" + cStringTable01 + "</td>" + 
				"<td><img src=\"" + cImgPath + "img/1px.gif\" width=\"20\" height=\"1\" border=\"0\"></td>" + 
				"<td width=\"150\" align=\"right\" nowrap>" + cStringTable02 + "</td>" + 
			"</tr>" + 
			"<tr>" + 
				"<td colspan=\"4\"><img src=\"" + cImgPath + "img/1px.gif\" width=\"1\" height=\"15\" border=\"0\"></td>" + 
			"</tr>" + 
		"</table>" + 
		"";
	
	document.getElementById(oDivPaginacion).innerHTML = cStringTable;
}

function fncCarritoCompra()
{
	document.frmCarrito.submit();
}

function fncCotizacionEspecial()
{
	document.frmIrACarrito.method = "post"
	document.frmIrACarrito.action = "cotizacion.asp#CEspecial";
	document.frmIrACarrito.submit();
}

function fncCarritoCompraGeneral( cIdCategoria, cIdProducto )
{
	document.frmCarrito.ID_Categoria.value = cIdCategoria;
	document.frmCarrito.ID_Producto.value = cIdProducto;
	document.frmCarrito.submit();
}

function fncContinuaComprando()
{
	document.frmIrACarrito.action = "catalogo.asp";
	document.frmIrACarrito.submit();
}

function fncVerDetalleProducto(ID_Categoria, ID_Producto)
{
	document.frmCotizacion.ID_Categoria.value = ID_Categoria;
	document.frmCotizacion.ID_Producto.value = ID_Producto;
	document.frmCotizacion.action = "Interior.asp";
	document.frmCotizacion.submit();
}

function fncBorrarCarrito(ID_Categoria, ID_Producto, ID_Consecutivo)
{
	document.frmCotizacion.Var_Destino.value = "1";
	document.frmCotizacion.ID_Categoria.value = ID_Categoria;
	document.frmCotizacion.ID_Producto.value = ID_Producto;
	document.frmCotizacion.ID_Consecutivo.value = ID_Consecutivo;
	document.frmCotizacion.action = "xt_Carrito.asp";
	document.frmCotizacion.submit();
}

function fncActualizaCarrito()
{
	document.frmCotizacion.Var_Destino.value = "1";
	document.frmCotizacion.action = "xt_ActualizaCarrito.asp";
	document.frmCotizacion.submit();
}

function fncCarritoCambiaCategoria()
{
	document.frmIrACarritoActualiza.ID_Categoria.value = document.frmCotizacionCategorias.Id_Categoria.value;
	document.frmIrACarritoActualiza.submit();
}

function fncCarritoAgregaProducto()
{
	if ( document.frmCotizacionCategorias.Id_Categoria.value != "" && document.frmCotizacionCategorias.Id_Producto.value != "" )
	{
		document.frmCarrito.ID_Categoria.value = document.frmCotizacionCategorias.Id_Categoria.value;
		document.frmCarrito.ID_Producto.value = document.frmCotizacionCategorias.Id_Producto.value;
		document.frmCarrito.submit();
	}
}

function fncValidaSolicitud()
{
	if ( fncTrim(document.frmSolicitaCotizacion.cNombre.value) == "" )
	{
		alert("El campo Nombre es requerido.");
		document.frmSolicitaCotizacion.cNombre.focus();
		return;
	}
	
	if ( fncTrim(document.frmSolicitaCotizacion.cMail.value) == "" )
	{
		alert("El campo e-Mail es requerido.");
		document.frmSolicitaCotizacion.cMail.focus();
		return;
	}
	else if ( fncEsEmail(document.frmSolicitaCotizacion.cMail.value) == false )
	{
		alert("El campo e-Mail es requerido.");
		document.frmSolicitaCotizacion.cMail.focus();
		return;
	}
	
	if ( fncTrim(document.frmSolicitaCotizacion.cTelefono.value) == "" )
	{
		alert("El campo Teléfono es requerido.");
		document.frmSolicitaCotizacion.cTelefono.focus();
		return;
	}
	
	if ( fncTrim(document.frmSolicitaCotizacion.cMensaje.value) == "" )
	{
		alert("El campo Mensaje es requerido.");
		document.frmSolicitaCotizacion.cMensaje.focus();
		return;
	}
	
	document.frmSolicitaCotizacion.action = "Mailing/xt_EnviaCorreo.asp";
	document.frmSolicitaCotizacion.submit();
}

function fncValidaContactanos()
{
	if ( document.frmContactanos.cAsunto.value == "" )
	{
		alert("El campo Asunto es requerido.");
		document.frmContactanos.cAsunto.focus();
		return;
	}
	
	if ( fncTrim(document.frmContactanos.cNombre.value) == "" )
	{
		alert("El campo Nombre es requerido.");
		document.frmContactanos.cNombre.focus();
		return;
	}
	
	if ( fncTrim(document.frmContactanos.cMail.value) == "" )
	{
		alert("El campo e-Mail es requerido.");
		document.frmContactanos.cMail.focus();
		return;
	}
	else if ( fncEsEmail(document.frmContactanos.cMail.value) == false )
	{
		alert("El campo e-Mail es requerido.");
		document.frmContactanos.cMail.focus();
		return;
	}
	
	if ( fncTrim(document.frmContactanos.cTelefono.value) == "" )
	{
		alert("El campo Teléfono es requerido.");
		document.frmContactanos.cTelefono.focus();
		return;
	}
	
	if ( fncTrim(document.frmContactanos.cMensaje.value) == "" )
	{
		alert("El campo Mensaje es requerido.");
		document.frmContactanos.cMensaje.focus();
		return;
	}
	
	document.frmContactanos.action = "Mailing/xt_EnviaCorreoContacto.asp";
	document.frmContactanos.submit();
}

function fncGoSeccion( cIdSeccion )
{
	document.frmSeccion.ID_Seccion.value = cIdSeccion;
	document.frmSeccion.submit();
}

function fncCatalogo()
{
	document.frmHome.action = "catalogo.asp";
	document.frmHome.submit();
}

function fncLibros()
{
	document.frmHome.action = "libros.asp";
	document.frmHome.submit();
}

function fncVirtualEarth( cId )
{
	document.getElementById("DivTDImagenExpo").innerHTML = "<div id='myMap' style='position:relative; width:600px; height:400px;'>MAPA " + cId + "</div>";
	
	if ( document.getElementById("divPopUp") )
		document.getElementById("divPopUp").style.display = "";
	
	if ( document.getElementById("divPopUpInterno") )
		document.getElementById("divPopUpInterno").style.display = "";
	
	/*
	if ( document.getElementById("tablePopUpInterno") )
	{
		document.getElementById("tablePopUpInterno").style.width = "764px";
		document.getElementById("tablePopUpInterno").style.height = "567px";
		
		if ( document.getElementById("tdTituloPopUp") )
			document.getElementById("tdTituloPopUp").innerHTML = "Ubicaci&oacute;n de Tiendas";
		
		fncAcomodaPopUpDiv();
	}
	
	if ( document.getElementById("divPopUp") )
		document.getElementById("divPopUp").style.display = "";
	
	if ( document.getElementById("divPopUpInterno") )
		document.getElementById("divPopUpInterno").style.display = "";
	
	if ( document.getElementById("divPopUpHTML") )
		document.getElementById("divPopUpHTML").innerHTML = "<div id='myMap' style='position:relative; width:100%; height:100%;'></div>";
	*/
	
	fncGetMap( cId );
}

function fncOverClassName( oSrc, cCN, cCNCen, cCNSI, cCNSD, cCNII, cCNID )
{
	var cIdMenu = oSrc.id.substring(6) ;
	
	oSrc.className = cCN;
	
	document.getElementById("dMenuC" + cIdMenu).className = cCNCen;
	document.getElementById("dMenuSI" + cIdMenu).className = cCNSI;
	document.getElementById("dMenuSD" + cIdMenu).className = cCNSD;
	document.getElementById("dMenuII" + cIdMenu).className = cCNII;
	document.getElementById("dMenuID" + cIdMenu).className = cCNID;
}

function fncAbreExpo(cImage)
{
	document.getElementById("DivTDImagenExpo").innerHTML = "<img src=\"" + cImage + "\" border=\"0\" />";
	
	if ( document.getElementById("divPopUp") )
		document.getElementById("divPopUp").style.display = "";
	
	if ( document.getElementById("divPopUpInterno") )
		document.getElementById("divPopUpInterno").style.display = "";
}

function fncCierraExpo()
{
	document.getElementById("DivTDImagenExpo").innerHTML = "";
	
	if ( document.getElementById("divPopUp") )
		document.getElementById("divPopUp").style.display = "none";
	
	if ( document.getElementById("divPopUpInterno") )
		document.getElementById("divPopUpInterno").style.display = "none";
}