var exp = 5;
function newCookie(name,value,days) {
 if (days) {
   var date = new Date();
   date.setTime(date.getTime()+(days*24*60*60*1000));
   var expires = "; expires="+date.toGMTString(); }
   else var expires = "";
   document.cookie = name+"="+value+expires+"; path=/"; }

function readCookie(name) {
   var nameSG = name + "=";
   var nuller = '';
  if (document.cookie.indexOf(nameSG) == -1)
    return nuller;

   var ca = document.cookie.split(';');
  for(var i=0; i<ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
  if (c.indexOf(nameSG) == 0) return c.substring(nameSG.length,c.length); }
    return null; }

function eraseCookie(name) {
  newCookie(name,"",-1); }

if (document.getElementById) {
 document.writeln('<style type="text/css">')
 document.writeln('.main {text-decoration:none;color:#666666; cursor:hand; cursor:pointer}')
 document.writeln('span.mainLink {color: #666666;font-size: 9pt;text-decoration: none;}')
 document.writeln('span:hover.mainLink {color:  #A6BC09;font-size: 9pt;text-decoration: none;}')
 document.writeln('.sublinks {display:none; padding-left:10px}')
 document.writeln('.link2 {line-height:25px;color: #666666;font-size: 10pt;text-decoration: none; white-space:nowrap;padding-left:3px;}')
 document.writeln('a:active.link2 {line-height:25px;color: #A6BC09;text-decoration: none;padding-left:3px;}')
 document.writeln('a:hover.link2 {line-height:25px;color: #A6BC09;text-decoration: none;padding-left:3px;}')
 document.writeln('</style>') }

 var mainNum = new Array("a1","a2","a3","a4","a5"); 

function openClose(theName, menuArray, theID) {
 for(var i=0; i < menuArray.length; i++) {
  if (menuArray[i] == theID) {
    if (document.getElementById(theID).style.display == "block") {
      document.getElementById(theID).style.display = "none";
     // document.getElementById("tick_"+menuArray[i]).innerHTML = "";
      eraseCookie(theName); }
    else {
      document.getElementById(theID).style.display = "block";
     // document.getElementById("tick_"+menuArray[i]).innerHTML = "";
      newCookie(theName,menuArray[i],exp); }
    }
 else {
    document.getElementById(menuArray[i]).style.display = "none";
   // document.getElementById("tick_"+menuArray[i]).innerHTML = ""; 
   }
 }
}

function memStatus() {
 var num = readCookie("MN");
 if (num) {
   document.getElementById(num).style.display = "block";
 //  document.getElementById("tick_"+num).innerHTML = ""; 
 }
 var num1 = readCookie("SB");
 if (num1) {
   document.getElementById(num1).style.display = "block";
 //  document.getElementById("tick_"+num1).innerHTML = ""; 
 }
}
window.onload=memStatus;