

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Codewise Lite - JavaScript Library for "Keeping Kids in the Game"

Copyright (c) 2004-2008 Codewise Systems Inc. and Twisted Lime Media Inc.
All rights reserved.

Created: 2008-09-26

Revision History:
  1.00	- Initial version. TB, 2008-09-26

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Browser and platform detection */

var iPLArray = new Array;
var iPLImagesArray = new Array;
var iPLCount = 0;

iPLImagesArray[iPLCount] = '\/media\/image\/gui\/bg.jpg'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/gui\/alt_content_bg.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/gui\/main_content_bg.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/gui\/tertiary_content_bg.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/gui\/wordmark_01.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/top_five_sign_up_title.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/skip_button_off.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/skip_button_on.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/homepage\/main_01.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/homepage\/main_02.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/homepage\/main_03.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/homepage\/main_04.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/homepage\/main_05.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/homepage\/main_06.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/homepage\/main_07.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/homepage\/main_08.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/find_fundraiser_title_01.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/league_rivalry_title_01.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/video_title_01.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/gui\/league_rivalry_title_01.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/gui\/top_five_01.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/gui\/top_five_02.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/join_button_off.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/join_button_on.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/play_now_button_off.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/play_now_button_on.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/search_button.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/create_button_off.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/create_button_on.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/get_in_the_game_button_off.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/get_in_the_game_button_on.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/top_fund_raisers_button_off.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/top_fund_raisers_button_on.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/top_rivals_button_off.png'; iPLCount++;
iPLImagesArray[iPLCount] = '\/media\/image\/content\/top_rivals_button_on.png'; iPLCount++;


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Browser and platform detection */

var agent = '';

if (navigator.userAgent) { 
	agent = navigator.userAgent.toLowerCase();
} else { 
	agent = navigator.appVersion.toLowerCase();
};

var is_mac = (agent.indexOf('mac') != -1);

var is_ie = (agent.indexOf('msie') != -1);
var is_ie7 = (is_ie && (agent.indexOf('msie 7.0') != -1));
var is_ie8 = (is_ie && (agent.indexOf('msie 8.0') != -1));
var is_ie7up = (is_ie && (is_ie7 || is_ie8));

var is_safari = (agent.indexOf('safari') != -1);


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Code for determining current URL, file name, path, protocol, etc. */

var URL = location.href;
var URLProtocol = location.protocol;
var URLHostName = location.hostname;
var URLPort = location.port;
var URLPath = location.pathname;
var URLHash = location.hash;
var URLSearch = location.search;
if (URL.indexOf('?') != -1) {
	URLMinusQueryStringTemp = URL.split('\\');
	URLMinusQueryString = URLMinusQueryStringTemp[0];
} else {
	// URLMinusQueryString = URLProtocol + URLHostName + URLPath;
	URLMinusQueryString = URL;
};

if ((fDPO == 'undefined') || (fDPO == null)) {
	var fDPO = ''; // folderDepthPathOffset
};

if ((mFPO == 'undefined') || (mFPO == null)) {
	var mFPO = ''; // mediaFolderPathOffset
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Code for determining display environment variables */

var scr_W = screen.width; // screenWidth
var scr_H = screen.height; // screenHeight

var win_IH; // windowInnerHeight
var win_ISH; // windowInnerScrollHeight

function dEV() { // determineEnvironmentVariables
	if (window.innerHeight) {
		win_IH = window.innerHeight;
		win_ISH = document.height;
	} else if ((document.documentElement) && (document.documentElement.clientHeight)) {
		win_IH = document.documentElement.clientHeight;
		win_ISH = document.documentElement.scrollHeight;
	} else if (document.body) {
		win_IH = document.body.clientHeight;
		win_ISH = document.body.scrollHeight;
	};

	if (document.body.scrollHeight) {
		win_ISH = document.body.scrollHeight;
	};

	if (document.height) {
		win_ISH = document.height;
	};

	if (document.documentElement.scrollHeight) {
		win_ISH = document.documentElement.scrollHeight;
	};

	if (is_ie7) {
		win_ISH = document.documentElement.scrollHeight;
	};

	// alert('win_IH = '+ win_IH + '\nwin_ISH = ' + win_ISH);
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Document Object Model code */

function gCOT() { // getCollectionsOfTags
	if (document.getElementsByTagName) {
		tAArray = document.getElementsByTagName('a');
		tDivArray = document.getElementsByTagName('div');
		tIFrameArray = document.getElementsByTagName('iframe');
		tImgArray = document.getElementsByTagName('img');
		tLiArray = document.getElementsByTagName('li');
		tObjectArray = document.getElementsByTagName('object');
		tPArray = document.getElementsByTagName('p');
		tSpanArray = document.getElementsByTagName('span');
		tHrArray = document.getElementsByTagName('hr');
	};
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Flash and Quicktime player detection */

var flashinstalled = 0;
var flashversion = 0;
var FlashPlayerVersionRequired = 8;
var FlashPlayerPluginObject = '';
var FlashMSDetect = "false";

var QuickTimePlayerInstalled = 0;
var QuickTimePlayerVersion = 0;
var QuickTimePlayerVersionRequired = 1;
var QuickTimePlayerPluginObject = '';
var QuickTimePlayerMSDetect = "false";

if ((navigator.plugins) && (navigator.plugins.length > 0)) {
	FlashPlayerPluginObject = navigator.plugins['Shockwave Flash'];
	if (FlashPlayerPluginObject) {
		flashinstalled = 2;
		if (FlashPlayerPluginObject.description) {
			var pluginDescription = FlashPlayerPluginObject.description;
			// flashversion = pluginDescription.charAt(pluginDescription.indexOf('.') - 1);
			flashversion = pluginDescription.split('.')[0].split('Shockwave Flash')[1];
		};
	} else {
		flashinstalled = 1;
		if (navigator.plugins['Shockwave Flash 2.0']) {
			flashinstalled = 2;
			flashversion = 2;
		};
	};

	for (loop00 = 0; loop00 < navigator.plugins.length; loop00++) {
		if (navigator.plugins[loop00].name.indexOf('QuickTime') != -1) { 
			QuickTimePlayerInstalled = 1;
			QuickTimePlayerVersion = parseFloat(navigator.plugins[loop00].name.substring(18));
		};
	};

} else if ((navigator.mimeTypes) && (navigator.mimeTypes.length)) {
	FlashPlayerPluginObject = navigator.mimeTypes['application/FlashPlayerPluginObject-shockwave-flash'];
	if ((FlashPlayerPluginObject) && (FlashPlayerPluginObject.enabledPlugin)) {
		flashinstalled = 2;
	} else {
		flashinstalled = 1;
	};

} else {
	FlashMSDetect = "true";
	QuickTimePlayerMSDetect = "true";
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Flash and QuickTime object embedding */

var eFM_ObjectTagHTML = ''; // embeddedFlashMovie_ObjectTagHML
var eFM_EmbedTagHTML = ''; // embeddedFlashMovie_EmbedTagHTML

function embedFlashMovie(eFM_Filename, eFM_Container, eFM_PlayerVersion, eFM_Width, eFM_Height, eFM_OptionalParameters) {
	eFM_ObjectTagHTML = '';
	eFM_EmbedTagHTML = '';

	if (document.getElementById(eFM_Container)) {
		var e_FC = document.getElementById(eFM_Container); // FlashContainerElement

		var eFM_IdAttribute01HTML = '';
		var eFM_IdAttribute02HTML = '';

		if (eFM_OptionalParameters) {
			eFM_Temp01 = eFM_OptionalParameters.split(',');

			for (loop00 = 0; loop00 < eFM_Temp01.length; loop00++) {
				eFM_Temp02 = eFM_Temp01[loop00].split('=');

				if (eFM_Temp02[0] == 'id') {
					eFM_IdAttribute01HTML += 'id="' + eFM_Temp02[1] + '" ';
					eFM_IdAttribute02HTML += 'name="' + eFM_Temp02[1] + '" ';
				};
			};
		};

		if (eFM_Filename.indexOf('http:\/\/') == -1) {
			// eFM_Filename = fDPO + mFPO + 'media\/flash\/' + eFM_Filename;
			// eFM_Filename = '\/media\/flash\/' + eFM_Filename;
		};

		eFM_ObjectTagHTML += '<object ' + eFM_IdAttribute01HTML + 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=' + eFM_PlayerVersion + ',0,0,0" width="' + eFM_Width + '" height="' + eFM_Height + '">';
		eFM_ObjectTagHTML += '<param name="movie" value="' + eFM_Filename + '" \/>';

		eFM_EmbedTagHTML += '<embed ' + eFM_IdAttribute02HTML + 'pluginspage="http:\/\/www.macromedia.com\/go\/getflashplayer" type="application\/x-shockwave-flash" src="' + eFM_Filename + '" width="' + eFM_Width + '" height="' + eFM_Height + '"';

		if (eFM_OptionalParameters) {
			for (loop00 = 0; loop00 < eFM_Temp01.length; loop00++) {
				eFM_Temp02 = eFM_Temp01[loop00].split('=');

				if (eFM_Temp02[0] != 'id') {
					eFM_ObjectTagHTML += '<param name="' + eFM_Temp02[0] + '" value="' + eFM_Temp02[1] + '" />';

					eFM_EmbedTagHTML += ' ' + eFM_Temp02[0] + '="' + eFM_Temp02[1] + '"';
				};
			};
		};

		eFM_EmbedTagHTML += '><\/embed>';
		eFM_ObjectTagHTML += eFM_EmbedTagHTML + '<\/object>';

		if ((flashinstalled == 2) && (flashversion >= eFM_PlayerVersion)) {
			e_FC.innerHTML = eFM_ObjectTagHTML;
		};
	} else {
		// alert('The necessary container element does NOT exist...');
	};
};

var eQTM_ObjectTagHTML = ''; // embeddedQuickTimeMovie_ObjectTagHML
var eQTM_EmbedTagHTML = ''; // embeddedQuickTimeMovie_EmbedTagHTML

function embedQuickTimeMovie(eQTM_Filename, eQTM_Container, eQTM_PlayerVersion, eQTM_Width, eQTM_Height, eQTM_OptionalParameters) {
	eQTM_ObjectTagHTML = '';
	eQTM_EmbedTagHTML = '';

	if (document.getElementById(eQTM_Container)) {
		var e_QC = document.getElementById(eQTM_Container); // QuickTimeContainerElement

		var eQTM_IdAttribute01HTML = '';
		var eQTM_IdAttribute02HTML = '';

		if (eQTM_OptionalParameters) {
			eQTM_Temp01 = eQTM_OptionalParameters.split(',');

			for (loop00 = 0; loop00 < eQTM_Temp01.length; loop00++) {
				eQTM_Temp02 = eQTM_Temp01[loop00].split('=');

				if (eQTM_Temp02[0] == 'id') {
					eQTM_IdAttribute01HTML += 'id="' + eQTM_Temp02[1] + '" ';
					eQTM_IdAttribute02HTML += 'name="' + eQTM_Temp02[1] + '" ';
				} else if ((eQTM_Temp02[0] == 'controller') && (eQTM_Temp02[1] == 'true')) {
					eQTM_Height += 16;
				};
			};
		};

		if (eQTM_Filename.indexOf('http:\/\/') == -1) {
			// eQTM_Filename = fDPO + mFPO + 'media\/flash\/' + eQTM_Filename;
			// eQTM_Filename = '\/media\/quicktime\/' + eQTM_Filename;
		};

		eQTM_ObjectTagHTML += '<object ' + eQTM_IdAttribute01HTML + 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http:\/\/www.apple.com\/qtactivex\/qtplugin.cab" width="' + eQTM_Width + '" height="' + eQTM_Height + '">';
		eQTM_ObjectTagHTML += '<param name="type" value="video\/quicktime" \/>';
		eQTM_ObjectTagHTML += '<param name="src" value="' + eQTM_Filename + '" \/>';

		eQTM_EmbedTagHTML += '<embed ' + eQTM_IdAttribute02HTML + 'pluginspage="http:\/\/www.apple.com\/quicktime\/download\/" type="video\/quicktime" src="' + eQTM_Filename + '" width="' + eQTM_Width + '" height="' + eQTM_Height + '"';

		if (eQTM_OptionalParameters) {
			for (loop00 = 0; loop00 < eQTM_Temp01.length; loop00++) {
				eQTM_Temp02 = eQTM_Temp01[loop00].split('=');

				if (eQTM_Temp02[0] != 'id') {
					eQTM_ObjectTagHTML += '<param name="' + eQTM_Temp02[0] + '" value="' + eQTM_Temp02[1] + '" />';

					eQTM_EmbedTagHTML += ' ' + eQTM_Temp02[0] + '="' + eQTM_Temp02[1] + '"';
				};
			};
		};

		eQTM_EmbedTagHTML += '><\/embed>';
		eQTM_ObjectTagHTML += eQTM_EmbedTagHTML + '<\/object>';

		if (QuickTimePlayerInstalled && (QuickTimePlayerVersion >= eQTM_PlayerVersion)) {
			e_QC.innerHTML = eQTM_ObjectTagHTML;
		};
	} else {
		// alert('The necessary container element does NOT exist...');
	};
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Top 5 swapper */

function swapTopFive(sectionToSwapIn) {
	var e_STSI; // sectionToSwapIn
	var e_STSO; // sectionToSwapOut

	if (sectionToSwapIn) {
		e_STSI = document.getElementById(sectionToSwapIn);

		if (sectionToSwapIn == 'topFiveFundRaisersSwap') {
			e_STSO = document.getElementById('topFiveRivalsSwap');
		} else if (sectionToSwapIn == 'topFiveRivalsSwap') {
			e_STSO = document.getElementById('topFiveFundRaisersSwap');
		};

		e_STSO.style.display = 'none';
		e_STSI.style.display = 'block';
	};
};

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Writing CSS into the page */

var iSSHTML = '';

if (document.write) {
	iSSHTML += ' .hidden { display: none; }';

	if (is_ie) {
		iSSHTML += ' h1 sup { position: relative; top: -5px; left: -2px; }';

		// iSSHTML += ' div#gameCover { margin-bottom: -15px; }';

		iSSHTML += ' div#leftColumnMain ol li, div#rightColumnMain ol li { margin: 0px 0px 7px 0px; }';

		// iSSHTML += ' div#callToAction { margin-bottom: -15px; }';

		iSSHTML += ' div#rightHandBox { margin-bottom: 12px; }';

		iSSHTML += ' .topFiveItem { overflow: hidden; }';
		// iSSHTML += ' #topFiveBadge { position: relative; top: 0px; left: 0px; margin-top: -10px; border: 1px dashed orange; }';

		iSSHTML += ' #topFiveFundraisersItem1 table { margin-top: -48px; }'; // #topFiveRivalsItem1 table { position: absolute; padding-top: 0px; padding-top: -44px; border: 1px dashed lime; }

		iSSHTML += ' .searchResultsContainer { scrollbar-face-color:#1172c6; scrollbar-darkshadow-color:#1172c6; scrollbar-shadow-color:#1172c6; scrollbar-highlight-color:#1172c6; scrollbar-3dlight-color:#1172c6; scrollbar-track-color:#ffffff; scrollbar-arrow-color:#ffffff; }';

		iSSHTML += ' div#copyright { margin-top: -20px; } div#copyright img { margin-top: 0px; }';

		if (!is_ie7up) {
			iSSHTML += ' div#mainContainer { height: auto; overflow: auto; }'; // height: 446px;

			iSSHTML += ' div#gameCover { margin-left: 10px; }';

			iSSHTML += ' div#callToAction { padding: 2px 0px 8px 0px; }';

			iSSHTML += ' div#rightHandBox { margin: 0px 0px 12px 26px; }';

			iSSHTML += ' div#skipButton { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/skip_button_off.png, sizingMethod=crop); } a:hover div#skipButton { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/skip_button_on.png, sizingMethod=crop); }';

			iSSHTML += ' div#fundRaisedToDateContainer { margin-right: -5px; background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/homepage\/funds_raised_to_date_title.png, sizingMethod=crop); }';

			iSSHTML += ' div#gameButton { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/get_in_the_game_button_off.png, sizingMethod=crop); } a:hover div#gameButton { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/get_in_the_game_button_on.png, sizingMethod=crop); }';

			iSSHTML += ' div#topFundraisers { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/top_rivals_button_off.png, sizingMethod=crop); margin-left: 5px; } a:hover div#topFundraisers { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/top_rivals_button_on.png, sizingMethod=crop); }';

			iSSHTML += ' div#topRivals { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/top_fund_raisers_button_off.png, sizingMethod=crop); margin-left: 5px; } a:hover div#topRivals { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/top_fund_raisers_button_on.png, sizingMethod=crop); }';

			iSSHTML += ' div#playGame { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/play_now_button_off.png, sizingMethod=crop); } a:hover div#playGame { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/play_now_button_on.png, sizingMethod=crop); }';

			iSSHTML += ' div#joinButton { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/join_button_off.png, sizingMethod=crop); } a:hover div#joinButton { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/join_button_on.png, sizingMethod=crop); }';

			iSSHTML += ' div#createButton { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/create_button_off.png, sizingMethod=crop); } a:hover div#createButton { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/create_button_on.png, sizingMethod=crop); }';

			iSSHTML += ' #topFiveRivalsItem1 table { margin-top: 0px; }';

			iSSHTML += ' div#badge { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\/media\/image\/content\/icon_badge.png, sizingMethod=crop); }';
		};
	} else {
		iSSHTML += '';
	};

	if (is_mac) {
		iSSHTML += ' h1 sup { font-size: 22px; }';
	};

	if (is_safari) {
		iSSHTML += '';
	};

	iSSHTML = '<style type="text\/css" media="screen"><!-' + '-\n' + iSSHTML + '\n-' + '-><\/style>';
	document.write(iSSHTML);
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Restyle transparent PNG images for IE6 */

var blank_transparent_image = new Image();
	blank_transparent_image.src = '\/media\/image\/blank_transparent.gif';

function CSI_rTPNGI(imgId) {
	if (is_ie && (!is_ie7up)) {
		// If a particular image has been specified
		if (imgId) {
			document.getElementById(imgId).style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=' + "'true'" + ', src=' + "'" + document.getElementById(imgId).src + "'" + ')';
			document.getElementById(imgId).src = blank_transparent_image.src;

		// Otherwise run through all of the images in the document
		} else {
			for (loop01 = 0; loop01 < tImgArray.length; loop01++) {
				if (tImgArray[loop01].className.indexOf('transparentPNG') != -1) {
					imgWidth = tImgArray[loop01].width;
					imgHeight = tImgArray[loop01].height;
					imgSrc = tImgArray[loop01].src;

					tImgArray[loop01].width = imgWidth;
					tImgArray[loop01].height = imgHeight;
					tImgArray[loop01].style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=' + "'true'" + ', src=' + "'" + imgSrc + "'" + ')';
					tImgArray[loop01].src = blank_transparent_image.src;
				};
			};
		};
	};
};


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Page initialization and finalization */

function restyleLinks() {
	for (loop00 = 0; loop00 < tAArray.length; loop00++) {
		var e_CL = tAArray[loop00];

		if (e_CL.className.indexOf('external') != -1) {
			e_CL.setAttribute('target', '_blank');

			if (!e_CL.getAttribute('title')) {
				e_CL.setAttribute('title', ' Link opens in a new window/tab ');
			};
		};

		if (e_CL.id == 'siteCreditsLink') {
			e_CL.onclick = function() { 
				siteCreditsWindow = window.open(e_CL.href, e_CL.target, 'top=' + parseInt((scr_H - 300) / 2) + ',left=' + parseInt((scr_W - 600) / 2) + ',width=600,height=300,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); 
			};
		};
	};
};

function switchBanner() {
	var randomnumber = Math.floor(Math.random()*8);
	randomnumber += 1;

	var e_screenshot = document.getElementById('screenshot');

	if (e_screenshot) {
		e_screenshot_image = e_screenshot.getElementsByTagName('img').item(0);
		
		if(e_screenshot_image){
			if (e_screenshot_image.filters) {
				e_screenshot_image.style.background = '#115da6';
				e_screenshot_image.style.filter = 'blendTrans(duration=1)';
				e_screenshot_image.filters.blendTrans(duration=1.0).Apply();
				e_screenshot_image.filters.blendTrans.Play();
			};
	
			e_screenshot_image.id = 'screenshotImage';
			e_screenshot_image.src = '\/media\/image\/content\/homepage\/main_0' + randomnumber + '.png';
		}
		// CSI_rTPNGI('screenshotImage');
	};
};

function highlightsSwitcher(videoToUse) {
	switch(videoToUse) {
		case "1": embedFlashMovie('media\/flash\/intro_01.swf', 'video', 8, 316, 214, 'bgcolor=#000000,menu=false,quality=best,wmode=transparent'); break;

		case "2": document.location.href = '\/index.php'; break;

		case "3": embedFlashMovie('media\/flash\/one_word_01.swf', 'video', 8, 316, 214, 'bgcolor=#000000,menu=false,quality=best,wmode=transparent'); break;

		default: break;
	};
};

function restyleContent() {
	if (is_ie && !is_ie7up) {
		var e_MC = document.getElementById('mainContainer');

		if (e_MC.offsetHeight < 446) {
			e_MC.style.height = '446px';
		};
	};
};

function pI() { // pageInitialization
	restyleLinks();
	switchBanner();
	restyleContent();
};

function aPI() { // additionalPageInitialization

};

function iPL() { // imagePreLoading
	for (loop00 = 0; loop00 < iPLArray.length; loop00++) {
		iPLImagesArray[loop00] = new Image;
		iPLImagesArray[loop00].src = iPLArray[loop00];
	};
};

onload = function() {
	dEV(); 	// determineEnvironmentVariables
	gCOT(); // getCollectionsOfTags
	pI(); 	// pageInitialization
	aPI(); 	// additionalPageInitialization
	CSI_rTPNGI(); // restyleTransparentPNGImages
	iPL();	// imagePreLoading
};


