function CancelWindow() {
	self.close();
}

function PopUpWindow (url, hWind, nWidth, nHeight, nScroll, nResize) {
	var cToolBar = 'toolbar=0,location=0,directories=0,status=' + nResize + ',menubar=0,scrollbars=' + nScroll + ',resizable=' + nResize + ',width=' + nWidth + ',height=' + nHeight;
	var popupwin = window.open(url, hWind, cToolBar);
}

function openWindow(url){
	newWindow=window.open(url,'newWin','tollbar=yes,location=yes,scrollbars=yes,width=300,hight=200')
}

function openWindow2(url){
	newWindow=window.open(url,'newWin','tollbar=yes,menubar=yes,location=yes,scrollbars=yes,directories=yes')
}

function closeWindow()
	{
	if(newWindow && !newWindow.closed)
		{
			newWindow.close()
		}	
	}
	
function PopUpWindowFull (url, hWind, nWidth, nHeight, nResize)
	{
	var cToolBar = "toolbar=yes,location=yes,directories=yes,resizable=1,status=" + nResize + ",menubar=yes,scrollbars=yes,width=" + nWidth + ",height=" + nHeight
	var popupwin = window.open(url, hWind, cToolBar);
	}
	
function PopEditWindow(URLInfo, Name, a, b, c, d) {
		EditHandle = PopUpWindow(URLInfo, Name, a, b, c, d);
	}
	
function closeWindowRefreshTop(){
	if (!top.opener.closed){
		top.opener.location.reload(true);
	}
	parent.top.close();
}

function Trim (string) {
	if (string.length > 0) {
		string = RemoveLeadingSpaces (string);
	}
	if (string.length > 0) {
		string = RemoveTrailingSpaces(string);
	}
	return string;
}
	
function RemoveLeadingSpaces(string) {
	while(string.substring(0, 1) == " ") {
		string = string.substring(1, string.length);
	}
	return string;
}

function RemoveTrailingSpaces(string) {
	while(string.substring((string.length - 1), string.length) == " ") {
		string = string.substring(0, (string.length - 1));
	}
	return string;
}
