function sessionexpand(menublock,direction,divID, btnID, hideText, showText) 
{
    //if(xmlhttp!=false) 
    //{
        //Set new session value
        url="/setsessionvalue.ashx?sessionobject=NavigationMenuExpansion&direction=" + direction + "&sessionvalue=" + menublock
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
    //}
    
    //Call normal expand routine
    expand(divID, btnID, hideText, showText);
    
    return false;
}

/// Shows or hides a given div by Id
function expand(divID, btnID, hideText, showText) {

    var oDiv = document.getElementById(divID);
    var oBtn = document.getElementById(btnID);

    // change the state of the div
    if (oDiv.style.display == "none") {
        oDiv.style.display = "";
        oBtn.innerText = showText;
    }
    else 
    {
        oDiv.style.display = "none";
        oBtn.innerText = hideText;
    }

    //change the image of the button
    var sSrc = oBtn.className;
   
    if (sSrc.indexOf("close") > -1)
     sSrc = sSrc.replace("close", "open");
    else
     sSrc = sSrc.replace("open","close");
     
    oBtn.className = sSrc;
    return false;
}

/// Opens a window of a given height in the center of the screen
/// Returns a reference to the new window
function popUpWin(sURL, width, height){
		var left = (screen.width / 2) - (width / 2)
		var top = (screen.height / 2) - (height / 2)
		
		var d = new Date();
		
		var popname = 'popup' + d.getMilliseconds();
		
		return window.open(sURL, popname, "left=" + left + ", top=" + top + ",width=" + width + ", height=" + height + ", scrollbars=1");
}

/// Fires a given buttons event on enter Press
function DefaultSubmitButton(strClientIdArg, e) 
{ 
        var key; 
        if(window.event) 
            key = e.keyCode; // IE
        else 
            key = e.which; // FF
        
        if (key == 13) 
        {
            __doPostBack(strClientIdArg , '');
            //document.getElementById(strClientIdArg).click();
            return false;
         }
         else
            return true;
} 

function showQAA(whichOne, imgname)
{
    if (document.getElementById(whichOne).style.display == 'block')
    {
      document.getElementById(whichOne).style.display = 'none';
      document.getElementById(imgname).src = "../assets/images/icons/Q&A_plus.gif";
    }
    else
    {
      document.getElementById(whichOne).style.display = 'block'; 
      document.getElementById(imgname).src = "../assets/images/icons/Q&A_minus.gif";
    }
}

