
//var swfWidth = opener.swfWidth;
//var swfHeight = opener.swfHeight;
var winWidth = window.screen.availWidth;
var winHeight = window.screen.availHeight;
var swfTarget = "Main.swf";
var browserName=navigator.appName;
var operatingSystem=navigator.platform;
var version = parseFloat(navigator.appVersion);
var src = "";	//From url parameter
var pin = "";	//From url parameter

function open_actech(url){
	var nHeight = 511;
	var nWidth = 777;
	var nXpos = (screen.availWidth - nWidth) / 2;
	var nYpos = (screen.availHeight - nHeight) / 2;
	var statusPopup =
		  window.open(url, 'win_actech',
					  'top=' + nYpos + ',left=' + nXpos +
					  ',screenY=' + nYpos + ',screenX=' + nXpos +
					  ',height=' + nHeight + ',width=' + nWidth + ',scrollbars=0,resizable=0');
	statusPopup.focus();
}

function open_mcdesign(url){
	var nHeight = 550;
	var nWidth = 770;
	var nXpos = (screen.availWidth - nWidth) / 2;
	var nYpos = (screen.availHeight - nHeight) / 2;
	var statusPopup =
		  window.open(url, 'win_mcdesign',
					  'top=' + nYpos + ',left=' + nXpos +
					  ',screenY=' + nYpos + ',screenX=' + nXpos +
					  ',height=' + nHeight + ',width=' + nWidth + ',scrollbars=0,resizable=0');
	statusPopup.focus();
}

function setObject() {

//Parses the URL parameters and sets the src and pin vars that then get passed to the flash movie
urlquery=location.href.split("?");

if(urlquery.length > 1){ //checks for parameters
	urlterms=urlquery[1].split("&");
	
	for (i=0;i<urlterms.length;i++){
		if (urlterms[i].split("=")[0].toLowerCase() == "source"){
			src=urlterms[i].split("=")[1];
		}
		if (urlterms[i].split("=")[0].toLowerCase() == "pin"){
			pin=urlterms[i].split("=")[1];
		}
	}
} 
// end

if (browserName.indexOf("Microsoft Internet Explorer")!=-1 && operatingSystem.indexOf("Win")!=-1) {
	var swfWidth = winWidth-11;
	var swfHeight = winHeight-59;
} else if (navigator.userAgent.indexOf('Safari') != -1) {
	var swfWidth = winWidth;
	var swfHeight = winHeight-23;
} else {
	var swfWidth = winWidth;
	var swfHeight = winHeight +10;
}

document.write("<head><title>thirtytwoRound</title></head><body bgcolor='#171717' marginwidth='0' marginheight='0' topmargin='0' leftmargin='0' rightmargin='0' scroll='auto'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" + swfWidth + "'height='" + swfHeight + "'><param name='movie' value='" + swfTarget + "?winHeight=" + winHeight + "&winWidth=" + winWidth + "&swfWidth=" + swfWidth + "&swfHeight=" + swfHeight + "&source=" + src + "&pin=" + pin + "&align='middle'><param name='quality' value='high'><embed src='" + swfTarget + "?winHeight=" + winHeight + "&winWidth=" + winWidth + "&swfHeight=" + swfHeight + "&swfWidth=" + swfWidth + "&source=" + src + "&pin=" + pin + "&quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + swfWidth + "' height='" + swfHeight + "' &align='middle'><" + "/embed><" + "/object></body>");
}

function open_bmw3(url){
	URLen = url;
	// width and height of swf
	var swfWidth = 500;
	var swfHeight = 400;
	
	// defaults, if we're not able to retrieve actual dimensions
	var winHeight = 800
	var winWidth = 600;

	var windowNamen="_blank";
	var browserName=navigator.appName;
	var operatingSystem=navigator.platform;
	var version = parseFloat(navigator.appVersion);
	var winWidth = window.screen.availWidth;
	var winHeight = window.screen.availHeight;

	// Netscape check version 4.0+ on Mac
	if (browserName.indexOf("Netscape")!=-1 && version>=4.0 && operatingSystem.indexOf("Mac")!=-1)
	{
		 window.open(URLen,windowNamen,'titlebar=no,top=0,left=0,width=' + winWidth +',height='+winHeight+',screenX=0,screenY=0,top=0,left=0')
	}

	// MSIE Mac check
	else if (browserName.indexOf("Microsoft Internet Explorer")!=-1 && operatingSystem.indexOf("Mac")!=-1)
	{
		window.open(URLen,windowNamen,'titlebar=no,top=0,left=0,width=' + winWidth +',height='+ winHeight +',screenX=0,screenY=0,top=0,left=0')
	}

	// Netscape Mac check
	else if (browserName.indexOf("Netscape")!=-1 && operatingSystem.indexOf("Mac")!=-1)
	{
		winWidth = screen.width;
		winHeight = screen.height;
		window.open(URLen,windowNamen,'width='+ winWidth +',height='+ winHeight +',top=0,left=0');
	}

	// MSIE Windows
	else if (browserName.indexOf("Microsoft Internet Explorer")!=-1 && operatingSystem.indexOf("Win")!=-1)
	{
		//window.open(URLen,windowNamen,'fullscreen=1,top=0,left=0');		 
		var win = window.open(URLen,windowNamen,'titlebar=no,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,top=0,left=0,width=' + winWidth +',height='+ winHeight +',screenX=0,screenY=0,top=0,left=0');
		win.resizeTo(screen.width, screen.height);
		//win.moveTo(1, 1);
		//win.moveTo(0, 0);
		//win.resizeTo(screen.width, screen.height);
	}

		// Netscape Windows
	else if (browserName.indexOf("Netscape")!=-1 && operatingSystem.indexOf("Win")!=-1)
	{
		winWidth = screen.width;
		winHeight = screen.height;		 
		window.open(URLen,windowNamen,'width='+ winWidth +',height='+ winHeight +',top=0,left=0');
	}

	else
	{
		window.open(URLen,windowNamen);
	}
	window.winWidth = winWidth;
	window.winHeight = winHeight;
}

function open_bmw3aa(url){
	URLen = url;
	// width and height of swf
	var swfWidth = 500;
	var swfHeight = 400;
	
	// defaults, if we're not able to retrieve actual dimensions
	var winHeight = 800
	var winWidth = 600;

	var windowNamen="_blank";
	var browserName=navigator.appName;
	var operatingSystem=navigator.platform;
	var version = parseFloat(navigator.appVersion);
	var winWidth = window.screen.availWidth;
	var winHeight = window.screen.availHeight;

	// Netscape check version 4.0+ on Mac
	if (browserName.indexOf("Netscape")!=-1 && version>=4.0 && operatingSystem.indexOf("Mac")!=-1)
	{
		 window.open(URLen,windowNamen,'titlebar=no,top=0,left=0,width=' + winWidth +',height='+winHeight+',screenX=0,screenY=0,top=0,left=0')
	}

	// MSIE Mac check
	else if (browserName.indexOf("Microsoft Internet Explorer")!=-1 && operatingSystem.indexOf("Mac")!=-1)
	{
		window.open(URLen,windowNamen,'titlebar=no,top=0,left=0,width=' + winWidth +',height='+ winHeight +',screenX=0,screenY=0,top=0,left=0')
	}

	// Netscape Mac check
	else if (browserName.indexOf("Netscape")!=-1 && operatingSystem.indexOf("Mac")!=-1)
	{
		winWidth = screen.width;
		winHeight = screen.height;
		window.open(URLen,windowNamen,'width='+ winWidth +',height='+ winHeight +',top=0,left=0');
	}

	// MSIE Windows
	else if (browserName.indexOf("Microsoft Internet Explorer")!=-1 && operatingSystem.indexOf("Win")!=-1)
	{
		//window.open(URLen,windowNamen,'fullscreen=1,top=0,left=0');		 
		var win = window.open(URLen,windowNamen,'titlebar=no,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,top=0,left=0,width=' + winWidth +',height='+ winHeight +',screenX=0,screenY=0,top=0,left=0');
		win.resizeTo(screen.width, screen.height);
		//win.moveTo(1, 1);
		//win.moveTo(0, 0);
		//win.resizeTo(screen.width, screen.height);
	}

		// Netscape Windows
	else if (browserName.indexOf("Netscape")!=-1 && operatingSystem.indexOf("Win")!=-1)
	{
		winWidth = screen.width;
		winHeight = screen.height;		 
		window.open(URLen,windowNamen,'width='+ winWidth +',height='+ winHeight +',top=0,left=0');
	}

	else
	{
		window.open(URLen,windowNamen);
	}
	window.winWidth = winWidth;
	window.winHeight = winHeight;
}