// JavaScript Document
function teamDivs(theDiv, expandPlus){
	toggle_visibility(theDiv);

	var futdate = new Date()		//Get the current time and date
	var expdate = futdate.getTime()  //Get the milliseconds since Jan 1, 1970
	expdate += 3600*1000  //expires in 1 hour(milliseconds)
	futdate.setTime(expdate)
	
	if (theDiv == 'board') {
		document.cookie="kmtBoardExpand"+"="+"board"+"; expires=" + futdate.toGMTString();
		//alert('set cookie to board');
	} else if (theDiv == 'exec') {
		document.cookie="kmtBoardExpand"+"="+"exec"+"; expires=" + futdate.toGMTString();
		//alert('set cookie to exec');
	} else {
		//alert('drop cookie failed');
	}
	
	var expander = document.getElementById(expandPlus);
	var showDiv = document.getElementById(theDiv);
	
	if(showDiv.style.display == 'none') { //if minus or not set
		expander.style.backgroundPosition = '0px 0px'; //make it plus
	} else {
		expander.style.backgroundPosition = '-17px 0px'; //or make it minus
	}					
	
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
	{ 
	c_start=c_start + c_name.length+1; 
	c_end=document.cookie.indexOf(";",c_start);
	if (c_end==-1) c_end=document.cookie.length;
	return unescape(document.cookie.substring(c_start,c_end));
	} 
  }
return "";
}

function checkCookie() {
	showDiv=getCookie('kmtBoardExpand');
	if (showDiv!=null && showDiv!="") {
		if (showDiv == "board") {
			document.getElementById('board').style.display = 'block';
			document.getElementById('expandBoard').style.backgroundPosition = '-17px 0px';			
		}
		if  (showDiv == "exec") {
			//alert('exec');
			
			document.getElementById('exec').style.display = 'block';
			document.getElementById('expandExec').style.backgroundPosition = '-17px 0px';
		}
	} else {
	}
}


