// JavaScript Document
var screenWidth = screen.availWidth;
var screenHeight = screen.availHeight;
var i=0;
var win = 0;
function newWindow (mypage, myname, w, h) {
	
	var winl = Math.round((screenWidth-w)/2);
	var wint = Math.round((screenHeight-h)/2);

	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no,status=yes';
	
	if(win){
		//alert("open");
		if(!win.closed){
			win.close();
		}
	}else{
		//alert("closed");
		win=0;
	}
	
	win = window.open(mypage,('loading'+i),winprops);
	//some versions of navigator do not respond to the "focus" command.
	if (parseInt(navigator.appVersion)>=4) {
		win.window.focus();
	}

	i++;
}







