function trim(str) {
	var whitespace = new String(" \t\n\r");
	var s = new String(" " + str + " ");
	if (whitespace.indexOf(s.charAt(0)) != -1) {
		var j=0, i = s.length;
            while (j < i && whitespace.indexOf(s.charAt(j)) != -1) {
			j++;
		}
            s = s.substring(j, i);
	}

	if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
		var i = s.length - 1;       
            while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) {
			i--;
		}
            s = s.substring(0, i+1);
	}
	return s;
}

function win_test(URL) { 
	if (URL != "") {
		swidth = (screen.width-780)/2;
		sheight = (screen.availHeight-500)/2;
		if (URL.indexOf("http://") < 0) URL = "http://" + URL;
var Win = window.open(URL,'Win','width=780,height=500,top=' + sheight + ',left=' + swidth + ',resizable=yes,scrollbars=yes,status=yes,location=yes'); 
		Win.focus();
	}
}
function win_mini(URL) { 
	swidth = (screen.width-600)/2;
	sheight = (screen.availHeight-300)/2
	URL = "photo.asp?pic=" + URL;
	var Win_mini = window.open(URL,'Win_mini','width=600,height=300,top=' + sheight + ',left=' + swidth + ',resizable=yes,scrollbars=yes');
	Win_mini.focus();
}
