function BrowserCheck() {
	var b = navigator.appName;
	if (b=="Netscape") this.b = "ns";
	else if (b=="Microsoft Internet Explorer") this.b = "ie";
	else this.b = b;
	this.version = navigator.appVersion;
	this.v = parseInt(this.version);
	this.ns = (this.b=="ns" && this.v>=4);
	this.ns4 = (this.b=="ns" && this.v==4);
	this.ns5 = (this.b=="ns" && this.v==5);
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0);
	this.ie5 = (this.version.indexOf('MSIE 5')>0);
	this.min = (this.ns||this.ie);
	this.pc = (this.version.indexOf('Win')>0);
	this.mac = (this.version.indexOf('PPC')>0);
	this.ns408=(parseFloat(this.version)==4.08);
}

var is = new BrowserCheck();

if (navigator.appName=="Netscape" && parseInt(navigator.appVersion)==4) {
	widthCheck = window.innerWidth;
	heightCheck = window.innerHeight;
	window.onResize = resizeFix;
}

function popWindow(urlVal,windowName,widthVal,heightVal) {
	var paraString;
	var wt;
	var ht;
	var width = screen.width;
	var height = screen.height;
	var winWidth;
	var winHeight;
	var curLeft;
	var curTop;
	// Bug fix: we are now blanking the windowName variable
	windowName == "";
	wt = widthVal;
	ht = heightVal;
	if (navigator.appName == "Netscape") {
		curLeft = self.screenX;
		curTop = self.screenY;
	  	winWidth = window.innerWidth;
		winHeight = window.innerHeight;
	}
	else {
		curLeft = self.screenLeft;
		curTop = self.screenTop;
		winWidth = document.documentElement.offsetWidth;
		winHeight = document.documentElement.offsetHeight;
	}

	var winl;
	var wint;

	if (wt > winWidth) {
			winl = (screen.width - wt) / 2;
	}
	else {
		winl = curLeft + ((winWidth - wt) / 2);
	}

	if (ht > winHeight) {
			var wint = (screen.height - ht) / 2;
	}
	else {
		wint = curTop + ((winHeight - ht) / 2);
	}

	if (is.pc){wint = wint - 25};
	paraString = "width=" + wt + ",height=" + ht + ",top=" + wint + ",left=" + winl;

	paraString = paraString + ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0";

	if(is.ie && is.pc) {
		if(typeof(poppedWindow) == "object") {
			poppedWindow.close();
			if(is.ie4) {
				poppedWindow = window.open(urlVal,windowName,paraString);
			}
		}
	}
	poppedWindow = window.open(urlVal,windowName,paraString);
	poppedWindow.focus();
}

function popPoster(urlVal,windowName,widthVal,heightVal) {
	var paraString;
	var wt;
	var ht;
	var width = screen.width;
	var height = screen.height;
	var winWidth;
	var winHeight;
	var curLeft;
	var curTop;
	// Bug fix: we are now blanking the windowName variable
	windowName == "";
	wt = widthVal;
	ht = heightVal;
	if (navigator.appName == "Netscape") {
		curLeft = self.screenX;
		curTop = self.screenY;
	  	winWidth = window.innerWidth;
		winHeight = window.innerHeight;
	}
	else {
		curLeft = self.screenLeft;
		curTop = self.screenTop;
		winWidth = document.documentElement.offsetWidth;
		winHeight = document.documentElement.offsetHeight;
	}

	var winl;
	var wint;

	if (wt > winWidth) {
			winl = (screen.width - wt) / 2;
	}
	else {
		winl = curLeft + ((winWidth - wt) / 2);
	}

	if (ht > winHeight) {
			var wint = (screen.height - ht) / 2;
	}
	else {
		wint = curTop + ((winHeight - ht) / 2);
	}

	if (is.pc){wint = wint - 25};
	paraString = "width=" + wt + ",height=" + ht + ",top=" + wint + ",left=" + winl;

	paraString = paraString + ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0";

	if(is.ie && is.pc) {
		if(typeof(poppedWindow) == "object") {
			poppedWindow.close();
			if(is.ie4) {
				poppedWindow = window.open(urlVal,windowName,paraString);
			}
		}
	}
	poppedWindow = window.open(urlVal,windowName,paraString);
	poppedWindow.focus();
}

function launchLegal() {
	popWindow('legal.html','legal',655,160);
}
function launchSite() {
	popWindow('main.html','finesthour_site',780,540);
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function img_on(imgname){
    document['sections'].src = eval(imgname + "_on.src");
}

function img_off(imgname){ 
	document.images['sections'].src = eval(imgname + "_off.src"); 
} 

if (document.images) {
enter_on = newImage("images/enteron.jpg");
//enter_on = newImage("images/entercoming.jpg");
enter_off = newImage("images/sectionsoff.jpg");
//photos_on = newImage("images/photoson.jpg");
photos_on = newImage("images/sectionsoff.jpg");
photos_off = newImage("images/sectionsoff.jpg");
mobile_on = newImage("images/sectionsoff.jpg");
mobile_off = newImage("images/sectionsoff.jpg");
contests_on = newImage("images/contestson.jpg");
contests_off = newImage("images/sectionsoff.jpg");
partners_on = newImage("images/sectionsoff.jpg");
partners_off = newImage("images/sectionsoff.jpg");
tickets_on = newImage("images/sectionsoff.jpg");
tickets_off = newImage("images/sectionsoff.jpg");

}

function midImg_on(imgname){
    document['middle'].src = eval(imgname + "_on.src");
}

function midImg_off(imgname){ 
	document.images['middle'].src = eval(imgname + "_off.src"); 
} 
if (document.images) {
middle_on = newImage("images/middleon.jpg");
middle2_on = newImage("images/middleon2.jpg");
middle_off = newImage("images/middleoff.jpg");

}
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function beyondtheSeaSplash_DoFSCommand(command, args) {
	var beyondtheSeaSplashObj = isInternetExplorer ? document.all.beyondtheSeaSplash : document.beyondtheSeaSplash;
	//
	// Place your code here.
	//
}

function hide ( name ) {
	NS4 = (document.layers) ? 1 : 0;
	IE4 = (document.all) ? 1 : 0;
	W3C = (document.getElementById) ? 1 : 0;        
	if (W3C) {
		document.getElementById(name).style.display = "none";
	} else if (NS4) {
		document.layers[name].visibility = "none";
	} else {
		document.all[name].style.display = "none";
	}
}
function show (name ) {
	var ele;                //points to the popup element

	NS4 = (document.layers) ? 1 : 0;
	IE4 = (document.all) ? 1 : 0;
	W3C = (document.getElementById) ? 1 : 0;

	if ( W3C ) {
		ele = document.getElementById(name);
	} else if ( NS4 ) {
		ele = document.layers[name];
	} else {        // meant for IE4
		ele = window.opener.document.all[name];
	}

	if ( NS4 ) {
		ele.visibility.display = "block";
	} else {  // IE4 & W3C
		ele.style.display = "block";
	}
}

function showvideo(){ 
 hide('videooff');
 show('videoon');
}

function hidevideo(){ 
 hide('videoon');
 show('videooff');
}

// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub beyondtheSeaSplash_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call beyondtheSeaSplash_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

function translateQueryString() {
	var sQS	= unescape(location.search).substr(1);
	var oQS	= {};
	if (sQS.length) {
		var aQS_items	= sQS.split('&'), nQS_items = aQS_items.length, nQS_itemsIdx, aQS_keyValue, nQS_keyValue, nQS_keyValueIdx;
		for (nQS_itemsIdx = 0; nQS_itemsIdx < nQS_items; nQS_itemsIdx++) {
			aQS_keyValue	= aQS_items[nQS_itemsIdx].split('='), nQS_keyValue = aQS_keyValue.length;
			for (nQS_keyValueIdx = 0; nQS_keyValueIdx < nQS_keyValue; nQS_keyValueIdx++) oQS[aQS_keyValue[0]] = aQS_keyValue[1];
		}
	}
	return oQS;
}
var QueryString	= translateQueryString();


  var photo 
  photo = (QueryString['photo']*1);

	var picNum;

		 if (photo != "undefined") { 
			picNum = photo;
			} else {
			picNum = 1;
			}

   var maxVal = 8;
   var picArray = new Array('1','2','3','4','5','6','7','8')


   function picNav(navVal) {

	pNum = navVal

    picNum = pNum;
    document.gallery.mytext.value = picArray[picNum-1];
    document.images[2].src = 'images/downloads/screenshots/SS_int' + picNum + '.jpg';
    document.images[6].src = 'images/screenthumbs' + picNum + '.jpg';
   }

function checkOS() {
	if((navigator.userAgent.indexOf('Win') != -1) &&
		(navigator.userAgent.indexOf('95') != -1))
		{ var OpSys = "windows"; 
		var SSPath = "WindowsScreensaver.zip";
		}
	else if(navigator.userAgent.indexOf('Win') != -1)
		{ var OpSys = "windows";
		var SSPath = "WindowsScreensaver.zip";
		}
	else if(navigator.userAgent.indexOf('Mac') != -1)
		{ var OpSys = "mac"; 
		var SSPath = "MacScreensavers.sit";
		}
	else
		{ var OpSys = "windows"; 
		var SSPath = "WindowsScreensaver.zip";
		}
	return "http://pdl.warnerbros.com/wbmovies/constantine/html_site/screensavers/" + SSPath ;
}

function openOriginalSins()
	{
	if (window.opener && !window.opener.closed)
		{
		window.opener.document.location = "http://www.originalsins.net";
		}
	else
		{
		window.open("http://www.originalsins.net", "originalsins");
		}
	}
	
function openPhotoTemp(id,size) {
	var paraString;
	var wt;
	var ht;
	var imgwt;
	var imght;
	var scrollwidth;
	var scrollheight;
	var scroll;
	var resize;
	var width = screen.width;
	var height = screen.height;
	var winWidth;
	var winHeight;
	var curLeft;
	var curTop;

	scrollwidth = 16;
	scrollheight = 16;

	//Size 1 = 480 x 720
	//Size 2 = 720 x 300
	//Size 3 = 720 x 480
	//Variables below (ht & wt) are for sizing the window
	//Variables below (ht & wt) are for sizing the image in the new file
	if (size == 1) {
		imgwt = 480;
		imght = 720;
		if (screen.height > 600){
			wt = 480;
			ht = 720;
			scroll = 0;
			resize = 0;
			}
		else{
		wt = 480 + scrollwidth;
		ht = 360;
		scroll = 1;
		resize = 1;
		}
		}
	else if (size == 2) {
		imgwt = 720;
		imght = 300;
		wt = 720;
		ht = 300;
		scroll = 0;
		resize = 0;
		}
	else if (size == 3) {
		imgwt = 720;
		imght = 480;
		wt = 720;
		ht = 480;
		scroll = 0;
		resize = 0;
		}

	if (navigator.appName == "Netscape") {
		curLeft = self.screenX;
		curTop = self.screenY;
	  	winWidth = window.innerWidth;
		winHeight = window.innerHeight;
	}
	else {
		curLeft = self.screenLeft;
		curTop = self.screenTop;
		winWidth = document.documentElement.offsetWidth;
		winHeight = document.documentElement.offsetHeight;
	}

	var winl;
	var wint;

	if (wt > winWidth) {
			winl = (screen.width - wt) / 2;
	}
	else {
		winl = curLeft + ((winWidth - wt) / 2);
	}

	if (ht > winHeight) {
			var wint = (screen.height - ht) / 2;
	}
	else {
		wint = curTop + ((winHeight - ht) / 2);
	}

	if (is.pc){wint = wint - 25};
	
	paraString = "width=" + wt + ",height=" + ht + ",top=" + wint + ",left=" + winl;
	paraString = paraString + ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scroll + ",resizable=" + resize;

	poppedWindow = window.open("","photos",paraString);
	
	poppedWindow.document.write('<html><head><title>Constantine</title></head><body bgcolor="#000" leftmargin="0px" rightmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px"><a href="#" onClick="top.close();"><img src="downloads/photos/' + id + '.jpg" width="' + imgwt + '" height="' + imght + '" border="0"></a></body></html>')

	poppedWindow.focus();
}

function openWallpaper(id) {
	var paraString;
	var wt;
	var ht;
	var width = screen.width;
	var height = screen.height;
	var winWidth;
	var winHeight;
	var curLeft;
	var curTop;

	wt = 800;
	ht = 600;

	if (navigator.appName == "Netscape") {
		curLeft = self.screenX;
		curTop = self.screenY;
	  	winWidth = window.innerWidth;
		winHeight = window.innerHeight;
	}
	else {
		curLeft = self.screenLeft;
		curTop = self.screenTop;
		winWidth = document.documentElement.offsetWidth;
		winHeight = document.documentElement.offsetHeight;
	}

	var winl;
	var wint;

	if (wt > winWidth) {
			winl = (screen.width - wt) / 2;
	}
	else {
		winl = curLeft + ((winWidth - wt) / 2);
	}

	if (ht > winHeight) {
			var wint = (screen.height - ht) / 2;
	}
	else {
		wint = curTop + ((winHeight - ht) / 2);
	}

	if (is.pc){wint = wint - 25};
	paraString = "width=" + wt + ",height=" + ht + ",top=" + wint + ",left=" + winl;
	paraString = paraString + ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1";

	poppedWindow = window.open("wallpaperview.html?id=" + id + "&size=800","wallpapers",paraString);
	poppedWindow.focus();
}

function openFanArt(id) {
	var paraString;
	var wt;
	var ht;
	var imgwt;
	var imght;
	var scrollwidth;
	var scrollheight;
	var scroll;
	var resize;
	var width = screen.width;
	var height = screen.height;
	var winWidth;
	var winHeight;
	var curLeft;
	var curTop;

	scrollwidth = 16;
	scrollheight = 16;

	imgwt = 1024;
	imght = 768;

	if (id == 1 || id == 3 || id == 5 || id == 7 || id == 8 || id == 11 || id == 13) {
		imgwt = 1024;
		imght = 768;
		}
	else if (id == 2) {
		imgwt = 720;
		imght = 740;
		}
	else if (id == 4) {
		imgwt = 481;
		imght = 697;
		}
	else if (id == 6) {
		imgwt = 800;
		imght = 600;
		}
	else if (id == 9) {
		imgwt = 1172;
		imght = 1494;
		}
	else if (id == 10) {
		imgwt = 481;
		imght = 715;
		}
	else if (id == 12) {
		imgwt = 1018;
		imght = 764;
		}
	else if (id == 14) {
		imgwt = 750;
		imght = 964;
		}

	wt = imgwt;
	ht = (imght);
	
	if (navigator.appName == "Netscape") {
		curLeft = self.screenX;
		curTop = self.screenY;
	  	winWidth = window.innerWidth;
		winHeight = window.innerHeight;
	}
	else {
		curLeft = self.screenLeft;
		curTop = self.screenTop;
		winWidth = document.documentElement.offsetWidth;
		winHeight = document.documentElement.offsetHeight;
	}

	var winl;
	var wint;

	if (wt > winWidth) {
			winl = (screen.width - wt) / 2;
	}
	else {
		winl = curLeft + ((winWidth - wt) / 2);
	}

	if (ht > winHeight) {
			var wint = (screen.height - ht) / 2;
	}
	else {
		wint = curTop + ((winHeight - ht) / 2);
	}

	if (is.pc){wint = wint - 25};
	paraString = "width=" + wt + ",height=" + ht + ",top=" + wint + ",left=" + winl;
	paraString = paraString + ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scroll + ",resizable=" + resize;

	poppedWindow = window.open("","fanart",paraString);
	
	poppedWindow.document.write('<html><head><title>Constantine</title></head><body bgcolor="#000000" leftmargin="0px" rightmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px"><a href="#" onClick="top.close();"><img src="downloads/fanart/' + id + '.jpg" width="' + imgwt + '" height="' + imght + '" border="0"></a></body></html>')

	poppedWindow.focus();
}
