	// parses any query string passed into an array of name value pairs
	var qString = location.search.substr(1);
	var nvPairs = new Array();
	nvPairs = qString.split('&');
	var passedVal = null;
	var passedCreator = false;
	if (nvPairs.length > -1)
	{
		for (i = 0; i < nvPairs.length; i++) {
			tempArr = nvPairs[i].split('=');
			if (tempArr[0] == "episodeID") {
				passedVal = tempArr[1];
			}
			if (tempArr[0] == "chapter") {
				passedCreator = tempArr[1];
			}
		}
	}
	
	function getPageFromSwf(reqPage) {
		if (reqPage == "starwars") {
			location.href='http://www.cartoonnetwork.com/redirects/starwars/buffer_external.html?http://www.starwars.com';
		} else if (reqPage == "cn") {
			location.href='http://www.cartoonnetwork.com';
		} else if (reqPage == "game") {
				window.open('http://theclonewars.cartoonnetwork.com/games/game_02.html');
			dimAd();
		} else if (reqPage == "message") {
			window.open('http://theclonewars.cartoonnetwork.com/comments/index.html');
			dimAd();
		}
	}

	
	// determines if the browser is IE or other
	function isIE () {
		var hasMS = navigator.appName.indexOf("Microsoft") != -1;
		return hasMS;
	}
	
	// determines the DOM name of the swf object
	function thisMovie(movieName) {
		if (isIE ()) {
			return window[movieName];
		} else {
			return document[movieName];
		}
	}

//page level geo filtering	
function geoTest2() 
{
	if (document.cookie.indexOf('adDEmas') != -1) 
	{
		readingCookie = cnnad_readCookie('adDEmas');
		splitCookie = readingCookie.split('&');
		var geoLocation = splitCookie[4];

			if ((geoLocation == "usa")||(geoLocation == "none")||(geoLocation == "***"))
			{
				//alert(geoLocation);
				return false;
			} else {
				top.location.href="http://www.cartoonnetwork.com/help/international.html";
			}
		}

}


