// ----------------------------------------------------------------------------
//	functions.js
//	
//	Javascript functions with no other homve.  Unknown why nexus 
//	created this as separate file
//	
// ----------------------------------------------------------------------------
//	History
//		02/23/04	Previous nexus development
//		02/24/04	KAM	Now use JS globals -- parms unchanged to launch
//		08/18/05	CPC Edited check for blank browser window for check to works on Safari
// ----------------------------------------------------------------------------
var onlineBoxOffice=null;
dontOpenOBO=false;

//	Test launch -- remove when problem solved
//function launchOnlineBoxOffice(prodID,override){
function testlaunchOnlineBoxOffice(prodID,override){
	alert('strHTTPprefix = ' + strHTTPprefix);
	alert('strHTTPSprefix = ' + strHTTPSprefix);
	alert('iOBOSecure  = ' + iOBOSecure);
	alert('prodID = ' + prodID);
	alert('override = ' + override);
	address='onlineBoxOffice/show.aspx?reset=1&prodID=' + prodID;
	if(override != null) {
		address = override;
		}
	if (iOBOSecure > 0) {
		address = strHTTPSprefix + address;
		}
	alert('Final Address: ' + address);
}

//	Modified Original -- s/b live once problem is solved
//function waslaunchOnlineBoxOffice(prodID,override){
function launchOnlineBoxOffice(prodID,override){
	leftPosition = (screen.width) ? (screen.width - 514) / 2 : 0;
	topPosition  = (screen.height)? (screen.height - 550) / 2 : 0;
	if(!dontOpenOBO)	{
		try	{
			dontOpenOBO = true;
			//launch online box office
			if(onlineBoxOffice != null && !onlineBoxOffice.closed){
				onlineBoxOffice.focus();
				onlineBoxOffice.alert('There is already a session of the Online Box Office in use. To start a new one you must first close the current session.');
				}
			else	{
				onlineBoxOffice = window.open('','onlineBoxOffice','width=514,height=550,left='+leftPosition+', top='+topPosition+',toolbar=0,menubar=0,status=1,scrollbars=1');
				string1 = new String(onlineBoxOffice.name);

				if(onlineBoxOffice.location == 'about:blank' ||
				   onlineBoxOffice.location == '/' || string1.length < 25)	{
					address='onlineBoxOffice/show.aspx?reset=1&prodID='+prodID;
					if(override != null){
						address = override;
						}
					if (iOBOSecure > 0) {
						address = strHTTPSprefix + address;
						}
					onlineBoxOffice = window.open(address,'onlineBoxOffice','width=514,height=550,toolbar=0,menubar=0,status=1,scrollbars=1');
					}
				else	{
					onlineBoxOffice.focus();
					onlineBoxOffice.alert('There is already a session of the Online Box Office in use. To start a new one you must first close the current session.');
					}
				}
			setTimeout("fixOBOOpen()", 1000)
			}
		catch(e)	{
			dontOpenOBO = false;
			alert('There is already a session of the Online Box Office in use or you may have pop-ups blocked on your computer.  To launch the Online Box Office, you must first close the current session or disable your pop-up blocker.');
			}
	}
		
}
function fixOBOOpen()	{
	dontOpenOBO = false;
	}

function click(e){
//	if(document.all){
//		if(event.button == 2)	{
//			alert('The right click has been disabled.')
//			return false;
//			}
//		}
//	if (document.layers) {
//		if(e.which == 3)	{
//			alert('The right click has been disabled.');
//			return false;
//			}
//		}
}
if(document.layers){
	document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;


