function TogglePulldown(item) {
  obj=document.getElementById(item+"_pulldown");
  visible=(obj.style.display!="none");
  span=document.getElementById("span_"+item+"_pulldown");
  if (visible) {
  	obj.style.display="none";
    span.innerHTML="<img name='button_" + item +"' src='images/misc/min.gif' align='absmiddle' hspace='0' vspace='0' border='0'>";
	//DeleteCookie(item);
	Set(item);
  } else {
    if((browser.isIE)&&(!browser.isOPERA))
	    obj.style.display="block";
  	else
    	obj.style.display="table-row";
    span.innerHTML="<img name='button_" + item +"' src='images/misc/max.gif' align='absmiddle' hspace='0' vspace='0' border='0'>";
	Set(item);
  }
}

function DisplayName(item) {
  if(GetCookie(item) != null)
     alert("Welcome back "+GetCookie(item));
  else
     alert("You must set the cookie first.");
}
   
function getCookieVal (offset) {    
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
	
function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {       
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0)
			break;
	}    
} 

function SetCookie (name, value) {  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;
		
	document.cookie = name + "=" + escape (value) + 
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
		((path == null) ? "" : ("; path=" + path)) +  
		((domain == null) ? "" : ("; domain=" + domain)) +    
		((secure == true) ? "; secure" : "");
}

function Set(item) {
	obj=document.getElementById(item+"_pulldown");
	visible=(obj.style.display!="none");
	SetCookie(item, visible);
}

function SetNoMenu(item) {
  var divCollection = document.getElementsByTagName("div");
  for (var i=0; i < divCollection.length; i++) {
    if(divCollection[i].getAttribute("className") == item) {
	  obj = divCollection[i];
	  visible=(obj.style.display!="none");
    }
  }
  SetCookie(item, visible);
}


function DeleteCookie (item) {
	var exp = new Date();
	exp.setTime (exp.getTime() - 1000000000);

	var cval = GetCookie (item);
	document.cookie = item + "=" + cval + "; expires=" + exp.toGMTString();
}
