/*
son of suckerfish menu script from:
http://www.htmldog.com/articles/suckerfish/dropdowns/
 */
 sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
                sfEls[i].setAttribute("onmouseover", function() {
			        this.className+=" sfhover";
			        this.style.zIndex=200; //this line added to force flyout to be above relatively positioned stuff in IE
		        });
                sfEls[i].setAttribute("onmouseout", function() {
			        this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		        });
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


/* add script | begin*/
ieHover = function() {
    var ieULs = document.getElementById('nav').getElementsByTagName('ul');
    for (j=0; j<ieULs.length; j++) {
    ieULs[j].innerHTML = ('<iframe src="about:blank" scrolling="no" frameborder="0"></iframe>' + ieULs[j].innerHTML);
	    ieULs[j].style.zIndex="99";
    }
}
if (window.attachEvent) window.attachEvent('onload', ieHover);
/* add script | end */

function browser_class() {
	var b = navigator.appName
	this.b = (b=="Netscape")?"ns":(b=="Microsoft Internet Explorer")?"ie":b
	this.v = navigator.appVersion
	/*if (this.b=='ie') {
		var ve = this.version.indexOf("MSIE")
		this.v = parseInt(this.version.substr(ve+4))
	}else this.v = parseInt(this.version)*/
	this.opera = (navigator.userAgent.indexOf('Opera') != -1)?1:0	
	//this.ns4 = (document.layers)?1:0
	this.ns4 = (document.layers && !this.dom)?1:0;
	this.ns6 = (document.getElementById && !document.all && this.b == 'ns')?1:0
	this.ie = (document.all)?1:0
	this.ie4=(document.all && !this.dom && !this.opera)?1:0
	//this.ie4 = (document.all && !document.getElementById)?1:0
	this.ie5 = (document.all && document.getElementById)?1:0
	this.ie5mac = (navigator.userAgent.indexOf('MSIE 5') != -1 && navigator.userAgent.indexOf('Mac') != -1)
	this.ie55 = (this.ie5 &&  this.v.indexOf('MSIE 5.5')>0)?1:0
	this.ie6 = (this.ie5 &&  this.v.indexOf('MSIE 6.0')>0)?1:0
	this.dom = (document.getElementById)?1:0
	this.w3cdom = (!this.ie5mac && document.getElementsByTagName && document.createElement)?1:0
	this.newBrNotIE = (!this.ie && document.getElementById)?1:0
}

br = new browser_class()
//if (!(is.ie55 || is.ie6)) window.location.href = 'atnaujinkite.htm'


////
//
//		frame:		turi buti pilno "kelio" stringas, pvz.: 'top.frameTop'
//						arba gali buti nuoroda i freimo objekta
//
////
function findObj(id,frame) {
	var d; if (frame) d = typeof(frame)=='object' ? frame.document : eval(frame+'.document')
	else d = window.document
	if (document.getElementById) return d.getElementById(id)
	if (document.all) return d.all(id)
	return false
}

////
//
//		CSS
//
////
function classOver(obj,classOver)
{
	if (!br.dom) return;
	if (!obj.normal_class) obj.normal_class = obj.className
	obj.className = classOver
	//if (!obj.onmouseout) obj.onmouseout = classOut
}

function classOut(obj)
{
	if (!br.dom) return;
	obj.className = obj.normal_class
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
