function selectMenuTab(winURL) 
{
var selectedMenu = "";
  if (winURL == null) 
  {
    var winURL = window.location.href;
  }
  var hash = winURL.lastIndexOf("#");
  if (hash<0) 
  {
    var testURL = winURL.match("/account");
     if (testURL != null) 
     { 
        selectedMenu = "join"; 
     }
   } else {
      selectedMenu = winURL.substring(hash+1);
    }
  if (selectedMenu != null) 
  {
    document.getElementById("menu_container").className=selectedMenu;
  }
}

function hideNotice()
{
  setCookie("noticeState","hide","1");
  document.getElementById("notice-container").style.display = "none";
}

function checkNotice()
{
  var displayState = getCookie("noticeState");
  if (displayState != "hide")
    {
      document.getElementById("notice-container").style.display = "block";
    }
}


// load the named fragment from the child document
function loadFragment(path, container){
     //IE cache the response when the request parameters are the same
    //So We send a random parameter weith the request
    var random = Math.floor(Math.random() * 2000);
    
    new Ajax.Request(path+'?rand=' + random,
    {
        method: 'get',
        parameters:{random:random},
        onSuccess: function(transport) {
    //make a regular expression to grab the required HTML fragment
        var retrievedData = transport.responseText;
        var start= retrievedData.indexOf('begin-->')+8; //offset search criteria
        var end= retrievedData.indexOf('end-->')-11; //offset search criteria
        var extractedData =retrievedData.substring(start,end);
    //add the fragment to targetdiv on current page
        $(container).update(extractedData);
        },
        onFailure: function() {
            setError('Problem with loading the file');
        }
    });
}  