	function Trim(myStr) {
		return LTrim(RTrim(myStr));
	}

	function LTrim(myStr) {
		if (myStr.charAt(0) == ' ') {
			myStr = LTrim(myStr.substring(1));
		}
		return myStr;
	}

	function RTrim(myStr) {
		if (myStr.charAt(myStr.length - 1) == ' ') {
			myStr = RTrim(myStr.substring(0, myStr.length - 1));
		}
		return myStr;
	}


	function openWin(url, name, w, h) {
		var top = (screen.availHeight - h - 30) / 2;
		var left = (screen.availWidth - w - 10) / 2;


		myWin = window.open(url, name, 'width=' + w + ',height=' + h + ',left=' + left + ',top=' + top + ',scrollbars=yes,location=no,status=no,toolbar=no,resizable=yes');
		myWin.focus();
		//window.showModalDialog(url,name,'dialogHeight: ' + h + 'px; dialogWidth: ' + w + 'px; edge: Raised; center: Yes; help: No; resizable: Yes; status: No;');
	}


	function downloadForm(formID) {
		openWin('/download.asp?ft=f&formid=' + formID,'',30,30);

	}


	function downloadInformation(formID) {
		openWin('/download.asp?ft=i&formid=' + formID,'',30,30);

	}

	function getObj(o) {
		return (document.all) ? document.all[o] : document.getElementById(o);
	}


	//-- toolbar stays on top //---
	function moveHeaderToTop() {
		// scroll the header section and the
		if (document.getElementById('divHeader')) {
			document.getElementById('divHeader').style.top = document.body.scrollTop;
			if (document.getElementById('ifrHide')) {
				document.getElementById('ifrHide').style.top = document.body.scrollTop;
			}
			//document.getElementById('divHeader').style.position = 'absolute';

		}
	}

	function resizeHeaderPadding() {
		try  {
			document.getElementById('divHeader').style.position = 'absolute';
			document.getElementById('divHeader').style.top = '0px';
			document.getElementById("divHeader").style.zIndex=10;
			document.body.style.marginTop = document.getElementById('divHeader').clientHeight;
			if (document.getElementById('ifrHide')) {
				document.getElementById('ifrHide').style.height = document.getElementById('divHeader').clientHeight;
			}
			moveHeaderToTop();
		} catch(e) {
			alert('divHeader not defined');
		}

	}


	function setCookie(c_name,value,expiredays)	{
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+
		((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
	}

	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 "";
	}
