
var mnu = "&mnu=";
var homepage = "index.asp"


//Function Show ( layerId ) - Takes the numeric id and shows the given menu container.  
//Also swaps the arrow picture in the given Menu itemId
function show( layerId )
{
	//Test to make sure the object is valid and browser is IE compatible
    if ( document.getElementById && document.getElementById( "menuCont-" + layerId ) )
    {
        if ( document.getElementById( "menuCont-" + layerId ).className == "MenuContainerHidden" )
		{
			//Expand the sub menu of this id and create the string to pass the menu info to the next page
            document.getElementById( "menuCont-" + layerId ).className = "MenuContainerVisible";
			//mnu = mnu + "&mnu=" + layerId;
			mnu = mnu + layerId + ",";
			
			//Swap the Arrow picture of the Menu Item if it exists
			if ( document.getElementById( "menuItemPic-" + layerId ) )
				document.getElementById( "menuItemPic-" + layerId ).src = "images/menu1-arrow02.gif";
		}
        else
		{
			//Hide the sub menu of this id and remove that var from the string to pass
            document.getElementById( "menuCont-" + layerId ).className = "MenuContainerHidden";
			//mnu = mnu.replace( "&mnu=" + layerId, "" );
			mnu = mnu.replace( layerId + ",", "" );
			
			//Swap the Arrow picture of the Menu Item if it exists
			if ( document.getElementById( "menuItemPic-" + layerId ) )
				document.getElementById( "menuItemPic-" + layerId ).src = "images/menu1-arrow01.gif";
		}
    }
}


//Function Over( obj )  -  Takes an obj ref and depending on the class, 
//sets it to a mouseOver version of the class.
function menuOver( obj )
{
    if ( obj.className == "Category" )
        obj.className = "CategoryOver";

    else if ( obj.className == "CategoryOver" )
        obj.className = "Category";

    else if ( obj.className == "MenuItem" )
        obj.className = "MenuItemOver";

    else if ( obj.className == "MenuItemOver" )
        obj.className = "MenuItem";
        
    else if ( obj.className == "Res" )
        obj.className = "ResOver";

    else if ( obj.className == "ResOver" )
        obj.className = "Res";
}


//Function action( pass ) - Takes an argument to pass along in the href and then
//redirects the browser. usually pass should = an action or rec_id
function action( pass )
{
    window.location = homepage + "?" + pass + mnu;
}


//Function redirect( url ) - Takes a url argument to redirect the user.  If this url is
//external it should begin with 'http://' and will then be opened in a separate window.
//If it does not then the link will be treated as relative and open in the same window.
function redirect( url )
{
	if ( url != "" )
	{
		
		if ( url.substring( 0, 7 ) == "http://" )
		{	//Open a link in a new window
			window.open( url ); 
		}
		else
		{	//Open the link in the same window - Does not pass menu information
			 window.location = url
		}
	}
}


