<!--

var head="display:''"
var folder=''
var text=""
var storedval=""
var arrow=false;
var ns6=(document.getElementById&&!document.all)? 1:0
ns4=(document.layers) ? true : false;


function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires: "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function fixExpiryDate(days)
{
var UTCstring;
Today = new Date();
nomilli=Date.parse(Today);
Today.setTime(nomilli+days*24*60*60*1000);
UTCstring = Today.toUTCString();
return UTCstring;
}

function getSavedCookie(org1)
{

//alert("Insavedcookie")
}


//function expandit1(curobj1,num1,org1,count1,state1)
//{
//alert("In Expandit 1");

 //folder=ns6?curobj1.nextSibling.nextSibling.style:document.all[curobj1.sourceIndex+2].style
//alert(folder);

//if (folder.display=="none")
// {

 //document.images[num1].src="/genome/guide/corehtml/arrowdown.gif";
 //folder.display=""
// text=count+"-1XX"
// m_section=count
 //m_state="1"

 
//}//folder.display=none

//else
//{
// document.images[num1].src="/genome/guide/corehtml/arrowup.gif";
 folder.display="none"
 //text=count+"-0XX"
// m_section=count
// m_state="0"
//}
//folderdisplay=""

//}


function expandit(curobj,num,org,count,state)
{

var sectionfound=0
var newval=""
storedval=getCookie(org)
if(storedval==null)
  {
    //alert("No Cookie")
    storedval=null
  }
else
  {
    //alert("Stored Cookie is: "+storedval)
//parse storedval into two arrays: cookiesection and cookiestate
  var temp=storedval
  var temp1=temp.split("XX")
  var array_len=temp1.length
  //alert("temp1 is:  "+temp1)
  //alert("array_len: "+array_len)
  
  var cookiesection=new Array(array_len)
  var cookiestate=new Array(array_len)

  for(var i=0;i<array_len; i++)
   {
     temp2=temp1[i].split("-")
     if(temp2[0]==count)
	sectionfound=1
     cookiesection[i]=temp2[0]
     cookiestate[i]=temp2[1]
   }	
//alert("Cookiestate:  "+cookiestate)
//alert("Cookiesection:  "+cookiesection)
   // if(sectionfound==1)
//	alert("Section found!")
  }//storedvalue is not null


var m_state=""
var m_section=""

folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+3].style


if (folder.display=="none")
 {

 document.images[num].src="http://www.ncbi.nlm.nih.gov/genome/guide/corehtml/arrowdown.gif";
 folder.display=""
 text=count+"-1XX"
 m_section=count
 m_state="1"

 
}//folder.display=none

else
{
 document.images[num].src="http://www.ncbi.nlm.nih.gov/genome/guide/corehtml/arrowup.gif";
 folder.display="none"
 text=count+"-0XX"
 m_section=count
 m_state="0"
}//folderdisplay=""

//alert("m_section: "+m_section+ " m_state: " + m_state)

if(storedval==null)
	newval=text
else
{
//alert("Rebuilding Cookie")
if(sectionfound==0)
  {
  //  alert("section not found in old cookie, adding new section now")
    newval=storedval+text
   // alert("Rebuilt Cookie:  "+newval)
  }
else //begin section found
{
  // alert("section found in old cookie, modifying its state information now")
   for(var i=0; i<array_len; i++)
    {
     if(cookiesection[i]==m_section)
	cookiestate[i]=m_state
    }//for

  //  alert("New cookiestate:  "+cookiestate)
   // alert("New Cookiesection:   "+cookiesection)
    
    var new_len=array_len-1
    var temp3 = new Array(new_len)
    for(var i=0; i<new_len; i++)
     {
       temp3[i]=cookiesection[i]+"-"+cookiestate[i]
     }
  //  alert("Partially Rebuilt:   "+temp3)
    newval=temp3.join("XX")
    newval=newval+"XX"
   // alert("Rebuilt Cookie:  "+ newval)

}//end section found

}//storedval!=null
var expirydate=fixExpiryDate(365)
setCookie(org,newval,expirydate)
//alert("Wrote Cookie:  "+newval)


}//func

//-->
