function trim(s) {
	return s.replace(/^\s+|\s+$/, "");
}

function bookmarkPage() {
	if(window.sidebar)
		window.sidebar.addPanel(document.title, window.location.href, '');
	else if(window.external)
		window.external.AddFavorite(window.location.href, document.title);
}

function closeWindow() {
	window.close();
}

function openPrinterFriendly() {
	var sep = window.location.href.indexOf('?') == -1 ? '?' : '&';
	window.open(window.location.href + sep + 'bPrinterFriendly=1');
}

function windowPrint() {
	if(window)
		window.print();
}

function popitup(url,args) {
	var w = window.open(url,'',args);
	w.moveTo(160, 190);
}