
// This is the image mouseover script
function msover(doc_item,textimage)
    {document[doc_item].src=textimage;}

//This is the new window script
function OpenWin(theURL,winName,features) {
	window.open(theURL,winName,features);
}
    
//This removes the link border on images
function RemoveDot()
{
for (a in document.links) document.links[a].onfocus = document.links[a].blur;
}
if (document.all)
{
document.onmousedown = RemoveDot;
}


//Open new window script
function openPopup(phref, pname, pwidth, pheight, pmenu, pstatus, pscroll, ploc, presize, ptitle, ptoolbar) {
	 var attributes = '';
	 attributes = attributes + ',width=' + pwidth;
	 attributes = attributes + ',height=' + pheight;
	 attributes = attributes + ',left=' +(screen.width - pwidth) / 2;
	 attributes = attributes + ',top=' +(screen.height - pheight) / 2;
	 attributes = attributes + ',menubar=' + (pmenu==1?'yes':'no');
	 attributes = attributes + ',status=' + (pstatus==1?'yes':'no');
	 attributes = attributes + ',scrollbars=' + (pscroll==1?'yes':'no');
	 attributes = attributes + ',location=' + (ploc==1?'yes':'no');
	 attributes = attributes + ',titlebar=' + (ptitle==1?'yes':'no');
	 attributes = attributes + ',toolbar=' + (ptoolbar==1?'yes':'no');
	 attributes = attributes + ',resizable=' + (presize==1?'yes':'no');
	 attributes = attributes.substring(1,attributes.length);
	 var Popup = window.open(phref, pname, attributes);
}


//This is the menu fade-in fade-out script
menufadeObjects = new Object();
menufadeTimers = new Object();

function menufade(object, destOp, loopdelay, changepercentage){
if (!document.all)
return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("menufade("+object+","+destOp+","+loopdelay+","+changepercentage+")",0);
        return;
    }
        
    clearTimeout(menufadeTimers[object.sourceIndex]);
    
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    changepercentage=Math.min(direction*diff,changepercentage);
    object.filters.alpha.opacity+=direction*changepercentage;

    if (object.filters.alpha.opacity != destOp){
        menufadeObjects[object.sourceIndex]=object;
        menufadeTimers[object.sourceIndex]=setTimeout("menufade(menufadeObjects["+object.sourceIndex+"],"+destOp+","+loopdelay+","+changepercentage+")",loopdelay);
    }
}

//This is the popup menu script
	var intnumofmenuitems=8;
	var visibleVar="null";  

	layerStyleRef="layer.style.";
	layerRef="document.getElementById"; //used to be document.all but threw js errors in FF
	styleSwitch=".style";
	visibleVar="visible";

	function menu(layerName){
		showLayer(layerName);
	}
	function hideLayer(layerName){
		eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="hidden"');
			removeothermenus(layerName);
	}       

	function showLayer(layerName){
		eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="visible"');
			removeothermenus(layerName);
	}
	function removeothermenus(layerName){
		intmenunumber=intnumofmenuitems;                
		while (intmenunumber>0){
		intcountdown="Submenu"+intmenunumber;
		
		if (intcountdown!=layerName){
			eval(layerRef+'("'+intcountdown+'")'+styleSwitch+'.visibility="hidden"');
		}
		
		intmenunumber-=1;
		intcountdown="Submenu"+intmenunumber;
		}
	}

//This is the popup menu script
                var intnumofmenuitems=4;
                var visibleVar="null";  

        //if (navigator.appName == "Netscape") {
        //        layerStyleRef="layer.";
        //       layerRef="document.layers";
        //        styleSwitch="";
        //        visibleVar="show";
        //}

        //else{
                layerStyleRef="layer.style.";
                layerRef="document.getElementById";
                styleSwitch=".style";
                visibleVar="visible";
               // }

        function menu(layerName){
        var vers = navigator.appVersion;
                if (vers >= '4'){
                        showLayer(layerName);
                }
                //else if (vers > '4'){
                //        showLayer(layerName);
                //}
                //else if (vers < '4'){
                //}

        }
        function hideLayer(layerName){
                //eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="hidden"');
                eval(layerRef+'("'+layerName+'")'+styleSwitch+'.display="none"');
                        removeothermenus(layerName);
        }       

        function showLayer(layerName){
                //eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="visible"');
                eval(layerRef+'("'+layerName+'")'+styleSwitch+'.display="block"');
                        removeothermenus(layerName);
        }
        function removeothermenus(layerName){

                intmenunumber=intnumofmenuitems;                
                while (intmenunumber>0){
                intcountdown="Submenu"+intmenunumber;
                        if (intcountdown!=layerName){
                                //eval(layerRef+'("'+intcountdown+'")'+styleSwitch+'.visibility="hidden"');
                                eval(layerRef+'("'+intcountdown+'")'+styleSwitch+'.display="none"');
                        }
                intmenunumber-=1;
                intcountdown="Submenu"+intmenunumber;
                }
        }

