function set_session_vars( varString ){
	var _request=new get_request_object();
	_request.open("post", "/session/set?" + varString + "&refresh="+Math.random(), false)
	_request.send(null);
//	eval("var _hash=" + _request.responseText);
	return _request.responseText;
}

//function get_session_vars( varString ){
	//var _request=new get_request_object();
	//_request.open("post", "/session/get?" + varString + "&refresh=" + Math.random(), false);
//	_request.send(null);
	//eval("var _hash=" + _request.responseText);
//	return _hash;
//}

function $(_id){
	return document.getElementById(_id)
}

function new_div( _class, _parentNode ){
	var div = document.createElement('div')
	div.className=_class
	if (_parentNode){
		_parentNode.appendChild(div)
	}
	return div
}

function new_text( _string, _parentNode ){
	var text = document.createTextNode(_string)
	if (_parentNode){
		_parentNode.appendChild(text)
	}
	return text
}

function get_body( ){
	return document.getElementsByTagName('body')[0]
}

function ac( _parentNode, _childElement ){
	_parentNode.appendChild(_childElement)
}

function rc( _parentNode, _childElement ){
	_parentNode.removeChild(_childElement)
}

function Section(classSuffix){
	this.labelD = new_div("labelD"+classSuffix)
	this.viewD  = new_div("viewD"+classSuffix)
	this.labels = new Array()
	this.contents = new Array()
	this.active_contents = false
	this.active_label    = false
	
	return this;
}

function is_ie(){
	var ie = (document.all) ? true : false;
//	alert('is ie')
	return ie
}

Section.prototype.set_contents=function( _id, _div, classSuffix ){
	this.contents[_id] = _div
	_div.className="contentsD_hidden"+classSuffix
	ac(this.viewD,_div)
	return true
}

Section.prototype.hide=function(){
	this.labelD.className="generic_hidden";
	this.viewD.className="generic_hidden";
}

Section.prototype.new_label=function( _msgText, _id, overseer, classSuffix  ){
	var wrapperD      = new_div('wrapperD'+classSuffix)
	var shadowD       = new_div('shadowD'+classSuffix, wrapperD)
	var bodyD         = new_div('bodyD'+classSuffix, wrapperD)
	var msgD          = new_div('msgD'+classSuffix, bodyD)
	var msgT          = new_text(_msgText, msgD)
	var maskD         = new_div('maskD'+classSuffix, wrapperD)
	if (is_ie()) {
		maskD.style.filter="alpha(opacity='0')"
		maskD.style.background="#FFFFFF"
	}
	maskD.bodyD        = bodyD
	maskD.section     = this
	maskD._id         = _id
	maskD.classSuffix = classSuffix
	maskD.onmouseover=function(){ 
		if( this.section.active_label != this)
		this.bodyD.className="bodyD_mouseover"+classSuffix 	
	}
	maskD.onmouseout =function(){ 
		if( this.section.active_label != this)
		this.bodyD.className="bodyD"+classSuffix 
	}
	maskD.onclick    =function(){ this.section.toggle_contents(this._id, this.classSuffix, this) }
	
	this.labels.push(wrapperD)
	ac(this.labelD,wrapperD)
	
	return wrapperD
}

Section.prototype.toggle_contents=function(_id, classSuffix, _label){

	if(this.active_label){ this.active_label.bodyD.className="bodyD"+classSuffix }
	this.active_label=_label
	this.active_label.bodyD.className="bodyD_selected"+classSuffix

	
	if (this.active_contents){
		if(this.contents[this.active_contents]) this.contents[this.active_contents].className="contentsD_hidden"+classSuffix
		else alert("Missing contents with ID:"+_id)
	}
	this.active_contents=_id
	this.show_contents(_id,classSuffix)	
}


Section.prototype.show_contents=function(_id,classSuffix){
//	alert(_id)
	if (!this.contents[_id]) alert("Label with ID:"+_id+" has no content assocated with it.")
	else this.contents[_id].className="contentsD_visible"+classSuffix
}

Section.prototype.hide_contents=function(_id,classSuffix){
//	alert(_id)
	this.contents[_id].className="contentsD_hidden"+classSuffix
}

