function OpenPopUp(url) {
  var win = window.open(url, "phsPU" + Math.round(Math.random() * 100000), "width=550,height=530,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
  win.focus();
}

function view(img) {
			window.open('/view.html?image=' + img, '_blank' , 'width=400,height=300,resizable=yes,menubars=no,toolbars=no,scrollbars=no');
}

	
var supported = 0;
if (window.RegExp) {
	var tempStr = "a";
	var tempReg = new RegExp(tempStr);
	if (tempReg.test(tempStr)) supported = 1;
}

function trim(str) {
	if (!supported) return str
	else return str.replace(/^\s*|\s*$/g,"");
}