﻿/*
function showsub ( submenu  ) {
	this = getElementById(submenu);  
	this.style.visibility = 'visible'; 
}
function hidesub ( submenu  ) {
	this = getElementById(submenu);  
	this.style.visibility = 'hidden'; 
}
*/
function showSub(submenu) {
    document.getElementById('submenu1').style.visibility = 'hidden' ;
    document.getElementById('submenu2').style.visibility = 'hidden' ;
//    document.getElementById('submenu3').style.visibility = 'visible' ;
//    document.getElementById('submenu4').style.visibility = 'visible' ;
//    document.getElementById('submenu5').style.visibility = 'visible' ;
/*
    var IE = (whichBrs()=='Internet Explorer');
    if (!IE) document.captureEvents(Event.MOUSEMOVE)
    var mouseX = 0
    var mouseY = 0
    if (IE) { // grab the x-y pos.s if browser is IE
*/
        mouseX = event.clientX + document.body.scrollLeft
        mouseY = event.clientY + document.body.scrollTop
/*
    } else {  // grab the x-y pos.s if browser is NS
        mouseX = e.pageX
        mouseY = e.pageY
    }  
    // catch possible negative values in NS4
    if (mouseX < 0) {mouseX = 0}
    if (mouseY < 0) {mouseY = 0}  
*/
    document.getElementById(submenu).style.left = mouseX ;
    document.getElementById(submenu).style.top = mouseY ;
    document.getElementById(submenu).style.visibility = 'visible' ;
}
function showSubX(submenu) {
    document.getElementById(submenu).style.visibility = 'visible' ;
}
function hideSub(submenu) {
	mouseX = event.clientX + document.body.scrollLeft
	mouseY = event.clientY + document.body.scrollTop
    if (document.getElementById(submenu).style.left + document.getElementById(submenu).style.top + document.getElementById(submenu).style.visibility != mouseX+'px'+mouseY+'pxvisible') 
        document.getElementById(submenu).style.visibility = 'hidden' ;
}

function toggleHide(id) {
	if (document.getElementById(id).style.visibility=='visible') {
		document.getElementById(id).style.visibility='hidden'; 
	} else {
		document.getElementById(id).style.visibility='visible'; 
	}
}

function whichBrs() {
    var agt=navigator.userAgent.toLowerCase();
    if (agt.indexOf("opera") != -1) return 'Opera';
    if (agt.indexOf("staroffice") != -1) return 'Star Office';
    if (agt.indexOf("webtv") != -1) return 'WebTV';
    if (agt.indexOf("beonex") != -1) return 'Beonex';
    if (agt.indexOf("chimera") != -1) return 'Chimera';
    if (agt.indexOf("netpositive") != -1) return 'NetPositive';
    if (agt.indexOf("phoenix") != -1) return 'Phoenix';
    if (agt.indexOf("firefox") != -1) return 'Firefox';
    if (agt.indexOf("safari") != -1) return 'Safari';
    if (agt.indexOf("skipstone") != -1) return 'SkipStone';
    if (agt.indexOf("msie") != -1) return 'Internet Explorer';
    if (agt.indexOf("netscape") != -1) return 'Netscape';
    if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
    if (agt.indexOf('\/') != -1) {
        if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
            return navigator.userAgent.substr(0,agt.indexOf('\/'));
        } else 
            return 'Netscape';
    } else if (agt.indexOf(' ') != -1)
        return navigator.userAgent.substr(0,agt.indexOf(' '));
    else 
        return navigator.userAgent;
}