function GetCookie(cookieName) {
	var theCookie=""+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=="") return "";
	var ind1=theCookie.indexOf(';',ind);
	if (ind1==-1) ind1=theCookie.length;
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}
function SetCookie(cookieName,cookieValue) {
	//Supports deleting
	if (cookieValue=='') {
		var expire = new Date();
		expire.setTime(expire.getTime() - 3600000*24*7);
		document.cookie = cookieName+"=;expires="+expire.toGMTString();
	}
	else document.cookie = cookieName+"="+escape(cookieValue);
}
function isdefined(variable) {
	return (typeof(window[variable]) == "undefined")?  false: true;
}
function help(topic) {
	mywin = window.open('/help/index.php?t='+topic,'help','location=0,scrollbars=1,status=0,titlebar=0,menubar=0,left='+(screen.width-420)+',top=10,width=400,height=600');
	mywin.focus();
}
function trim(str) {
	str = str.replace(/^\s+/, '');
	for (var i = str.length - 1; i >= 0; i--) {
		if (/\S/.test(str.charAt(i))) {
			str = str.substring(0, i + 1);
			break;
		}
	}
	return str;
}

