function HideShowDivs(id, show) 
{
    if ( show == 1 ) {
        // Hide windowed controls causing menu to be displayed improperly
    	toggleWindowedControls("hidden");
        document.getElementById(id).style.display='';
    }
    else {
        // Show windowed controls hidden before
    	toggleWindowedControls("visible");
        document.getElementById(id).style.display='none';
    }
}

function checkEnter(e){ //e is event object passed from function invocation
    var characterCode; //literal character code will be stored in this variable

    if(e && e.which){ //if which property of event object is supported (NN4)
        e = e;
        characterCode = e.which; //character code is contained in NN4's which property
    }
    else{
        e = event;
        characterCode = e.keyCode; //character code is contained in IE's keyCode property
    }

    if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
        checkSearchBox(); //submit the form
        return false; 
    }
}

/* Added for IE6 display issue. Toggle the display of the windowed controls.
 This would help in having the Menu displayed properly. */
function toggleWindowedControls(theVisibility) 
{
    // Pipe separated Select control ID's which need to be hidden. 
    // Please add pipe separated control ID(for dropdowns) here which needs to be hidden for IE6
    var strSelectIDToHide = 'ddlCategory|ddlProduct|ddlSolutions'
    // Pipe separated Embed control ID's which need to be hidden.
    // Please add pipe separated control ID(for EMBED tags) here which needs to be hidden for all browsers
    var strEmbedIDToHide = ''
    var strSelectIDArray = new Array();
    strSelectIDArray = strSelectIDToHide.split('|');
    var strEmbedIDArray = new Array();
    strEmbedIDArray = strEmbedIDToHide.split('|');
    
    // Check for the browser and see if it is IE6 or below
    if(!window.XMLHttpRequest)
    {
        for (e=0;e<strSelectIDArray.length;e++)
        {
            // Check for the SELECT tag and hide the control
            if (document.getElementById(strSelectIDArray[e])!= null) 
            {
                document.getElementById(strSelectIDArray[e]).style.visibility=theVisibility;
            }
        }
    }
    
    // Do the same for the EMBED objects. But do for all the browsers.
    for (e=0;e<strEmbedIDArray.length;e++)
    {
        // Check for the EMBED tag and hide the control
        if (document.getElementById(strEmbedIDArray[e])!= null) 
        {
            document.getElementById(strEmbedIDArray[e]).style.visibility=theVisibility;
        }
    }
}