//Pop Windows
function popWindowMain(winURL, winName, winWidth, winHeight, winMenu, winResize, winScroll, winToolbar, winOffset) {
	var popWinMain = null;

	//Always Centre Window
	var winPosX = (window.screen.width/2)-(winWidth/2);
	var winPosY = (window.screen.height/2)-(winHeight/2);
	
	if (winOffset) {
		//Offset window from centre
		winPosX = winPosX + 40;
		winPosY = winPosY + 40;
	}

	//Build Window Features
	var winFeatures = "height=" + winHeight
					+ ", width=" + winWidth
					+ ", innerHeight=" + winHeight
					+ ", innerWidth=" + winWidth
					+ ", channelmode=0"
					+ ", dependent=0"
					+ ", directories=0"
					+ ", fullscreen=0"
					+ ", location=0"
					+ ", menubar=" + winMenu
					+ ", resizable=" + winResize
					+ ", scrollbars=" + winScroll
					+ ", status=1"
					+ ", toolbar=" + winToolbar
					+ ", screenx=" + winPosX
					+ ", screeny=" + winPosY
					+ ", left=" + winPosX
					+ ", top=" + winPosY;
					//Only use the following attributes with a signed script:
					//-------------------------------
					//+ ", hotkeys=1"
					//+ ", alwaysLowered=0"
					//+ ", alwaysRaised=0"
					//+ ", titlebar=0"
					//+ ", z-lock=0"
					//-------------------------------

	// ## BUGGY CODE: IE Freezes when returning a window handle when using Flash: Camera.get();
	//Open Child Window
	//var reWork = new RegExp('object','gi');
	//try {
	//	//Pop the window
	//	popWinMain = window.open(winURL, winName, winFeatures);
	//	if (window.focus) { popWinMain.focus(); }
	//} catch(e) { }
	//if(!reWork.test(String(popWinMain))) {
	//	//Failed to open - killed by pop-up blocker
	//	alert("This window could not be opened because you have a 'Pop-Up Blocker' enabled.\n\nPlease Disable your 'Pop-Up Blocker' for this website.");
	//}
	// ## END OF BUGGY CODE
	//
	// NEW CODE THAT WORKS WITH FLASH
	try {
		//Pop the window
		window.open(winURL, winName, winFeatures);
		return false;
	} catch(e) {
		return false;
	}
	
	
}