function popme(url, width, height){
	if(typeof width == "undefined") var width = Math.floor(screen.width/1.7);
	if(typeof height == "undefined") var height = Math.floor(screen.height/1.7);
	var left = Math.floor((screen.width-width)/2);
	var top = Math.floor((screen.height-height)/2);
	url = url + (url.indexOf("?")==-1 ? "?" : "&") + "popup=true";
	window.open(url, "", "resizable=yes,width="+width+",height="+height+",top="+top+",left="+left);
}
function popme2(url, width, height){
	if(typeof width == "undefined") var width = Math.floor(screen.width/1.7);
	if(typeof height == "undefined") var height = Math.floor(screen.height/1.7);
	var left = Math.floor((screen.width-width)/2);
	var top = Math.floor((screen.height-height)/2);
	url = url + (url.indexOf("?")==-1 ? "?" : "&") + "popup=true";
	window.open(url, "", "scrollbars=yes,resizable=yes,width="+width+",height="+height+",top="+top+",left="+left);
}
function autoresizePopup(){
	return true;
	headerHeight  = 0;
	bottomPadding = 0;

	newWidth  = document.body.scrollWidth + 10; // + chroma
	newHeight = document.body.scrollHeight + 30 + headerHeight + bottomPadding; // + chroma + headerHeight + bottomPadding
	newLeft   = Math.round((screen.width - newWidth) / 2);
	newTop    = Math.round((screen.height - newHeight) / 2) - 20; // - chroma

	try{ //popup window
		window.moveTo(newLeft, newTop);
		window.resizeTo(newWidth, newHeight);
	}catch(e){ 
		alert('Error occured while resizing/moving window: trapped!      ');
	}
}
function poptpl(tpl) {
	popme2("poper.php?show=" + tpl + "&template", 800, 600);
}