//********************************
// global java script functions
//********************************
function test(msg){
  alert(msg);
  return(false);	
}

var popupwin = null;	//child popup window

//***********************************
// width ..0
// height ..0 draw full size screen
//***********************************
function OpenWindow(pageToLoad,winName,width,height,center,menubar)
{
	var xposition=0;					//default x position
	var yposition=0;					//default y position
	var winwidth = 100;					//default window width
	var winheight = 100;				//default window height
	var saw=screen.availWidth;			//availaible screen width
	var sah=screen.availHeight;			//available screen height
	var sw=screen.width;				//total screen width
	var sh=screen.height;				//total screen height

    popupwin = null;					// init	window handle
	if(width == 0) winwidth = saw - 10;	// full size screen
	else winwidth = width;
	
	if (height == 0) winheight = sah - 40;	 // full size screen
	else winheight = height;

	if (center){
	  xposition = (screen.width - winwidth) * 0.5;
	  if(height != 0) yposition = 50 ; 
	}
	args = "width=" + winwidth + "," 
	+ "height=" + winheight + "," 
	+ "location=0," 
	+ "menubar=" + menubar + ","
	+ "resizable=1,"
	+ "scrollbars=1,"
	+ "status=1," 
	+ "titlebar=0,"
	+ "toolbar=0,"
	+ "hotkeys=0,"
	+ "screenx=" + xposition + ","  //NN Only
	+ "screeny=" + yposition + ","  //NN Only
	+ "left=" + xposition + ","     //IE Only
	+ "top=" + yposition;           //IE Only
	if (pageToLoad != '') {
	  popupwin=window.open(pageToLoad,winName,args);  //open win, load url
	}
	else{
	  popupwin = window.open("",winName,args );	//open win, dont load url
	}
	if (popupwin != null) {
	  popupwin.name = winName;	// assign name property to window
	  if(popupwin.opener == null) 	
	     popupwin.opener = self;	// assign opener property to parent
	  popupwin.focus();
	}

} //openAWindow
	