
function SetCookie( name, value, expires, path, domain, secure ) {
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );
if ( expires ){
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

function ToggleControlBox(BoxID){
	DLParentNode = BoxID.parentNode.parentNode;
	DD = DLParentNode.getElementsByTagName('DD');
	DT = DLParentNode.getElementsByTagName('DT');
	ThisID = DLParentNode.getAttribute('id');
	if(DT[0].className == 'open'){
		NewClass = 'closed';
		SetCookie('SCHO_bClosed_'+ThisID,1);
	} else {
		NewClass = 'open';
		SetCookie('SCHO_bClosed_'+ThisID,0);
	}
	//alert('ID: '+BoxID.parentNode.parentNode.className+'\nDDClass:'+DD[0].className+'\nDDClass: '+DT[0].className);
	DD[0].className = NewClass;
	DT[0].className = NewClass;
}
