
function add_handler(elm,evT,fn,useCapture) {
    if(elm.addEventListener) {
	elm.addEventListener(evT, fn,useCapture);
	return true;
    } else if(elm.attachEvent) {
	var r = elm.attachEvent('on'+evT, fn)
	return r;
    } else {
	elm['on'+evT] = fn;
    }
}


function ie6hack() {
    if(document.all && document.getElementById) { // hack IE 
	var uls = document.getElementsByTagName("ul");
	var ols = document.getElementsByTagName("ul");
	ie6hack1(uls); ie6hack1(ols);
    }
}
function ie6hack1(uls) {
    for(var j=0; j<uls.length; j++) {
	var ul=uls[j]; var menu=0;
	var p=ul; while(p){if(p.className=="dropdown") {menu=1;break;}  p=p.parentNode;}
	if(menu) {
	    for(i=0; i<ul.childNodes.length; i++) {
		var n = ul.childNodes[i];
		if(n.nodeName.toLowerCase()=="li") {
		    n.onmouseover=function() { this.className+=" over";       }
		    n.onmouseout=function() { this.className=this.className.replace(" over", "");}
		}
	    }
	}
    }
}

add_handler(window, 'load', function(){ie6hack()});

function popup_video(url,name, width,height) {
    var popupwin=window.open(url,name,"scrollbars=yes,resizable=yes,width="+width+",height="+height);
    if(window.focus){popupwin.window.focus();}
}

function is_x11() {
    var s=navigator.userAgent.toLowerCase();
    if(s.indexOf('x11')!=-1){ return(1);}
    return(0);
}

function final_setup() {
    if(is_x11()) {
	var a = document.getElementById('flashtext');
	if(a) {
	    a.style.visibility = "hidden";
	}
    }
}
