function setSize() {

	var pageSize = this.getPageSize();
	var vpWidth = pageSize[2];
	var vpHeight = pageSize[3];

	// alert(vpWidth + " - " + vpHeight + " - " + contentHeight);

	// topnav = 300 
	// footer = 20
	// TOTAL: 320
	
	// 320 is the minimum content on the page
	
	// If the viewport is larger than 320, then HEIGHTSET should be sized to make sure
	// the footer is at the bottom of the page; the size of the HEIGHTSET is viewport - 320.
	// We then add another pixel to make sure there's always a scrollbar.
	
	var contentHeight = vpHeight - 320 + 1;   

	 if (vpHeight > 321 ) {
	 	document.getElementById("heightSet").style.height = contentHeight + "px";
	 	}
	 	
	}
		
// ===============================================================================================================================

getPageSize = function() {
	var xScroll, yScroll, windowWidth, windowHeight;
	if (window.innerHeight && window.scrollMaxY) {
		xScroll = this.document.scrollWidth;
		yScroll = (this.isFrame ? parent.innerHeight : self.innerHeight) + (this.isFrame ? parent.scrollMaxY : self.scrollMaxY);
		}
	else if (this.document.body.scrollHeight > this.document.body.offsetHeight){
		xScroll = this.document.body.scrollWidth;
		yScroll = this.document.body.scrollHeight;
		}
	else {
		xScroll = this.document.getElementsByTagName("html").item(0).offsetWidth;
		yScroll = this.document.getElementsByTagName("html").item(0).offsetHeight;
		xScroll = (xScroll < this.document.body.offsetWidth) ? this.document.body.offsetWidth : xScroll;
		yScroll = (yScroll < this.document.body.offsetHeight) ? this.document.body.offsetHeight : yScroll;
		}

	if (self.innerHeight) {
		windowWidth = (this.isFrame) ? parent.innerWidth : self.innerWidth;
		windowHeight = (this.isFrame) ? parent.innerHeight : self.innerHeight;
		}
	else if (document.documentElement && document.documentElement.clientHeight) {
		windowWidth = this.document.documentElement.clientWidth;
		windowHeight = this.document.documentElement.clientHeight;
		}
	else if (document.body) {
		windowWidth = this.document.getElementsByTagName("html").item(0).clientWidth;
		windowHeight = this.document.getElementsByTagName("html").item(0).clientHeight;
		windowWidth = (windowWidth == 0) ? this.document.body.clientWidth : windowWidth;
		windowHeight = (windowHeight == 0) ? this.document.body.clientHeight : windowHeight;
		}

	var pageHeight = (yScroll < windowHeight) ? windowHeight : yScroll;
	var pageWidth = (xScroll < windowWidth) ? windowWidth : xScroll;
	return new Array(pageWidth, pageHeight, windowWidth, windowHeight);
	}


// ===============================================================================================================================

function loadVideo(vidFile) {

	var soCC = new SWFObject("/flash/mediaplayer.swf?height=260&width=320&file=/gallery/videos/cmoncmon.flv&image=/gallery/images/prevCmonCmon.jpg&amp;backcolor=0xc0c0c0&lightcolor=0x990000&amp;logo=images/topRight.png&showstop=true&autostart=true", "cmoncmon", "320", "260", "8", "#000000");	
	var soNL = new SWFObject("/flash/mediaplayer.swf?height=260&width=320&file=/gallery/videos/nineLives.flv&image=/gallery/images/prevNineLives.jpg&amp;backcolor=0xc0c0c0&lightcolor=0x990000&amp;logo=/gallery/images/topRight.png&showstop=true&autostart=true", "ninelives", "320", "260", "8", "#000000");
	var soRO = new SWFObject("/flash/mediaplayer.swf?height=260&width=320&file=/gallery/videos/rockOn.flv&image=/gallery/images/prevRockOn.jpg&amp;backcolor=0xc0c0c0&lightcolor=0x990000&amp;logo=/gallery/images/topRight.png&showstop=true&autostart=true", "rockon", "320", "260", "8", "#000000");
	var soNMW = new SWFObject("/flash/mediaplayer.swf?height=260&width=320&file=/gallery/videos/noMatterWhat.flv&image=/gallery/images/prevNoMatterWhat.jpg&amp;backcolor=0xc0c0c0&lightcolor=0x990000&amp;logo=/gallery/images/topRight.png&showstop=true&autostart=true", "nomatterwhat", "320", "260", "8", "#000000");
	var soEHone = new SWFObject("/flash/mediaplayer.swf?height=260&width=320&file=/gallery/videos/trailerEhCheckThisOut.flv&image=/gallery/images/prevCheckThisOut.jpg&amp;backcolor=0xc0c0c0&lightcolor=0x990000&amp;logo=/gallery/images/topRight.png&showstop=true&autostart=true", "ehcheckthisout", "320", "260", "8", "#000000");
	var soEHtwo = new SWFObject("/flash/mediaplayer.swf?height=260&width=320&file=/gallery/videos/trailerEhCheckThisOut2.flv&image=/gallery/images/prevCheckThisOut2.jpg&amp;backcolor=0xc0c0c0&lightcolor=0x990000&amp;logo=/gallery/images/topRight.png&showstop=true&autostart=true", "ehcheckthisout2", "320", "260", "8", "#000000");


	if (vidFile == "ninelives") {
		soNL.write("videoFrame");	
		document.getElementById("bcTitle").innerHTML = "Nine Lives";
		document.getElementById("videoTitle").innerHTML = "Nine Lives";
		}
	else if (vidFile == "cmoncmon") {
		soCC.write("videoFrame");		
		document.getElementById("bcTitle").innerHTML = "C'Mon C'Mon";
		document.getElementById("videoTitle").innerHTML = "C'Mon C'Mon";
		}
	else if (vidFile == "rockon") {
		soRO.write("videoFrame");		
		document.getElementById("bcTitle").innerHTML = "Rock On";
		document.getElementById("videoTitle").innerHTML = "Rock On";
		}
	else if (vidFile == "nomatterwhat") {
		soNMW.write("videoFrame");		
		document.getElementById("bcTitle").innerHTML = "No Matter What";
		document.getElementById("videoTitle").innerHTML = "No Matter What";
		}
	else if (vidFile == "ehcheckthisout1") {
		soEHone.write("videoFrame");		
		document.getElementById("bcTitle").innerHTML = "Eh! Check this out (part 1) preview";
		document.getElementById("videoTitle").innerHTML = "Eh! Check this out (part 1) preview";
		}
	else if (vidFile == "ehcheckthisout2") {
		soEHtwo.write("videoFrame");		
		document.getElementById("bcTitle").innerHTML = "Eh! Check this out (part 2) preview";
		document.getElementById("videoTitle").innerHTML = "Eh! Check this out (part 2) preview";
		}		

	}
// ===============================================================================================================================

function loadFCvideo(vidFile) {

	var soCClive = new SWFObject("/flash/mediaplayer.swf?height=380&width=480&file=/fanclub/allaccess/videos/cmoncmonlive.flv&image=/fanclub/allaccess/videos/prevcmoncmonlive.jpg&amp;backcolor=0xc0c0c0&lightcolor=0x990000&amp;logo=/gallery/images/topRight.png&showstop=true&allowfullscreen=false", "cmoncmonlive", "480", "380", "8", "#000000");
	var so2008live = new SWFObject("/flash/mediaplayer.swf?height=380&width=480&file=/fanclub/allaccess/videos/2008live.flv&image=/fanclub/allaccess/videos/prev2008live.jpg&amp;backcolor=0xc0c0c0&lightcolor=0x990000&amp;logo=/gallery/images/topRight.png&showstop=true&allowfullscreen=false", "2008live", "480", "380", "8", "#000000");
	var soEHone = new SWFObject("/flash/mediaplayer.swf?height=380&width=480&file=/fanclub/allaccess/videos/ehcheckthisout1.flv&image=/fanclub/allaccess/videos/prevCheckThisOutFull1.jpg&amp;backcolor=0xc0c0c0&lightcolor=0x990000&amp;logo=/gallery/images/topRight.png&showstop=true&allowfullscreen=false", "ehcheckthisout1", "480", "380", "8", "#000000");
	var soEHtwo = new SWFObject("/flash/mediaplayer.swf?height=380&width=480&file=/fanclub/allaccess/videos/ehcheckthisout2.flv&image=/fanclub/allaccess/videos/prevCheckThisOutFull2.jpg&amp;backcolor=0xc0c0c0&lightcolor=0x990000&amp;logo=/gallery/images/topRight.png&showstop=true&allowfullscreen=false", "ehcheckthisout1", "480", "380", "8", "#000000");
			   
	if (vidFile == "cmoncmonlive") {
		soCClive.write("videoFrame");	
		document.getElementById("bcTitle").innerHTML = "C'Mon C'Mon (live excerpt)";
		document.getElementById("videoTitle").innerHTML = "C'Mon C'Mon (live excerpt)";
		}
	else if (vidFile == "2008live") {
		so2008live.write("videoFrame");	
		document.getElementById("bcTitle").innerHTML = "2008 Live Excerpts";
		document.getElementById("videoTitle").innerHTML = "2008 Live Excerpts";
		}

	else if (vidFile == "ehcheckthisout1") {
		soEHone.write("videoFrame");	
		document.getElementById("bcTitle").innerHTML = "EH! Check This Out (part 1)";
		document.getElementById("videoTitle").innerHTML = "EH! Check This Out (part 1)";
		}
	else if (vidFile == "ehcheckthisout2") {
		soEHtwo.write("videoFrame");	
		document.getElementById("bcTitle").innerHTML = "EH! Check This Out (part 2)";
		document.getElementById("videoTitle").innerHTML = "EH! Check This Out (part 2)";
		}

	}
// ===============================================================================================================================


function externalLinks() {
	if (!document.getElementsByTagName) return;
 	var anchors = document.getElementsByTagName("a");
 	for (var i=0; i<anchors.length; i++) {
 		var anchor = anchors[i];
   		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
     		anchor.target = "_blank";
 		}
	}


// ===============================================================================================================================

function disclaimerPop(action) {
	if (action == "open") {
		document.getElementById("disclaimer").style.display = "block";
		}

	if (action == "close") {
		document.getElementById("disclaimer").style.display = "none";
		}	
	}
	
// ===============================================================================================================================
	


function callScripts() {
	externalLinks();
	setSize();
	}
	
	
window.onload = callScripts;




