
function bCategoria(dato) {
	document.getElementById("cat").value = dato;
	document.getElementById("sec").value = 0;
	document.getElementById("pro").value = 0;
	document.busca.submit();
}

function bSector(dato) {
	document.getElementById("sec").value = dato;
	document.getElementById("pro").value = 0;
	document.busca.submit();
}

function bProducto(dato) {
	document.getElementById("pro").value = dato;
	document.busca.submit();
}

function highlight(event) {
	this.style.backgroundColor='#DEE9FF';
	this.style.borderBottomColor='#C0C0C0';
	//this.style.letterSpacing='2px';
	//this.style.paddingLeft='10px';
	//this.style.listStyleType='square';
	this.style.listStyleImage='url(/img/ok2.gif)';
	//this.style.paddingTop='0px';
	//this.style.paddingBottom='6px';
	//this.style.textAlign='right';
	this.style.cursor='pointer';
}

function normal(event) {
	this.style.backgroundColor='#F3F3F3';
	this.style.borderBottomColor='#094EA3';
	//this.style.letterSpacing='1px';
	//this.style.paddingLeft='5px';
	//this.style.listStyleType='none';
	this.style.listStyleImage='none';
	//this.style.paddingTop='4px';
	//this.style.paddingBottom='2px';
	this.style.cursor='auto';
}

function redir(event) {
	document.location.href = this.firstChild.href;
}

function menu() {
	var z = document.getElementById("menuitems").getElementsByTagName("li").length;
	for (var i=1; i<=z; i++ ) {
		document.getElementById('menu'+i).onmouseover = highlight;
		document.getElementById('menu'+i).onmouseout  = normal;
		document.getElementById('menu'+i).onclick = redir;
	}
}

function CreateControlFlash(divid, objectid, width, height, url, mode) {
	var d = document.getElementById(divid);
	var strHTML = '<object id="' + objectid + '" type="application/x-shockwave-flash" data="' + url + '" width="' + width + '" height="' + height + '">';
	strHTML = strHTML + '<param name="movie" value="' + url + '" />';
	if(mode=='1') { strHTML = strHTML + '<param name="wmode" value="transparent" />'; }
	strHTML = strHTML + '<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&amp;Lang=Spanish&amp;P5_Language=Spanish"><img src="flash/noflash.gif" border="0" alt="no tiene flash" /></a>';
	strHTML = strHTML + '</object>';
	d.innerHTML = strHTML;
}

function MailLink (usuario, dominio, tld) {
	 //codifica los caracteres mas significativos
	 var arroba = '@'
	 var punto = '.'
	
	 //utiliza variables para ocultar las palabras clave
	 var etiqueta = 'ma' + '' + 'il'
	 var dospuntos = 'to:'
	 var localizador = usuario
	 localizador = localizador + arroba + dominio;
	 localizador = localizador + punto + tld;
	
	 //escribe en enlace
	 document.write('<a href="' + etiqueta + dospuntos + localizador + '">' + localizador + '</a>');
}

function MailLinkImg (usuario, dominio, tld, src) {
	 //codifica los caracteres mas significativos
	 var arroba = '@'
	 var punto = '.'
	
	 //utiliza variables para ocultar las palabras clave
	 var etiqueta = 'ma' + '' + 'il'
	 var dospuntos = 'to:'
	 var localizador = usuario
	 localizador = localizador + arroba + dominio;
	 localizador = localizador + punto + tld;
	
	 //escribe en enlace
	 document.write('<a href="' + etiqueta + dospuntos + localizador + '">' + '<img src="' + src + '" alt="Email" border="0" align="right" />' + '</a>');
}

function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}

function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}

function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}

function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}

function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}

function showVideo(parametro) {
	var strVideo = '';
	strVideo = strVideo + '<p><a href="javascript:hideVideo()" title="CERRAR"><img src="img/close.png" width="24" height="24" alt="CERRAR" style="border:none;" /></a></p>';
	strVideo = strVideo + '<object width="494" height="400">';
	strVideo = strVideo +  '<param name="movie" value="http://www.youtube.com/v/'+parametro+'&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1&rel=0"></param>';
	strVideo = strVideo +  '<param name="allowFullScreen" value="true"></param>';
	strVideo = strVideo +  '<param name="allowScriptAccess" value="always"></param>';
	strVideo = strVideo +  '<embed src="http://www.youtube.com/v/'+parametro+'&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1&rel=0" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="494" height="324"></embed>';
	strVideo = strVideo +  '</object>';
	document.getElementById("marcovideo").innerHTML = strVideo;
	document.getElementById("marcovideo").style.display = 'inline';

	var windowY = f_clientHeight();
	var scrollY = f_scrollTop();
	var divY = document.getElementById("marcovideo").offsetHeight;
	var topY = parseInt(windowY/2)-parseInt(divY/2)+scrollY;
	var strY = topY+'px';

	var windowX = f_clientWidth();
	var scrollX = f_scrollLeft();
	var divX = document.getElementById("marcovideo").offsetWidth;
	var leftX = parseInt(windowX/2)-parseInt(divX/2);
	var strX = leftX+'px';

	document.getElementById("marcovideo").style.top = strY;
	document.getElementById("marcovideo").style.left = strX;
	//showDark();
}

function hideVideo(dato) {
	document.getElementById("marcovideo").innerHTML = '';
	document.getElementById("marcovideo").style.display = 'none';
	//document.getElementById("dark").style.display = 'none';
}

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 50;
PositionY = 50;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(300,300);');
writeln('width=300-(document.body.clientWidth-document.images[0].width);');
writeln('height=300-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
//writeln('<img name="George" src="'+imageURL+'" style="display:block"></body></html>');
writeln('<img name="George" src="_thumbs.php?imagen='+imageURL+'&factor=1" style="display:block"></body></html>');
close();		
}}

window.onload = menu;
