// JavaScript Document
//
var sniffer = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0\" width=\"1\" height=\"1\">" + 
	"<param name=movie value=\"\/homePage\/flashSniffer.swf\">" +
	"<EMBED src=\"\/homePage\/flashSniffer.swf\" width=\"1\" height=\"1\" type=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">" + 
	"</EMBED></object>";
//


// Color variables for HomePage Colors
var BodyColour="FFFFFF";

var FlashControlInstalled;
// is the Flash ActiveX control installed?
var FlashControlVersion;
// ActiveX control version if installed
//


function FlashInfo() {
	if( navigator.userAgent.indexOf( "AppleWebKit" ) > 0 ) {
		// alert( "detected bad apple" );
		// Safari of these versions has bugs and needs to be special-cased.
		this.installed = true;
		this.version = "8.0";
		this.canPlay = true;
		this.badApple = true;
	}
	else if (navigator.plugins && navigator.plugins.length > 0) {
		// Check whether the plug-in is installed:
		if (navigator.plugins["Shockwave Flash"]) {
			this.installed = true;
			// Get the plug-in version and revision:
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
			for (var i = 0; i < words.length; ++i) {
				if (!isNaN(parseInt(words[i]))) this.version = words[i];
			}
		} else {
			this.installed = false;
		}
	} else if (FlashControlInstalled != null) {
		this.installed = FlashControlInstalled;
		this.version = FlashControlVersion;
	} else if (FlashDetectedSelf()) {
		this.installed = true;
	}
	this.canPlay = FlashCanPlay;
}

//
function FlashDispatch() {
	if (parent.frames.length > 0) {
		parent.location.href = self.document.location;
		return false;
	}
	//
	var player = new FlashInfo();
	if (player.installed == null) {
		// alert("You may need flash!");
		// not sure what would cause this
		outputMainPage();
	} else if ( player.badApple == true ) {
		outputMainPageBadApple();	
	} else if ( player.installed ) {
		//
		// CHANGE THIS LINE WHEN WE UPGRADING TO A NEW FLASH PLAYER
		//
		if (player.canPlay("8.0")) {
			outputMainPage();
		} else {
			// if you have an old version of flash
			outputNeedFlashPage();
		}
	} else {
		// if you don't have flash at all
		outputNeedFlashPage();
	}
	//alert( "version: "+player.version+"  canPlay: "+player.canPlay('6.0')+"  installed: "+player.installed );
}

//
function FlashCanPlay(contentVersion) {
	if (this.version) {
		//alert(parseInt(contentVersion) + "<=" + this.version);
		return (parseInt(contentVersion) <= this.version);
	} else {
		return false;
	}
}


function outputMainPage() {
	document.open();
	document.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">" +
	"<html>" +
	"<head><title>TVOKids.com</title>" +
	"<meta name=\"broadcaster\" content=\"TVOntario. Where education matters, on air and online.\">" +
	"<meta name=\"description\" content=\"TVOkids.com is Ontario s most popular site among kids ages three through eight years old, providing fun and engaging activities that link directly to the Ontario Ministry of Education curriculum.  Educational pop-ups written by teachers give adults information on how to maximize their child s learning both online and at home.\">" +
	"<meta name=\"keywords\" content=\"Children s activities, Interactive games,Online games, Kids games, TVO, TVOntario, TVOKids, TVOkids.com, Tumbleweed, Hatatoposit, Polkaroo, Marigold, Nicole, Milton, Julie, Gisele, Phil, Learning, Education, Educational, Teaching, Teacher Guides, Grown-ups, Kids, Children, Parents, Fun, Play, Information station, Games, Contests, Ontario, Canada, Reading Rangers, Bod Squad, Don t Sit Still, The Nook, The Crawlspace, Pre-school, Preschool, Television, Safe, Curriculum, TV Shows\">" +
	"<script type=\"text/javascript\" src=\"/javaScript/popUp.js\"></script>" +
	"<script type=\"text/javascript\" src=\"/javaScript/newWindow.js\"></script>" +
	"<script type=\"text/javascript\" src=\"/javaScript/colorChanger.js\"></script>" +
	"</head>" +
	"<body bgcolor=\"#"+BodyColour+"\" TOPMARGIN=\"0\" LEFTMARGIN=\"0\" marginwidth=\"0\" marginheight=\"0\" link=\"#ffffff\" vlink=\"#ffffff\" alink=\"#FFFFFF\" text=\"#FFFFFF\" onLoad=\"homePage.focus();\">" +
	"<center>" + 
	"<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"100%\" height=\"97%\" name=\"homePage\" id=\"homePage\">" +
	"<param name=movie value=\"/homePage/homePage.swf\"><param name=quality value=high> <param name=bgcolor value=\""+BodyColour+"\">" +
	"<EMBED src=\"/homePage/homePage.swf\" quality=high bgcolor=\""+ BodyColour +"\"  width=\"100%\" height=\"97%\" type=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" name=\"homePage\" id=\"homePage\">" +
	"</EMBED></object></center>" +
	"<font color=\"#FFFFFF\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\"><center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
	"<a href=\"javascript:popUp('http://www.tvo.org/cfmx/tvoorg/tvoparents/index.cfm?page_id=622','seeYouLaterPopup');\"><img src=\"/images/bottom_nav/tvoParentsLogo.png\" align=\"absbottom\" border=\"0\"/></a> | " +
	"<a href=\"/framesets/thespace.html?section=mail\" target=\"_top\"><font color=\"#FFFFFF\">Contact Us</font></a> |" + 
	"<a href=\"/framesets/siteMap.html\" target=\"_top\"><font color=\"#FFFFFF\">Sitemap</font></a> | " +
	"<a href=\"/framesets/misc.html?page=/legal/privacy.html\" target=\"_top\"><font color=\"#FFFFFF\">Privacy Policy</font></a> | " + 
	"<a href=\"/framesets/misc.html?page=/legal/terms.html\" target=\"_top\"><font color=\"#FFFFFF\">Terms of Use</font></a> | " + 
	"<a href=\"/framesets/misc.html?page=/faq/faq.html\" target=\"_top\"><font color=\"#FFFFFF\">FAQ's</font></a></center></font> " + 
	"</CENTER>" +
//	"<a href=\"/framesets/copyright\"><font size=\"-1\" color=\"#ffffff\" face=\"Arial,Helvetica,Verdana\">&copy; TV Ontario</font></a></center>" +
	sniffer +
	"</body>" +
	"</html>");
	document.close();


}

function outputMainPageBadApple() {
	document.open();
	document.write('<html><head><title>TVOKids.com</title><BASE href="/homePage/"><meta name="broadcaster" content="TVOntario. Where education matters, on air and online."><meta name="description" content="TVOkids.com is Ontario s most popular site among kids ages three through eight years old, providing fun and engaging activities that link directly to the Ontario Ministry of Education curriculum.  Educational pop-ups written by teachers give adults information on how to maximize their child s learning both online and at home."><meta name="keywords" content="Children s activities, Interactive games,Online games, Kids games, TVO, TVOntario, TVOKids, TVOkids.com, Tumbleweed, Hatatoposit, Polkaroo, Marigold, Nicole, Milton, Julie, Gisele, Phil, Learning, Education, Educational, Teaching, Teacher Guides, Grown-ups, Kids, Children, Parents, Fun, Play, Information station, Games, Contests, Ontario, Canada, Reading Rangers, Bod Squad, Don t Sit Still, The Nook, The Crawlspace, Pre-school, Preschool, Television, Safe, Curriculum, TV Shows"><script type="text/javascript" src="../javaScript/newWindow2.js"></script><script type="text/javascript" src="/javaScript/colorChanger.js"></script></head><body bgcolor="#'+BodyColour+'" TOPMARGIN="0" LEFTMARGIN="0" marginwidth="0" marginheight="0" link="#ffffff" vlink="#ffffff" alink="#FFFFFF" text="#FFFFFF" onLoad="homePage.focus();"><center><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="80%" height="80%" name="homePage" id="homePage"><param name=movie value="homePage.swf?track=NONE"><param name=quality value=high> <param name=bgcolor value="'+BodyColour+'"><EMBED src="homePage.swf?track=NONE" quality=high bgcolor="'+BodyColour+'"  width="80%" height="80%" type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" name="homePage" id="homePage"></EMBED></object></center><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" size="-1"><center><a href="javascript:popUp(\'http://www.tvo.org/cfmx/tvoorg/tvoparents/index.cfm?page_id=622\',\'seeYouLaterPopup\');"><img src="/images/bottom_nav/tvoParentsLogo.png" align="absbottom" border="0"/></a> | <a href="/framesets/thespace.html?section=mail" target="_top"><font color="#FFFFFF">Contact Us</font></a> | <a href="/framesets/siteMap.html" target="_top"><font color="#FFFFFF">Sitemap</font></a> | <a href="/framesets/misc.html?page=/legal/privacy.html" target="_top"><font color="#FFFFFF">Privacy Policy</font></a> | <a href="/framesets/misc.html?page=/legal/terms.html" target="_top"><font color="#FFFFFF">Terms of Use</font></a> | <a href="/framesets/misc.html?page=/faq/faq.html" target="_top"><font color="#FFFFFF">FAQ\'s</font></a></center>');//<br><br><br><br><center><a href="/framesets/copyright"><font size="-1" color="#ffffff" face="Arial,Helvetica,Verdana">&copy; TV Ontario</font></a></center>' + sniffer + '</body></html>');
	document.close();
}
 

//

function outputSnifferPage() {
	document.open();
	document.write("sniffer");
	document.close();
}


