
	var bref = new String(location), hFade = 0;
	var i = bref.lastIndexOf("/"), j = bref.lastIndexOf("\\"); if (j > i) i = j;
	if (i < 0) bref = ""; else bref = bref.slice(0, i + 1);

	var rootdoc, firstHide = 1;

	if (document.getElementsByTagName) rootdoc = window.document;
	else if (document.layers)
	{
		window.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT | Event.MOUSEDOWN | Event.MOUSEUP);
		window.onMouseOver = Over;
		window.onMouseOut = Out;
		window.onMouseDown = Down;
		window.onMouseUp = Up;

		document.captureEvents(Event.KEYPRESS);
		document.onkeypress = NSType;

		rootdoc = document["navbar"].document;
	}
	
	var edcd = window.parent.frames[0].edCD;
	
	if ((!document.all) && (document.getElementsByTagName))
	{
		document.captureEvents(Event.KEYPRESS | Event.SUBMIT);
		document.onkeypress = ns6Press;
		document.onsubmit = ns6CancelSubmit;
	}




	function getParRef() 
	{
		if (typeof(window.parent.frames[1]) == "undefined") return "";
	
		if (window.parent.frames[1].bhref) {var parRef = new String(window.parent.frames[1].bhref); return parRef;}
		else
		{
			var parRef = new String(window.parent.frames[1].document.location);
			var i = parRef.lastIndexOf("/"), j = parRef.lastIndexOf("\\"); if (j > i) i = j;
			if (i < 0) parRef = ""; else parRef = parRef.slice(0, i + 1);
		}
		return parRef;
	}

	function invalidKeyin(code, text) 
	{
		if (code == 13) {goToPage(); return true;}
		return false;
	}
	function NSType(e) 
	{
		if (e.target.name == "pag") if (invalidKeyin(e.which, e.target.value)) return false;
	}

	function processKeyIE() 
	{
		if (typeof(event) == "object") if (invalidKeyin(event.keyCode, this.value)) event.returnValue = false;
	}

	function ns6Press(e) 
	{
		invalidKeyin(e.which, e.target.value);
	}
	
	function ns6CancelSubmit(e) 
	{
		e.preventDefault();
	}

	function ImgOver(s) 
	{
		if (s.indexOf("_out.") >= 0) return (s.slice(0, s.lastIndexOf("_out.")) + "_over.gif");
		else return s;
	}

	function ImgOut(s) 
	{
		if (s.indexOf("_over.") >= 0) return (s.slice(0, s.lastIndexOf("_over.")) + "_out.gif");
		else return s;
	}

	function Over(e) 
	{
		if (e.target.src) if (e.target.src.indexOf("/butoane/") >= 0) e.target.src = ImgOver(e.target.src);
	}

	function Out(e) 
	{
		if (e.target.src) if (e.target.src.indexOf("/butoane/") >= 0) e.target.src = ImgOut(e.target.src);
	}

	function Down(e) 
	{
	}
	
	function parentHasForm() 
	{
		if (typeof(window.parent.frames[1]) == "undefined") return 0;
		if (typeof(window.parent.frames[1].document) == "undefined") return 0;
		if (typeof(window.parent.frames[1].document.forms["browse"]) == "undefined") return 0;

		return 1;
	}
	
	function parentHasNav() 
	{
		if (typeof(window.parent.frames[1]) == "undefined") return 0;
		if (typeof(window.parent.frames[1].document) == "undefined") return 0;
		if (typeof(window.parent.frames[1].document.forms["navigation"]) == "undefined") return 0;

		return 1;
	}
	
	function goToPage() 
	{
		if (edcd) return;
		
		disAll();
		
		if (!parentHasForm()) return;
		
		var pn = new String();

		if (document.getElementsByTagName) {pn = document.navForm.pag.value; document.navForm.pag.value = "";}
		else if (document.layers) {pn = document.layers[0].document.navForm.pag.value; document.layers[0].document.navForm.pag.value = "";}
		
		window.parent.frames[1].document.forms["browse"].action = getParRef() + "../../../../scripts/GoToPage.asp";
		window.parent.frames[1].document.forms["browse"].strNumePagina.value = pn;
		window.parent.frames[1].document.forms["browse"].submit();
	}
	
	function coperta()
	{
		if (edcd) return;
		var pr = new String(getParRef());
		pr = pr.slice(pr.indexOf("//") + 2);
		for (i = 0; i < 3; i++) pr = pr.slice(pr.indexOf("/") + 1);
		var volid = parseInt(pr.slice(0, pr.indexOf("/")));
		window.parent.frames[1].location = getParRef() + "../../../../scripts/CopertaVolum.asp?volid=" + volid;
	}

	function Up(e) 
	{
		if (e.target.src) if (e.target.src.indexOf("/butoane/") >= 0) if (e.target.src.indexOf("_") >= 0) if (e.target.src.indexOf("_dis.") < 0)
		{
			var bimg = new String(e.target.src);
			bimg = bimg.slice(bimg.lastIndexOf("/") + 1);
			bimg = bimg.slice(0, bimg.lastIndexOf("_"));
			
			if (bimg == "go") goToPage();
			else if (bimg == "coperta") coperta();
			else
			{
				disAll();

				if (!parentHasForm()) return;

				window.parent.frames[1].document.forms["browse"].method = "GET";
				window.parent.frames[1].document.forms["browse"].action = getParRef() + eval("window.parent.frames[1].document.forms['navigation']." + bimg + ".value");
				window.parent.frames[1].document.forms["browse"].submit();
			}
		}
	}
	
	function NavIE(e) 
	{
		if (document.layers) return;
		var getIn = 0;
		if (typeof(event) == "object")
		{
			if (event.srcElement.src) if (event.srcElement.src.indexOf("/butoane/") >= 0) if (event.srcElement.src.indexOf("_dis.") < 0) getIn = 1;
		}
		else
		{
			if (e.indexOf("/butoane/") >= 0) if (e.indexOf("_dis.") < 0) getIn = 1;
		}
		
		if (getIn)
		{
			var bimg = new String();
			if (typeof(event) == "object") bimg = event.srcElement.src;
			else bimg = e;
			
			bimg = bimg.slice(bimg.lastIndexOf("/") + 1);
			bimg = bimg.slice(0, bimg.lastIndexOf("_"));
			
			if (bimg == "go") goToPage();
			else if (bimg == "coperta") coperta();
			else
			{
				disAll();

				if (!parentHasForm()) return;

				window.parent.frames[1].document.forms["browse"].method = "GET";
				window.parent.frames[1].document.forms["browse"].action = getParRef() + eval("window.parent.frames[1].document.forms['navigation']." + bimg + ".value");
				window.parent.frames[1].document.forms["browse"].submit();
			}
		}
	}

	function disAll() 
	{
		for (i = 0; i < rootdoc.images.length; i++)
		{
			if (getImgTrunc(rootdoc.images[i].src).indexOf("_") >= 0)
			{
				fc = new String(rootdoc.images[i].src);
				rootdoc.images[i].src = fc.slice(0, fc.lastIndexOf("_")) + "_dis.gif";
			}
		}
	}
	
	function getImgTrunc(full) 
	{
		var k = full.lastIndexOf("/"), l = full.lastIndexOf("\\"); if (l > k) k = l;
		if (k >= 0) return full.slice(k + 1); else return full;
	}

	function setImg(imgname, imgindx) 
	{
		if (!parentHasNav()) return;
	
		if (eval("window.parent.frames[1].document.forms['navigation']." + imgname + ".value"))
		{
			if (rootdoc.images[imgindx].src.indexOf("_dis") >= 0)
			rootdoc.images[imgindx].src = bref + "../butoane/" + imgname + "_out.gif";
		}
		else
			rootdoc.images[imgindx].src = bref + "../butoane/" + imgname + "_dis.gif";
	}
	
	function fadeBar() 
	{
		var fc = new String(window.parent.document.getElementsByTagName("FRAMESET")[0].rows);
		var cn = parseInt(fc.slice(fc.lastIndexOf(",") + 2));
		if (cn > 0)
		{
			if (firstHide) {firstHide = 0; cn = 0;}
			else {cn -= 3; if (cn < 0) cn = 0;}
			fc = fc.slice(0, fc.lastIndexOf(",")) + ", " + cn;
			window.parent.document.getElementsByTagName("FRAMESET")[0].rows = fc;
			hFade = window.setTimeout("fadeBar()", 10, "");
		}
		else
		{
			hFade = 0;
			navbar.style.visibility = "hidden";
		}
	}
	
	function hideBar() 
	{
		hTimer = 0;
		if (document.all) fadeBar();
		else if (document.layers)
		{
			document["navbar"].visibility = "hidden";
			document["blind"].visibility = "visible";
		}
		else if (document.getElementsByTagName)
		{
			document.getElementById("navbar").style.visibility = "hidden";
			document.getElementById("blind6").style.visibility = "visible";
		}
	}

	function Update() 
	{
		if (hTimer) {window.clearTimeout(hTimer); hTimer = 0;}
		
		var hasmenu = 0;
		if (!window.parent.frames[1].document) return;

		hasmenu = parentHasNav();

		if (hasmenu)
		{
			for (i = 0; i < rootdoc.images.length; i++)
			if (getImgTrunc(rootdoc.images[i].src).indexOf("_") >= 0)
			if  (rootdoc.images[i].src.indexOf("/go_") >= 0)
			{
				if (edcd) rootdoc.images[i].src = bref + "../butoane/go_dis.gif";
				else rootdoc.images[i].src = bref + "../butoane/go_out.gif";
			}
			else if  (rootdoc.images[i].src.indexOf("/coperta_") >= 0)
			{
				if (edcd) rootdoc.images[i].src = bref + "../butoane/coperta_dis.gif";
				else rootdoc.images[i].src = bref + "../butoane/coperta_out.gif";
			}
			else
			{
				fc = new String(rootdoc.images[i].src);
				fc = fc.slice(fc.lastIndexOf("/") + 1);
				fc = fc.slice(0, fc.lastIndexOf("_"));
				if (fc != "go") setImg(fc, i);
			}
			
			if (document.getElementsByTagName)
			{
				if (hFade) {window.clearTimeout(hFade); hFade = 0;}
				document.getElementById("blind6").style.visibility = "hidden";
				document.getElementById("navbar").style.visibility = "visible";
				if (document.all)
				{
					fc = new String(window.parent.document.getElementsByTagName("FRAMESET")[0].rows);
					fc = fc.slice(0, fc.lastIndexOf(",")) + ", 43 ";
					window.parent.document.getElementsByTagName("FRAMESET")[0].rows = fc;
				}
			}
			else if (document.layers)
			{
				document["navbar"].visibility = "visible";
				document["blind"].visibility = "hidden";
			}
		}
		else
		{
			disAll(); hideBar();
		}
	}


	var hTimer = window.setTimeout("hideBar()", 500, "");