function PopUp(URL, WIDTH, HEIGHT) {
	var winl = (screen.width - WIDTH) / 2;
	var wint = (screen.height - HEIGHT) / 5;
	windowprops = "left=" + winl + ",top=" + wint + ",width=" + WIDTH + ",height=" + HEIGHT +",toolbar=yes ,resizable=yes ,status=yes";
	preview = window.open(URL, "preview", windowprops);
}

function resizeWindow(mywin, width, height) {
	newWidth = width;
	newHeight = height;
	if (document.layers)
	{
		tmp1 = mywin.outerWidth - mywin.innerWidth;
		tmp2 = mywin.outerHeight - mywin.innerHeight;
		newWidth -= tmp1;
		newHeight -= tmp2;
	}
	mywin.resizeTo(newWidth,newHeight);
}
function popUpImage(url,width,height)
{
	winHeight = height + 60;
	winWidth = width + 15;
	
	mywin = window.open('',"Preview","height="+winHeight+",width="+winWidth+",status=yes,toolbar=no,menubar=no,location=no");
	var newDoc=mywin.document.open("text/html","replace")
	newDoc.write('<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0">');
	newDoc.write('<center><img src="'+url+'" alt="" border="0" width="'+width+'" height="'+height+'"></center>');
	newDoc.write('</body>');
	mywin.document.close;
	resizeWindow(mywin,width, height);
	mywin.focus();
}


