var win=null;

/*
*************************************************************************************************
*** width, height, scrollbars and position are fixed in this application
*************************************************************************************************
*/

var w=950;
var h=700;
var scroll='yes';
var pos='center';


function NewWindow(mypage,myname){

	if(pos=="random"){
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
	        TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	if(pos=="center"){
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
	else if((pos!="center" && pos!="random") || pos==null){
		LeftPosition=0;
		TopPosition=20
	}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
	var win=window.open(mypage,"PictureWindow",settings);
//	win.document.open();
//	win.document.writeln('<HTML><HEAD><TITLE>'+myname+'</TITLE>');
//	win.document.writeln("<style>body {font-family:Verdana;}</style>");
//	win.document.writeln("</HEAD>");
//	win.document.writeln("<script language='JavaScript' src='rc.js'></script>");
//	win.document.writeln("<BODY>");
//	win.document.writeln("<CENTER>");
//	win.document.writeln('<H2>'+myname+'</H2>');
//	win.document.writeln("<IMG SRC="+mypage+">");
//	win.document.writeln("<FORM><INPUT TYPE='button' VALUE='Close' onClick='window.close()'></FORM>");
//	win.document.writeln("</CENTER></BODY></HTML>");
//	win.document.close();

	if(win.focus){
		win.focus();
	}
}


