// 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>";

//

var FlashControlInstalled;

// is the Flash ActiveX control installed?

var FlashControlVersion;

// ActiveX control version if installed

//

function FlashInfo() {

	if( navigator.userAgent.indexOf( "AppleWebKit/312" ) > 0 || navigator.userAgent.indexOf( "AppleWebKit/412" ) > 0) {
		// alert( "detected bad apple" );
		// Safari of these versions has bugs and needs to be special-cased.
		this.installed = true;
		this.version = "6.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("6.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>" +

	"</head>" +


	"<body bgcolor=\"#4AB217\" 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=\"100%\" height=\"100%\" name=\"homePage\" id=\"homePage\">" +

	"<param name=movie value=\"/homePage/homePage.swf?track=NONE&col1=4AB217&col2=4AB217&col3=4AB217\"><param name=quality value=high> <param name=bgcolor value=\"#4AB217\">" +

	"<EMBED src=\"/homePage/homePage.swf?track=NONE&col1=4AB217&col2=4AB217&col3=4AB217\" quality=high bgcolor=\"#4ab217\"  width=\"100%\" height=\"100%\" 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>" +

	"<br><br><br><br><center>" +

	"<a href=\"/framesets/copyright\"><font size=\"-1\" color=\"#ffffff\" face=\"Arial,Helvetica,Verdana\">© 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></head><body bgcolor="#4AB217" 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="100%" height="100%" name="homePage" id="homePage"><param name=movie value="homePage.swf?track=NONE&col1=4AB217&col2=4AB217&col3=4AB217"><param name=quality value=high> <param name=bgcolor value="#4AB217"><EMBED src="homePage.swf?track=NONE&col1=4AB217&col2=4AB217&col3=4AB217" quality=high bgcolor="#4ab217"  width="100%" height="100%" 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><br><br><br><br><center><a href="/framesets/copyright"><font size="-1" color="#ffffff" face="Arial,Helvetica,Verdana">© TV Ontario</font></a></center>' + sniffer + '</body></html>');
	document.close();
}

//

function outputSnifferPage() {

	document.open();

	document.write("sniffer");

	document.close();

}


