function popup(URL_TO_POP,width,height){
var dummy=Math.floor(Math.random()*5000); 
	if(window.innerWidth){
		if(width=='0'){
			width=screen.width;
		}
		if(height=='0'){
			height=screen.height;
		}
		LeftPosition =(screen.width-width)/2;
		TopPosition =(screen.height-height)/2;
	} else {
		if(width=='0'){
			width=parseInt(window.screen.width);
		}
		if(height=='0'){
			height=parseInt(window.screen.height);
		}
		LeftPosition =(parseInt(window.screen.width)-	width)/2;
		TopPosition= (parseInt(window.screen.height)-height)/2;
	}
	attr = 'dependent=1,resizable=1,scrollbars=1,status=0,width=' + width + ',height=' + height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' + TopPosition + '';
	popWin=open(URL_TO_POP, 'new_window'+dummy, attr);
}
function picpop(PIC_TO_POP,width,height){
var dummy=Math.floor(Math.random()*5000); 
	if(window.innerWidth){
		if(width=='0'){
			width=screen.width;
		}
		if(height=='0'){
			height=screen.height;
		}
		LeftPosition =(screen.width-width)/2;
		TopPosition =(screen.height-height)/2;
	} else {
		if(width=='0'){
			width=parseInt(window.screen.width);
		}
		if(height=='0'){
			height=parseInt(window.screen.height);
		}
		LeftPosition =(parseInt(window.screen.width)-	width)/2;
		TopPosition= (parseInt(window.screen.height)-height)/2;
	}
	attr = 'dependent=1,resizable=0,scrollbars=0,status=0,width=' + width + ',height=' + height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' + TopPosition + '';
	popWin=open('about:blank', 'new_window'+dummy, attr);
	with (popWin.document){
	writeln('<html><head><style>body{margin:0px;}img{margin:0px;}</style>');
	writeln('</head><body onload="self.focus();" onBlur="self.close();">');
	writeln('<img name="lebeny" src="images/spacer.gif" alt="" style="display:block" onClick="javascript:self.close();">');
	writeln('&nbsp;')
	writeln('<script>');
	writeln('image1 = new Image();');
	writeln('image1.src = "'+ PIC_TO_POP +'";');
	writeln('document.lebeny.src=\''+ PIC_TO_POP +'\';');
	writeln('</script>');
	writeln('</body></html>');
	close();		
	}
}