// JavaScript Document

//--------------------------------------------------------
// Commonly Used Functions
//--------------------------------------------------------
String.prototype.trim = function () {
  return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");
};


function checkEnterKey(e){
	e = e || window.event;
	if(e.keyCode == 13){
		return true;
	}
	return false;
}


function openNewWindow(theURL, winName, winWidth, winHeight){
	var width;
	var height;
	var leftdist;
	var topdist;
	width = screen.width;
	height = screen.height;
	leftdist = Math.round((width - winWidth) / 2);
	topdist = Math.round((height - winHeight) / 2);
	window.open(theURL, winName,'width='+winWidth+',height='+winHeight+',top='+topdist+',left='+leftdist+',resizable=yes,resize=0,menubar=0,location=0,scrollbars=1')
	}

function closeWindow(){
	window.close;
	}