	String.prototype.trim = function() {
		return this.replace(/^\s*/, "").replace(/\s*$/, "");
	}

	String.prototype.replaceAll = function(searchVal,replaceVal) { 
		var str=this;
		ind=str.indexOf(searchVal);
		while (ind!=-1) { 
			str=str.replace(searchVal,replaceVal); 
			ind=str.indexOf(searchVal);
		} 
		return str;
	}
	
	function popup(url,winname,w,h,statusbar,scrollbars,toolbar,resizeable,menubar) {
		var OpenWindow=window.open(url, winname,'status='+statusbar+',scrollbars='+scrollbars+',toolbar='+toolbar+',resizable='+resizeable+',menubar='+menubar+',width='+w+',height='+h+',left=0,top=0'); 	
		OpenWindow.focus();
	}
	
	function getElement(id) {
		if ( document.all ) {
			return document.all[id];
		} else { 
			return document.getElementById(id);
		}		
	}
	
	function getFormElement(id,formname) {
	if ( formname==null ) {
		formname="main";
	}
		return eval("document."+formname+"."+id);
	}
