
capaactual = "";
ns = (document.layers)? true:false;
ie = (document.all)? true:false;
ns6 = (!document.all && document.getElementById)? true:false;
winW = 0;
timerID = null;
timerRunning = false;
function show(id) {
	if (timerRunning) {
		clearTimeout(timerID)
		timerRunning = false
	}
    if (capaactual != "") {
		if (capaactual != id) {
	    	hide(capaactual)
		}
	}
	
	if (ie) {
	    document.all[id].style.visibility = "visible"
		capaactual = id
    } else if (ns6) {
	    document.getElementById(id).style.visibility = "visible"
		capaactual = id
	} else if (ns) {
	    document.layers[id].visibility = "show"
		capaactual = id
	}

}

function timerhideon(capaid) {
	if (timerRunning) {
		clearTimeout(timerID)
		timerRunning = false
	}
	timerID = setTimeout("hide('" + capaid + "')", 500);
	timerRunning = true
}

function hide(ide) {
	if (ie) document.all[ide].style.visibility = "hidden"
    else if (ns6) document.getElementById(ide).style.visibility = "hidden"
	else if (ns) document.layers[ide].visibility = "hide"
	timerRunning = false
}

function rehubicar(id, locini) {
var winH,WinW
dx = 0
dx2=0
tablewidth = 743
tableheight = 427
if (navigator.appName == "Microsoft Internet Explorer") {
locini=locini 
locini2 = 170
}
if (navigator.appName == "Netscape" ){
locini=locini + 10
locini2= 175

}

 if( navigator.appVersion.indexOf('Mac') != -1){
 locini2 = 175
 locini = locini + 12}
 
	if ((winH - tableheight) > 0) dx2 = (winW - tablewidth) / 2
	if ((winW - tablewidth) > 0) dx = (winW - tablewidth) / 2
	
	if (ie) 
	{
	document.all[id].style.left = dx + locini
	document.all[id].style.top = dx2 + locini2
	}
    else if (ns6) {
		document.getElementById(id).style.left = dx + locini
		document.getElementById(id).style.top = locini2
	} else if (ns) document.layers[id].left = dx + locini
}

function testsize() {
	newwinW = (ns)? window.innerWidth-16:document.body.offsetWidth-20;
	if (newwinW != winW) iniciar();
	setTimeout(testsize, 1000);
}

function iniciar() {
var winH,WinW
winW = (ns)? window.innerWidth-16 : document.body.offsetWidth-20
winH = (ns)? window.innerHeight : document.body.offsetHeight


	rehubicar("productos", 360);
	testsize();
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  popup=window.open(theURL,winName,features);
  popup.focus();
}
