var menuTop = 40;
var menuLeft = 400;

var domSMenu = null;
var oldDomSMenu = null;
var t = 0;
var lDelay = 3;
var lCount = 0;
var pause = 100;

function popMenu(menuNum){
    if (isDHTML) {
        t = 2;
        if (oldDomSMenu) {
            oldDomSMenu.visibility =

'hidden';
            oldDomSMenu.zIndex =

'0';
            t = 2;
            lCount = 0;
        }

        var idMenu = 'menuHead';
        var domMenu =

findDOM(idMenu,0);

        var idMenuOpt = 'menuHead' +

menuNum;
        var domMenuOpt =

findDOM(idMenuOpt,0);        

        var idSMenu = 'menu' + menuNum;
        var domSMenu =

findDOM(idSMenu,1);

    if (isID || isAll) {     
    var menuLeft = (domMenu.offsetLeft) +

(domMenuOpt.offsetLeft) - 10;
    var menuTop = (domMenu.offsetTop) +

(domMenu.offsetHeight) +34 ;
            }
        if (isLayers) {
    var menuLeft =

document.layers[idMenu].layers[idMenuOpt].pageX - 5;
    var menuTop = domMenu.pageY +

domMenu.clip.height - 5;
        }

        if (oldDomSMenu != domSMenu) {    
            domSMenu.left =

menuLeft;
            domSMenu.top =menuTop;
            domSMenu.visibility ='visible';
            domSMenu.zIndex = '100';
            oldDomSMenu =domSMenu;
        }
    else { oldDomSMenu = null; }
    }
    else { return null; }
}

function delayHide() {
    if ((oldDomSMenu) && (t == 0)) {

        oldDomSMenu.visibility = 'hidden';
        oldDomSMenu.zIndex = '0';
        oldDomSMenu = null;
        lCount = 0;
        return false;
    }

      if (isLayers) { 
        document.layers[idMenu].visibility='hidden';     document.layers[idMenu].zIndex = '0';
        document.layers[idMenu] = null;
        lCount = 0;
        return false; 
        }

    if (t == 2) { lCount = 0; return false; }

    if (t == 1) {
        lCount = lCount + 1;
        if (lDelay <= lCount) { t = 0; }
        if (lDelay >= lCount) { setTimeout('delayHide(' + t +

')',pause); }
    }
}

<!--
var win=null;


	function NewWindow(mypage,myname,w,h,scroll,pos){
		if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math .random()*(screen.width-w)):100;TopPosition=(screen.height)? Math.floor(Math.random()*((screen.height-h)-75)):100;}
		if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w) /2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
		else if((pos!="center" && pos!="random") ||  pos==null){LeftPosition=50;TopPosition=200}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes';
win=window.open(mypage,myname,settings);
		if(win.focus){win.focus();}}

function SmallWindow(mypage,myname,w,h,scroll,pos){
		if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math .random()*(screen.width-w)):100;TopPosition=(screen.height)? Math.floor(Math.random()*((screen.height-h)-75)):100;}
		if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w) /2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
		else if((pos!="center" && pos!="random") ||  pos==null){LeftPosition=50;TopPosition=100}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=yes,resizable=yes';
win=window.open(mypage,myname,settings);
		if(win.focus){win.focus();}}


function HotelWindow(mypage,myname,w,h,scroll,pos){
		if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math .random()*(screen.width-w)):100;TopPosition=(screen.height)? Math.floor(Math.random()*((screen.height-h)-75)):100;}
		if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w) /2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
		else if((pos!="center" && pos!="random") ||  pos==null){LeftPosition=50;TopPosition=200}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=yes,resizable=yes';
win=window.open(mypage,myname,settings);
		if(win.focus){win.focus();}}

// -->

function findLivePageWidth() {
	if (window.innerWidth != null)
		return window.innerWidth;
	if (document.body.clientWidth != null)
		return document.body.clientWidth;
		return (null);
}

function popUp(evt,objectID){
	if (isDHTML) {
		var livePageWidth = findLivePageWidth();
		domStyle = findDOM(objectID,1);
		dom = findDOM(objectID,0);
		state = domStyle.visibility;
		if (dom.offsetWidth) elemWidth = dom.offsetWidth;
	else { if (dom.clip.width) elemWidth = dom.clip.width; }
	if (state == "visible" || state == "show") {domStyle.visibility = "hidden"; }
	else {
		if (evt.pageY) {
			topVal = evt.pageY + 16;
			leftVal = evt.pageX - (elemWidth / 6);
		}
		else {
			if (evt.y) {
			topVal = evt.y +16 +document.body.scrollTop;
			leftVal = evt.x - (elemWidth / 6) + document.body.scrollLeft;
			}
		}
		if(leftVal < 2) {leftVal = 2;}
		else {
			if ((leftVal + elemWidth) > livePageWidth) { leftVal = leftVal - (elemWidth / 2); }
		}
		domStyle.top = topVal; // Positions the element from the top
		domStyle.left = leftVal; // Positions the element from the left
		domStyle.visibility = "visible"; // Makes the element visible
		}
	}
}

