//open new window
var win = null;
function NewWindow(mypage,myname,w,h,scroll,tool,loca){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',toolbar='+tool+',location='+loca+',resizable'
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}


/**
 * global pop-up window opener
 *
 * @param	string
 * @param	string
 * @param	integer
 * @param	integer
 * @param	integer|null
 * @param	integer|null
 */

function global_winopen(url, winname, width, height, xoffset, yoffset)
{
	// default offsets
	
	var default_xoffset = 300;
	var default_yoffset = 200;
	
	// do we have offset parameters?
	
	xoffset = (xoffset == null) ? default_xoffset : xoffset;
	yoffset = (yoffset == null) ? default_yoffset : yoffset;
	
	// make sure that at a minimum the url is present else do nothing
	
	if (url != null)
	{
		// set the window properties
		
		var winproperties = "toolbar=yes,location=yes,status=no,directories=no,width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes,left=" + 300 + ",top=" + 100;
		
		// open the window
	
		window.open(url, winname, winproperties);
	}
}


function PopupPic(sPicURL) { 
		window.open("../popup.html?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}
