
var loaded = 0;
var gotlayers = 0;
var lastbutton='top';
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;

function moveLayers() {
	if (gotlayers) {
		if (NS4) {
			screenWidth = window.innerWidth;
			document.layers['productos'].left = 350;
			document.layers['productos'].top = 17;
			document.layers['zanahoria'].left = 306;
			document.layers['zanahoria'].top = 17;
			document.layers['empresa'].left = 100;
			document.layers['empresa'].top = 17;
		} else {
			screenWidth = document.body.clientWidth + 18;
			document.all['productos'].style.pixelLeft = 390;
			document.all['productos'].style.pixelTop = 17
			document.all['zanahoria'].style.pixelLeft = 250;
			document.all['zanahoria'].style.pixelTop = 17;
			document.all['empresa'].style.pixelLeft = 150; //screenWidth-350;
			document.all['empresa'].style.pixelTop = 17;
	
		}
	}
}

function popUp(menuName,on) {
	if (gotlayers) {
		if (on) {
			moveLayers();
			if (NS4) {
				document.layers['productos'].visibility = "hide";
				document.layers['zanahoria'].visibility = "hide";
				document.layers['empresa'].visibility = "hide";
				document.layers[menuName].visibility = "show";
			} else {
				document.all['productos'].style.visibility = "hidden";
				document.all['zanahoria'].style.visibility = "hidden";
				document.all['empresa'].style.visibility = "hidden";

				document.all[menuName].style.visibility = "visible";
			}
		} else {
			if (NS4) {
				document.layers[menuName].visibility = "hide";
			} else {
				document.all[menuName].style.visibility = "hidden";
			}
		}
	}
}

function change(Name,No) {
	if (document.images && (loaded == 1) && (document[Name])) {
		document[Name].src = eval("b_" + Name + No + ".src");
	}
	if (No == 1) {
		if (gotlayers) {
			popUp('productos',false);
			popUp('zanahoria',false);
			popUp('empresa',false);
		}
		if (Name != 'mirr') {
			change('mirr',0);
		}
		if (Name != 'qref') {
			change('qref',0);
		}
		if (Name != 'sear') {
			change('sear',0);
		}
		lastbutton = Name;
	}
}

function changebullet(Name,No) {
	if (document.images && (loaded == 1)) {
		document[Name].src = eval("b_bullet" + No + ".src");
	}
}

function hide() {
	if (document.images && (loaded == 1)) {
		change(lastbutton,0);
	}
}
