
	// Global JavaScript Document

	_d = document;
	var is_gecko = (navigator.userAgent.toLowerCase().indexOf('gecko') != -1);

	_d.write('<scr' + 'ipt src="/library/js/sniffer.js" type="text/javascript"><\/scr' + 'ipt>');
	//  HM_array 
	_d.write('<scr' + 'ipt src="/library/js/hiermenus/HM_Loader.js" type="text/javascript"><\/scr' + 'ipt>');

	// Global Init
	onload = globalInit

	function globalInit()
	{
		// Logo clickable	
		document.getElementById("logo").innerHTML = '<a href="/" style="display:block; width:257px; height:83px">&nbsp;</a>';
		document.getElementById("function").innerHTML = '<a href="/" style="display:block; width:116px; height:55px; border:0; margin:0 0 0 35px">&nbsp;</a>' + document.getElementById("function").innerHTML;
		document.getElementById("headArea").style.visibility = "visible";
		
		if(window.currentRub && window.currentRub > 0 && document.getElementById("n"+currentRub)) document.getElementById("n"+currentRub).className = "current";

		if(window.currentRub_intern && window.currentRub_intern > 0 && document.getElementById("n"+currentRub_intern)) document.getElementById("n"+currentRub_intern).className = "current-item";
		

		//
		localInit();
		//
		popupInit();
		
		num_level = 6
		for(i=0;i<num_level;i++)
		{
			if(is_gecko)
			{
				eval('_d.getElementById("n'+(i+1)+'").addEventListener("mouseover",function(e){HM_f_PopUp(\'elMenu'+(i+1)+'\',e)},true)');
				eval('_d.getElementById("n'+(i+1)+'").addEventListener("mouseout",function(e){HM_f_PopDown(\'elMenu'+(i+1)+'\')},true)');
			}
			else
			{
				eval('_d.getElementById("n'+(i+1)+'").onmouseover = new Function("HM_f_PopUp(\'elMenu'+(i+1)+'\',event)")');
				eval('_d.getElementById("n'+(i+1)+'").onmouseout  = new Function("HM_f_PopDown(\'elMenu'+(i+1)+'\')")');
			}
		}
	}

	// HM Array Functions
	if(window.event + "" == "undefined") event = null;

	function HM_f_PopUp()
	{
		return false
	};

	function HM_f_PopDown()
	{
		return false
	};

	popUp = HM_f_PopUp;
	popDown = HM_f_PopDown;

	function display_on(){for(i=0;i<display_array.length;i++) display_array[i].style.visibility = "hidden";}
	function display_off(){for(i=0;i<display_array.length;i++) display_array[i].style.visibility = "visible";}

	function getPageOffsetLeft(el)
	{
		var x;
		// Return the x coordinate of an element relative to the page.
		x = el.offsetLeft;
		if(el.offsetParent != null) x += getPageOffsetLeft(el.offsetParent)
		return x;
	}
	
	function getPageOffsetTop(el)
	{
		var y;
		// Return the x coordinate of an element relative to the page.
		y = el.offsetTop;
		if(el.offsetParent != null) y += getPageOffsetTop(el.offsetParent);
		return y;
	}

	function GetOffset(obj,coord)
	{	
		var val = obj["offset"+coord] ;
		if(coord == "Top") val += obj.offsetHeight;
		while((obj = obj.offsetParent) != null)
		{
			val += obj["offset"+coord];
			if(obj.border && obj.border != 0) val++;
		}
		return val;
	}

	function gn(type,id,p)
	{
		el = document.createElement(type);
		el.id = id;
		if(p) document.getElementById(p).appendChild(el)
		else document.body.appendChild(el)
	}
	function gb(id){return document.getElementById(id)}


	function dynamichide(e,obj)
	{
		if(is_ie && !gb(obj).contains(e.toElement)) VHpopOut()
		else if(is_gecko && e.currentTarget!= e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget)) VHpopOut()
	}

	function contains_ns6(a,b)
	{
		// Determines if 1 element in contained in another - by Brainjar.com
		while(b.parentNode){if((b = b.parentNode) == a) return true;}
		return false;
	}

	// Init function...
	var isLoaded = false;
	function popupInit()
	{
		gn("div","divTooltip");
		gb("divTooltip").className = "tooltip-style";

		tooltip = new makeTooltip('divTooltip');

		tooltip.elm.onmouseover = function(){clearTimeout(tooltip.popTimer);}

		if(is_ie) tooltip.elm.onmouseout = function(){dynamichide(event,"divTooltip");};
		else tooltip.elm.addEventListener("mouseout",function(e){dynamichide(e,"divTooltip")},true);

		if(is_ie && is_win && !is_ie4) tooltip.css.filter = 'alpha(opacity=100)'; //Preloads the windows filters.
		isLoaded = true;
	};

	// To have more descriptions just add to the array.
	
	useFading = 1        		// 1 for a fading effect in windows explorer 5+ and all platforms ns6, 0 for no fading effect.
	fadingDuration = 1;       
	delay = 50          		// The time before showing the popup, in milliseconds.
	delayToHide = 1000          	// The time before hidding the popup, in milliseconds.
	
	// object constructor...
	function makeTooltip(obj)
	{								
		this.elm = document.getElementById(obj)
		this.css = this.elm.style;
		this.wref = this.elm;
		this.obj= obj+'makeTooltip';
		eval(this.obj+'=this');
		this.w = this.elm.offsetWidth;
		this.h = this.elm.offsetHeight;
	};

	makeTooltip.prototype.measureIt = function()
	{
		this.w = this.elm.offsetWidth;
		this.h = this.elm.offsetHeight;
	};

	makeTooltip.prototype.writeIt = function(text)
	{
		this.wref.innerHTML = text;
	};
	
	function placeIt(t)
	{
		tooltip.css.left = GetOffset(t,"Left") + "px";
		tooltip.css.top = (GetOffset(t,"Top") + 2) + "px";
	};
	
	// Main popUp function.
	var hovering = false;
	makeTooltip.prototype.showTimer= null;
	function VHpopUp(t,w)
	{
		if(isLoaded)
		{
			clearTimeout(tooltip.popTimer);
			//dopopOut();

			tooltip.writeIt(w);
			hovering = true;
			
			tooltip.measureIt();
			placeIt(t);

			if(useFading) tooltip.showTimer = setTimeout('tooltip.blendIn()',delay);
			if(!useFading) tooltip.showTimer = setTimeout('tooltip.css.visibility="visible"',delay);
		}
	};
	
	// Hiding routines
	makeTooltip.prototype.popTimer = null;
	function VHpopOut()
	{
		if(isLoaded) tooltip.popTimer = setTimeout('dopopOut()',delayToHide)
	};

	function dopopOut()
	{
		hovering = false;
		clearTimeout(tooltip.showTimer);
		tooltip.css.visibility = 'hidden';
		clearTimeout(tooltip.fadeTimer);
		tooltip.i = 0;
	};
		
	// Opacity methods.
	makeTooltip.prototype.blendIn = function()
	{
		if (is_ie && is_win && !is_ie4) {
			this.css.filter= 'blendTrans(duration='+(fadingDuration/10)+')';
			this.elm.filters.blendTrans.apply();
			this.css.visibility = 'visible';
			this.elm.filters.blendTrans.play();
		}
		else {
			this.css.visibility = 'visible';
			this.fadeIt();
		}
	};
	makeTooltip.prototype.step = 5;
	makeTooltip.prototype.i = 0;
	makeTooltip.prototype.fadeTimer = null;
	makeTooltip.prototype.fadeIt = function()
	{
		this.i += this.step;
	  	this.i = (this.i==100)?99.999:this.i;

		// Older Mozilla and Firefox
		this.css.MozOpacity = this.i/100;

		// Safari<1.2, Konqueror
		this.css.KHTMLOpacity = this.i/100;

		// Safari 1.2, newer Firefox and Mozilla, CSS3
		this.css.opacity = this.i/100;

		if(this.i<99.999) this.fadeTimer = setTimeout(this.obj+'.fadeIt()',fadingDuration);
		else this.i= 0;
		//this.i = (this.i == 100)?99.999:this.i;

	};


