popup = "";
function zoom(url,w,h,x,y){
	if (popup.closed == false) {popup.close()} else {}
	popup=window.open(url,'zoom','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
}
function zoomX(url,w,h,x,y){
	if (popup.closed == false) {popup.close()} else {}
	popup=window.open(url,'zoom','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y+',scrollbars=1,resizable=yes');
}
function rzoom(url,w,h,xr,yr){ //relative zoom
	x = (screen.width)/2 - w/2 + xr; 
	y = (screen.height)/2 - h/2 + yr;
	if (popup.closed == false) {popup.close()} else {}
	popup=window.open(url,'zoom','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
}
function rzoom2(url,w,h,xr,yr){ //relative zoom + scroll
	x = (screen.width)/2 - w/2 + xr; 
	y = (screen.height)/2 - h/2 + yr;
	if (popup.closed == false) {popup.close()} else {}
	popup=window.open(url,'zoom','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y+',scrollbars=1,dependent=yes');
}
function rzoomX(url,w,h,xr,yr){ //relative zoom resizeable
	x = (screen.width)/2 - w/2 + xr; 
	y = (screen.height)/2 - h/2 + yr;
	if (popup.closed == false) {popup.close()} else {}
	popup=window.open(url,'zoom','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y+',scrollbars=1,resizable=yes');
}
function printpreview(w,h){
	var hash_index = window.location.toString().indexOf('#');
	var url = window.location.toString().substr(0,hash_index>0?hash_index:window.location.toString().length)+(window.location.search!=''?'&':'?')+'css=print.css&cssnocookie=1';
	if (popup.closed == false) {popup.close()} else {}
	popup=window.open(url,'printpre','width='+w+',height='+h+',toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes');
	setTimeout('{if(popup&&!popup.closed) popup.print();}',1000);
}