	function abrirImagen(foto) { 
		alpha=window.open("","","toolbar=no,location=no,menubar=no,scrollbars=no,status=no,resizable=yes,width=800,height=600,top=10,left=10"); 
		x=alpha.document; 
		x.write("<head><SCRIP"+"T>") 
		x.write("function dymanicResize(){") 
		x.write("window.resizeTo(") 
		x.write("document.im1.width+11,") 
		x.write("document.im1.height+53);") 
		x.write("};document.title='--- VylanPC.com ------------------------------';</SCRIP"+"T></head>") 
		x.write("<body topmargin=0 leftmargin=0 scroll=no toolbar=no location=no menubar=no scrollbars=no status=no>") 
		x.write("<img src='"+foto+"' name='im1' onLoad='dymanicResize()'>") 
		x.write("</body>") 
		x.close() 
		alpha.focus() 
	} 

function buscar(){
	var redirect
	redirect =''
	if (document.formBusqueda.strBusqueda.value != "") {
		
		cadena=document.formBusqueda.strBusqueda.value;
		
		cadena = cadena.replace(/\//g,"%");
		
		redirect += '/str/' + changeIt(cadena);
		redirect +='/resultados.asp';
		self.location=redirect;
		
	}else{
		alert("Introduzca la cadena a buscar");
	}
} 


function buscarMarca()
{
	var redirect
	redirect =''
	if (document.formBuscador.selec_marcas.value != "") {
	
		redirect += '/marca/' + changeIt(document.formBuscador.selec_marcas.value);
		redirect +='/resultados.asp';
		self.location=redirect;
		
	}else{
		alert("Introduzca la cadena a buscar");
	}
}

var hexVals = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
              "A", "B", "C", "D", "E", "F");
var unsafeString = "\"<>%\\^[]`\+\$\,";
// deleted these chars from the include list ";", "/", "?", ":", "@", "=", "&" and #
// so that we could analyze actual URLs

function isUnsafe(compareChar)
// this function checks to see if a char is URL unsafe.
// Returns bool result. True = unsafe, False = safe
	{
	if (unsafeString.indexOf(compareChar) == -1 && compareChar.charCodeAt(0) > 32
		&& compareChar.charCodeAt(0) < 123)
	   { return false; } // found no unsafe chars, return false
	else
	   { return true; }
	}

function decToHex(num, radix)
// part of the hex-ifying functionality
	{
	var hexString = "";
	while (num >= radix)
		  {
		   temp = num % radix;
		   num = Math.floor(num / radix);
		   hexString += hexVals[temp];
		  }
	hexString += hexVals[num];
	return reversal(hexString);
}

function reversal(s) // part of the hex-ifying functionality
	{
	var len = s.length;
	var trans = "";
	for (i=0; i<len; i++)
		{ trans = trans + s.substring(len-i-1, len-i); }
	s = trans;
	return s;
}

function convert(val) // this converts a given char to url hex form
	{ return  "%" + decToHex(val.charCodeAt(0), 16); }


function changeIt(val)
// changed Mar 25, 2002: added if on 122 and else block on 129 to exclude Unicode range
	{
	var len     = val.length;
	var backlen = len;
	var i       = 0;
	
	var newStr  = "";
	var frag    = "";
	var encval  = "";
	var original = val;
	
	for (i=0;i<len;i++)
		{
		  if (val.substring(i,i+1).charCodeAt(0) < 255)  // hack to eliminate the rest of unicode from this
			 {
			  if (isUnsafe(val.substring(i,i+1)) == false)
				 { newStr = newStr + val.substring(i,i+1); }
			  else
				 { newStr = newStr + convert(val.substring(i,i+1)); }
			 }
		  else // woopsie! restore.
			 {
			   alert ("Found a non-ISO-8859-1 character at position: " + (i+1) + ",\nPlease eliminate before continuing.");
			   // set back t?o "no encoding"
			   newStr = original; i=len;                // short-circuit the loop and exit
			 }
		}

return newStr;
}


