////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Modification history:
//Version	Initials	Date		Details
//v1.01		SBH			08/07/04	Added new routine newWindow2. Same as original, but with toolbar parameter.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

var win= null;
function NewWindow(mypage,myname,w,h,scroll, resize){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable='+resize+',';
      settings +='status';
	  window.title='*****************************************************************************';
  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}


function NewWindow2(mypage,myname,w,h,scroll, resize, toolbar){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable='+resize+',';
      settings +='status';
	  if (toolbar == "yes") {
	  	settings +=',toolbar';
	  }
	  window.title='*****************************************************************************';
  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}


function ReloadParent (pagetype,refclient,refevent) {
	var url;
	switch(pagetype) {
		case "report":url="/events/Report/RepRequestView.asp?Active=Request&REF_CLIENT="+refclient+"&REF_COURTPROG="+refevent
		break;
		}
	//alert(url);
	win=window.opener;
	win.location=url;
	win.window.focus();
	
}


function switchImage(paramCloseThisWindow) {
	//alert("close this window: " + paramCloseThisWindow);

	//get a handle on the caller window
	var callerWindow = top.opener;
	//refresh calling page:
	callerWindow.history.go(0);
	//alert("refresh");
	
	if (paramCloseThisWindow == true) {
		//alert("closing window");
		callerWindow.focus();
		top.close();
	}
	/*else {
		alert("retaining window");
	}*/
}


function winResize(paramWidth, paramHeight) {
	//resize window popped window to allow for template picker
	var winl = (screen.width-paramWidth)/2;
  	var wint = (screen.height-paramHeight)/2;

	//alert("rsizing to " + paramWidth + " by " + paramHeight);
	window.resizeTo(paramWidth,paramHeight);
	window.moveTo(winl,wint);
	return 0;
}


