
<!-- Change Browse -->
function menuchangeBrowse(urlName1, urlName2, idName1){

menu(idName1,'hidden',255);

changeBrowse(urlName1, urlName2);

}

var timerID;

function resettimer(){
	if (timerID)
	clearTimeout(timerID);

}

function starttimer(){
	if (timerID)
	clearTimeout(timerID);

	timerID  = setTimeout("menu('', '', 255)", 1000);
}

var stimerID;

function resettimerm(){
	if (stimerID)
	clearTimeout(stimerID);

}

function starttimerm(){
	if (stimerID)
	clearTimeout(stimerID);

	stimerID  = setTimeout("showmenu()", 1000);
}

<!-- Change Browse -->
function changeBrowse(urlName1, urlName2){

if(navigator.userAgent.indexOf("MSIE") != -1){
parent.document.location.href = urlName2;
}else{
parent.document.location.replace(urlName2);
}

}

var lastid0;
var lastid1;
var lastid2;
var lastid3;
var lastid4;

lastid0 = "";
lastid1 = "";
lastid2 = "";
lastid3 = "";
lastid4 = "";

<!-- Down Img -->
function menuimgDown(idName,imgName){
	document[idName].src = eval(imgName + "_down.src");
}

<!-- Up Img -->
function menuimgUp(idName,imgName){
	document[idName].src = eval(imgName + "_up.src");
}

<!-- On Img -->
function menuimgOn(idName,imgName){
	document[idName].src = eval(imgName + "_on.src");
}

<!-- Display menu -->
function menu(idName1, state, level){

if(navigator.userAgent.indexOf("MSIE") != -1){

	<!-- Show menu -->
	if(level == 0){
		if(lastid0 != ""){
			eval("document.all[lastid0].style.visibility = 'hidden'");
			closeShim(document.all[lastid0]);
		}
		if(lastid1 != ""){
			eval("document.all[lastid1].style.visibility = 'hidden'");
			closeShim(document.all[lastid1]);
		}
		if(lastid2 != ""){
			eval("document.all[lastid2].style.visibility = 'hidden'");
			closeShim(document.all[lastid2]);
		}
		if(lastid3 != ""){
			eval("document.all[lastid3].style.visibility = 'hidden'");
			closeShim(document.all[lastid3]);
		}
	}

	if(level == 1){
		if(lastid1 != ""){
			eval("document.all[lastid1].style.visibility = 'hidden'");
			closeShim(document.all[lastid1]);
		}
		if(lastid2 != ""){
			eval("document.all[lastid2].style.visibility = 'hidden'");
			closeShim(document.all[lastid2]);
		}
		if(lastid3 != ""){
			eval("document.all[lastid3].style.visibility = 'hidden'");
			closeShim(document.all[lastid3]);
		}
	}

	if(level == 2){
		if(lastid2 != ""){
			eval("document.all[lastid2].style.visibility = 'hidden'");
			closeShim(document.all[lastid2]);
		}
		if(lastid3 != ""){
			eval("document.all[lastid3].style.visibility = 'hidden'");
			closeShim(document.all[lastid3]);
		}
	}

	if(level == 3){
		if(lastid3 != ""){
			eval("document.all[lastid3].style.visibility = 'hidden'");
			closeShim(document.all[lastid3]);
		}
	}

	<!-- hide all -->
	if(level == 255){
		if(lastid0 != ""){
			eval("document.all[lastid0].style.visibility = 'hidden'");
			closeShim(document.all[lastid0]);
		}
		if(lastid1 != ""){
			eval("document.all[lastid1].style.visibility = 'hidden'");
			closeShim(document.all[lastid1]);
		}
		if(lastid2 != ""){
			eval("document.all[lastid2].style.visibility = 'hidden'");
			closeShim(document.all[lastid2]);
		}
		if(lastid3 != ""){
			eval("document.all[lastid3].style.visibility = 'hidden'");
			closeShim(document.all[lastid3]);
		}

		lastid0 = '';
		lastid1 = '';
		lastid2 = '';
		lastid3 = '';
	}



	if(lastid0 != idName1){
	if(idName1 != ""){
	eval("document.all[idName1].style.visibility = state");
	openShim(document.all[idName1]);

	if (timerID)
	clearTimeout(timerID);

	timerID  = setTimeout("menu('', '', 255)", 2000);

	}
	}else{
	idName1 = "";
	}

	<!-- Store based on level -->
	if(level == 0){
		lastid0 = idName1;
	}

	if(level == 1){
		lastid1 = idName1;
	}

	if(level == 2){
		lastid2 = idName1;
	}

	if(level == 3){
		lastid3 = idName1;
	}

}else{
	<!-- Show menu -->
	<!-- Show menu -->
	if(level == 0){
		if(lastid0 != ""){
			document.getElementById(lastid0).style.visibility = 'hidden';
		}
		if(lastid1 != ""){
			document.getElementById(lastid1).style.visibility = 'hidden';
		}
		if(lastid2 != ""){
			document.getElementById(lastid2).style.visibility = 'hidden';
		}
		if(lastid3 != ""){
			document.getElementById(lastid3).style.visibility = 'hidden';
		}
	}

	if(level == 1){
		if(lastid1 != ""){
			document.getElementById(lastid1).style.visibility = 'hidden';
		}
		if(lastid2 != ""){
			document.getElementById(lastid2).style.visibility = 'hidden';
		}
		if(lastid3 != ""){
			document.getElementById(lastid3).style.visibility = 'hidden';
		}
	}

	if(level == 2){
		if(lastid2 != ""){
			document.getElementById(lastid2).style.visibility = 'hidden';
		}
		if(lastid3 != ""){
			document.getElementById(lastid3).style.visibility = 'hidden';
		}
	}

	if(level == 3){
		if(lastid3 != ""){
			document.getElementById(lastid3).style.visibility = 'hidden';
		}
	}

	<!-- hide all -->
	if(level == 255){
		if(lastid0 != ""){
			document.getElementById(lastid0).style.visibility = 'hidden';
		}
		if(lastid1 != ""){
			document.getElementById(lastid1).style.visibility = 'hidden';
		}
		if(lastid2 != ""){
			document.getElementById(lastid2).style.visibility = 'hidden';
		}
		if(lastid3 != ""){
			document.getElementById(lastid3).style.visibility = 'hidden';
		}
	}


	if(lastid0 != idName1){
	if(idName1 != ""){

	document.getElementById(idName1).style.visibility = state;

	}	
	}else{
	idName1 = "";
	}

	<!-- Store based on level -->
	if(level == 0){
		lastid0 = idName1;
	}

	if(level == 1){
		lastid1 = idName1;
	}

	if(level == 2){
		lastid2 = idName1;
	}

	if(level == 3){
		lastid3 = idName1;
	}
}
}

var busy = 0;
var timerID2;

function scroll()
{
//	var store;

//	store = document.body.scrollTop;

//	if (document.all['holder'].style.top > 0)
//	{
//	eval("document.body.scrollTop = document.all['holder'].style.top + 90");
//	openShim(document.all['holder']);
//	}else{
//	eval("document.body.scrollTop = 0");
//	}

//	eval("document.all['holder'].style.visibility = 'hidden'");

//	document.body.scrollTop = store;

//	if (timerID2)
//	clearTimeout(timerID2);

//	timerID2  = setTimeout("scrollpage()", 100);
	scrollpage();
}

function scrollpage()
{
//	eval("document.all['holder'].style.visibility = 'hidden'");

//	if (busy == 0)
//	{
 
//	busy = 1;
	document.redraw;
	if (document.body.scrollTop > 90)
	{
	eval("document.all['holder'].style.top = document.body.scrollTop-90");
	openShim(document.all['holder']);
	}else{
	eval("document.all['holder'].style.top = 0 ");
	closeShim(document.all['holder']);
	}

//	eval("document.all['holder'].style.visibility = 'visible'");
	document.redraw;
//	busy = 0;

//	starttimerm();

//	}
}

function showmenu()
{
	resettimerm();
	eval("document.all['holder'].style.visibility = 'visible'");
	document.redraw;
}

//Opens a shim, if no shim exists for the menu, one is created
function openShim(menu,menuItem)
{
	
return;

    if (menu==null) return;
    var shim = getShim(menu);
    if (shim==null) shim = createMenuShim(menu,getShimId(menu));
    
    //Change menu zIndex so shim can work with it
    menu.style.zIndex = 100;
    
    var width = (menu.offsetWidth == 0 ? menuItem.renderedWidth : menu.offsetWidth);
    var height;
    
    if (menu.offsetHeight == 0)
    {
        var menus = getMenuItemCount(menu);
        height = menuItem.renderedHeight * menus;
    }
    else
    {
        var height = menu.offsetHeight;
    }
    
    shim.style.width = width;
    shim.style.height = height;
    shim.style.top = menu.style.top;
    shim.style.left = menu.style.left;
    shim.style.zIndex = menu.style.zIndex - 1;
    shim.style.position = "relative";
    shim.style.display = "block";
    // shim.style.filter = "alpha (opacity=95)";
}

//Closes the shim associated with the menu
function closeShim(menu)
{
    if (menu==null) return;
    var shim = getShim(menu);
    if (shim!=null) shim.style.display = "none";
}

//Creates a new shim for the menu
function createMenuShim(menu)
{
    if (menu==null) return null;

    var shim = document.createElement("<iframe scrolling='no' frameborder='0'"+
                                      "style='position:absolute; top:0;"+
                                      "left:0; display:none'></iframe>"); 
    shim.name = getShimId(menu);
    shim.id = getShimId(menu);
    //Unremark this line if you need your menus to be transparent for some reason
//    shim.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";

    if (menu.offsetParent==null || menu.offsetParent.id=="") 
    {
        window.document.body.appendChild(shim);
    }
    else 
    {
        menu.offsetParent.appendChild(shim); 
    }

    return shim;
}

//Creates an id for the shim based on the menu id
function getShimId(menu)
{
    if (menu.id==null) return "__shim";
    return "__shim"+menu.id;
}

//Returns the shim for a specific menu
function getShim(menu)
{
    return document.getElementById(getShimId(menu));
}

function getMenuItemCount(menu)
{
    var count = 0;
    var child = menu.firstChild;

    while (child)
    {
        if (child.nodeName=="DIV") count = count + 1;
        child = child.nextSibling;
    }
    return count;    
}
