var windows=new Array();

windows['bunker']=new Array();
windows['bunker']['width']=660;
windows['bunker']['height']=520 ;
windows['bunker']['scroll']=false;
windows['bunker']['url']='pop_bunker.html';

windows['promo']=new Array();
windows['promo']['width']=660;
windows['promo']['height']=520;
windows['promo']['scroll']=true;
windows['promo']['url']='pop_promo.html';

function popBunker(url) {
	opts="toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0,scrollbars=0,resizable=0,width=660,height=500";
	window.open(url,'xmasPop',opts);
}

function MM_displayStatusMsg(msgStr)  { //v3.0
	status=msgStr; document.MM_returnValue = true;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function popWin(name,url) {
	if (typeof windows[name]=="object") {
		var url=( (url) ? url : windows[name]['url']);
		var scroll=windows[name]['scroll'];

		opts="toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0,scrollbars="+( (scroll) ? 1 : 0 )+",resize=0,width="+windows[name]['width']+",height="+windows[name]['height'];

		if (typeof document.a == "object" && (!document.a.closed)) {
			document.a.close();
			document.a=false;
			document.b=window.open(url,name,opts);
		} else if (typeof document.b == "object" && (!document.b.closed)) {
			document.b.close();
			document.b=false;
			document.a=window.open(url,name,opts);
		} else {
			document.a=window.open(url,name,opts);
		}
	}
}

function disappear() {
	if (typeof document.a == "object" && (!document.a.closed))
		document.a.close();
	if (typeof document.b == "object" && (!document.b.closed))
		document.b.close();
}

function popoMatic(name,url) {
	var url=( (url) ? url : windows[name]['url']);
	var scroll=windows[name]['scroll'];
	var opts="toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0,scrollbars="+( (scroll) ? 1 : 0 )+",resize=0,width="+windows[name]['width']+",height="+windows[name]['height'];
	if (typeof windows[name]=="object") {


		var hasOrigOpener=(typeof self.document.origOpener=="object" && self.document.origOpener.document);
		if (hasOrigOpener) {
			var a=self.document.origOpener.document.a;
			var b=self.document.origOpener.document.b;
		} else if (self.opener.document) {
			var a=self.opener.document.a;
			var b=self.opener.document.b;
		}

		c=window.open(url,name,opts);
		if (hasOrigOpener)
			c.document.origOpener=self.document.origOpener;
		else
			c.document.origOpener=self.opener;

		if (typeof a == "object" && (!a.closed))
			eval ( (hasOrigOpener) ? "self.document.origOpener.document.b=c" : ( (self.opener.document) ? "self.opener.document.b=c" : "" ) );
		else
			eval ( (hasOrigOpener) ? "self.document.origOpener.document.a=c" : ( (self.opener.document) ? "self.opener.document.a=c" : "" ) );

		self.close();
	}
}




var requiredVersion = 4;

// system globals
var flash2Installed = false;		// boolean. true if flash 2 is installed
var flash3Installed = false;		// boolean. true if flash 3 is installed
var flash4Installed = false;		// boolean. true if flash 4 is installed
var flash5Installed = false;		// boolean. true if flash 5 is installed
var maxVersion = 5;					// highest version we can actually detect
var actualVersion = 0;				// version the user really has
var hasRightVersion = false;		// boolean. true if it's safe to embed the flash movie in the page

// write vbscript detection if we're on ie win

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;	// true if we're on ie
var isMac = (navigator.appVersion.indexOf("Mac") != -1) ? true : false; // true if we're on mac

if(isIE && !isMac){ // don't write vbscript tags on anything but ie win
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
	document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

function detectFlash(){	// pack the detector into a function so it loads before we run it
	// do our javascript detection if the navigator object is fully supported

	if (navigator.plugins){								// does navigator.plugins exist?
		if (navigator.plugins["Shockwave Flash 2.0"] 	// yes>> then is Flash 2 installed?
		|| navigator.plugins["Shockwave Flash"]){		// or is flash 3+ installed?

			// set convenient references to flash 2 and the plugin description and version
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));

			// now set appropriate version flags
			flash2Installed = (flashVersion == 2)?true:false;
			flash3Installed = (flashVersion == 3)?true:false;
			flash4Installed = (flashVersion == 4)?true:false;
			flash5Installed = (flashVersion == 5)?true:false;
		}
	}

	// loop through all versions we're checking, and set actualVersion to highest detected versio
	for (var i = 2; i <= maxVersion; i++){
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
	}

	// uncomment next line to display flash version during testing
	// alert("version detected: " + actualVersion);


	// we've finished getting the version, time to take the appropriate action

	if (actualVersion >= requiredVersion) 				// user has a new enough version of flash
		hasRightVersion=true
}
detectFlash();

function showMeTheDate() {
	var theDate=new Date();
	//document.write("<p><span style=\"color:#ffffff;\">"+theDate.toLocaleString()+"</span></p>");
	document.write("&nbsp;");
}

function doThisBit() {
	if (getCookie("black")=="white") {
		drawTheBanner();
	} else {
		drawTheForm();
	}
}


