/*  
	Author: Pablo Vaccarezza <pablo@creativenode.com>
	Description: Opens a popup window with passed parameters 
*/ 
function popup(mypage, myname, w, h, stuff) 
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',' + stuff;
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { 
		win.window.focus();
	};
}

function ltrim(s) {
   return s.replace(/^\s+/, "");
}
function rtrim(s) {
   return s.replace(/\s+$/, "");
}
function trim(s) {   
	return rtrim(ltrim(s));
}