function toggleMenuVis(leftrightmenu) {
	var obj = document.getElementById(leftrightmenu + 'menucol');
	var imgObj = document.getElementById(leftrightmenu + 'menuminmax');

	if(obj.style.display == 'none') {
		obj.style.display = "";
		obj.style.width = "150px";
		if(imgObj) imgObj.src = "images/buttons/contentmenu_minmax_ar" + leftrightmenu + ".gif";
		Set_Cookie('osde_menustatus' + leftrightmenu,1,500,"/");

	} else if (obj.style.display == "" && obj.style.width == "150px") {
		obj.style.width = "114px";
		if(imgSender) imgSender.src = "images/buttons/contentmenu_minmax_ar" + leftrightmenu + ".gif";

	} else {
		var imgStr = "";
		if(leftrightmenu == "left") imgStr = "right";
		else imgStr = "left";

		obj.style.display = "none";
		if(imgObj) imgObj.src = "images/buttons/contentmenu_minmax_ar" + imgStr + ".gif";
		Set_Cookie('osde_menustatus' + leftrightmenu,0,500,"/");
	}
}

function Get_Cookie(name) {
	var start = document.cookie.indexOf(name+"=");
	var len = start+name.length+1;
	if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
	if (start == -1) return null;
	var end = document.cookie.indexOf(";",len);
	if (end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len,end));
}

// This function has been slightly modified
function Set_Cookie(name,value,expires,path,domain,secure) {
	expires = expires * 60*60*24*1000;
	var today = new Date();
	var expires_date = new Date( today.getTime() + (expires) );

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

function bodyOnLoad() {
	var menustatus_left = Get_Cookie('osde_menustatusleft');
	var menustatus_right = Get_Cookie('osde_menustatusright');

	if(menustatus_left == 0) {
		toggleMenuVis('left');
	}

	if(menustatus_right == 0) {
		toggleMenuVis('right');
	}
}

function insertSmilie(thesmilie, objId) {
	var obj = document.getElementById(objId);

	if(obj) {
		obj.value += thesmilie+" ";
		obj.focus();
	}
}