  homeOn = new Image();
homeOn.src ="http://img.timeinc.net/TFK/class/images/global/navbars/homeOn.gif";
currentIssuesOn = new Image();
currentIssuesOn.src ="http://img.timeinc.net/TFK/class/images/global/navbars/currentIssuesOn.gif";
pastIssuesOn = new Image();
pastIssuesOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/pastIssuesOn.gif";
reproduciblesOn = new Image();
reproduciblesOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/reproduciblesOn.gif";
partnerProgramsOn = new Image();
partnerProgramsOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/partnerProgramsOn.gif";
aboutUsOn = new Image();
aboutUsOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/aboutUsOn.gif";

homeOff = new Image();
homeOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/homeOff.gif";
currentIssuesOff = new Image();
currentIssuesOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/currentIssuesOff.gif";
pastIssuesOff = new Image();
pastIssuesOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/pastIssuesOff.gif";
reproduciblesOff = new Image();
reproduciblesOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/reproduciblesOff.gif";
partnerProgramsOff = new Image();
partnerProgramsOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/partnerProgramsOff.gif";
aboutUsOff = new Image();
aboutUsOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/aboutUsOff.gif";

homeGrades47On = new Image();
homeGrades47On.src = "http://img.timeinc.net/TFK/class/images/global/navbars/grades47WorldReportOn.gif";
homeGrades23On = new Image();
homeGrades23On.src = "http://img.timeinc.net/TFK/class/images/global/navbars/grades23NewsScoopOn.gif";
homeGradesK1On = new Image();
homeGradesK1On.src = "http://img.timeinc.net/TFK/class/images/global/navbars/gradesK1BigPictureOn.gif";
homeGoPlacesOn = new Image();
homeGoPlacesOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/goPlacesWithTFKOn.gif";
pastGrades47On = new Image();
pastGrades47On.src = "http://img.timeinc.net/TFK/class/images/global/navbars/grades47WorldReportOn.gif";
pastGrades23On = new Image();
pastGrades23On.src = "http://img.timeinc.net/TFK/class/images/global/navbars/grades23NewsScoopOn.gif";
pastGradesK1On = new Image();
pastGradesK1On.src = "http://img.timeinc.net/TFK/class/images/global/navbars/gradesK1BigPictureOn.gif";
partner20052006On = new Image();
partner20052006On.src = "http://img.timeinc.net/TFK/class/images/global/navbars/20052006ProgramsOn.gif";
pastProgramsOn = new Image();
pastProgramsOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/pastProgramsOn.gif";
aboutSubscribeOn = new Image();
aboutSubscribeOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/subscribeOn.gif";
aboutNewsletterOn = new Image();
aboutNewsletterOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/newsletterSignUpOn.gif";
aboutParentsOn = new Image();
aboutParentsOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/parentsOn.gif";
aboutTFKPartnersOn = new Image();
aboutTFKPartnersOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/tfksPartnersOn.gif";
aboutResearchOn = new Image();
aboutResearchOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/researchOn.gif";
aboutMediaOn = new Image();
aboutMediaOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/mediaKitOn.gif";
aboutContactOn = new Image();
aboutContactOn.src = "http://img.timeinc.net/TFK/class/images/global/navbars/contactUsOn.gif";

homeGrades47Off = new Image();
homeGrades47Off.src = "http://img.timeinc.net/TFK/class/images/global/navbars/grades47WorldReportOff.gif";
homeGrades23Off = new Image();
homeGrades23Off.src = "http://img.timeinc.net/TFK/class/images/global/navbars/grades23NewsScoopOff.gif";
homeGradesK1Off = new Image();
homeGradesK1Off.src = "http://img.timeinc.net/TFK/class/images/global/navbars/gradesK1BigPictureOff.gif";
homeGoPlacesOff = new Image();
homeGoPlacesOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/goPlacesWithTFKOff.gif";
pastGrades47Off = new Image();
pastGrades47Off.src = "http://img.timeinc.net/TFK/class/images/global/navbars/grades47WorldReportOff.gif";
pastGrades23Off = new Image();
pastGrades23Off.src = "http://img.timeinc.net/TFK/class/images/global/navbars/grades23NewsScoopOff.gif";
pastGradesK1Off = new Image();
pastGradesK1Off.src = "http://img.timeinc.net/TFK/class/images/global/navbars/gradesK1BigPictureOff.gif";
partner20052006Off = new Image();
partner20052006Off.src = "http://img.timeinc.net/TFK/class/images/global/navbars/20052006ProgramsOff.gif";
pastProgramsOff = new Image();
pastProgramsOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/pastProgramsOff.gif";
aboutSubscribeOff = new Image();
aboutSubscribeOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/subscribeOff.gif";
aboutNewsletterOff = new Image();
aboutNewsletterOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/newsletterSignUpOff.gif";
aboutParentsOff = new Image();
aboutParentsOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/parentsOff.gif";
aboutTFKPartnersOff = new Image();
aboutTFKPartnersOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/tfksPartnersOff.gif";
aboutResearchOff = new Image();
aboutResearchOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/researchOff.gif";
aboutMediaOff = new Image();
aboutMediaOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/mediaKitOff.gif";
aboutContactOff = new Image();
aboutContactOff.src = "http://img.timeinc.net/TFK/class/images/global/navbars/contactUsOff.gif";



function fixOnStates(node) {
	if (node.nodeName == "LI" && node.id == onSection) {
		node.childNodes[0].childNodes[0].src = eval(onSection + "On.src");
	}
	for (j=0;j<node.childNodes.length;j++) {
		if (node.childNodes[j].nodeName == "UL") {
			var subULNode = node.childNodes[j];
			for (k=0;k<subULNode.childNodes.length;k++) {
				if (subULNode.childNodes[k].nodeName == "LI" && subULNode.childNodes[k].id == onSubSection) {
					subULNode.childNodes[k].childNodes[0].childNodes[0].src = eval(onSubSection + "On.src");
				}
			}
		}
	}
	eval(onSection + "Off.src = " + onSection + "On.src");
	if (onSubSection != "") {
		eval(onSubSection + "Off.src = " + onSubSection + "On.src");
	}
	var defaultOn = document.getElementById(onSection);
	defaultOn.className+=" hover";
	theon = defaultOn;
}
function clear(node){if(node.timeout!=null){clearTimeout(node.timeout);node.timeout=null;}}

function menuOn(e){
	clear(this);
	if(theon!=null&&theon!=this){
		turnOff(theon);
	}
	if(theon!=this){
		theon=this;
		this.className+=" hover";
		var theImage = this.childNodes[0].childNodes[0];
		var theId = this.id;
		theImage.src = eval(theId += "On.src");
	}
	var defaultOn = document.getElementById(onSection);
	if (this != defaultOn) {
		turnOff(defaultOn);
	}
}
function menuOff(e){
	eval("closeIt('"+this.id+"')");
}

function subMenuOn(e){
	var theImage = this.childNodes[0].childNodes[0];
	var theId = this.id;
	theImage.src = eval(theId += "On.src");
}
function subMenuOff(e){
	var theImage = this.childNodes[0].childNodes[0];
	var theId = this.id;
	theImage.src = eval(theId += "Off.src");
}

function closeIt(id){
	var node=document.getElementById(id);
	turnOff(node);
	clear(node);
	var theImage = node.childNodes[0].childNodes[0];
	var theId = node.id;
	theImage.src = eval(theId += "Off.src");
	if(node!=defaultOn){
		var defaultOn = document.getElementById(onSection);
		theon = defaultOn;
		defaultOn.className+=" hover";
	}
}
function turnOff(node){
	var hoverIndex=node.className.indexOf("hover");
	if(hoverIndex!=-1){
		node.className=node.className.substring(0,hoverIndex);
		if(theon==node) theon=null;
	}
}

function attachListHover(baseName) {
	var navRoot = document.getElementById(baseName).getElementsByTagName("UL")[0];
	if(navRoot!=null){
		for (i=0;i<navRoot.childNodes.length;i++) {
			var node = navRoot.childNodes[i];
			if (node.nodeName=="LI"){
				fixOnStates(node);
				attachHover(node);
				for (j=0;j<node.childNodes.length;j++) {
					var subnodeUL = node.childNodes[j];
					if (subnodeUL.nodeName=="UL"){
						for (k=0;k<subnodeUL.childNodes.length;k++) {
							if (subnodeUL.childNodes[k].nodeName=="LI"){
								attachSubHover(subnodeUL.childNodes[k]);
							}
						}
					}
				}
			}
		}
	}
}
function attachHover(node){
	if(node!=null){
		if(!node.id){
			node.id="AOLnode_"+Math.random();
			node.isNav=true;
		}
		node.onmouseover=menuOn;
		node.onmouseout=menuOff;
	}
}
function attachSubHover(subnode){
	if(subnode!=null){
		subnode.onmouseover=subMenuOn;
		subnode.onmouseout=subMenuOff;
	}
}
function initHeader(){
	attachListHover("tfkClassroomNav");
}



function popcustom(file,title,w,h,x,y) {
	popup = window.open(file,title,'width='+ w + ',height='+ h + ',screenX='+ x + ',screenY='+ y + ',scrollbars=0,resizable=1');
	if (document.images) {popup.focus();}
}
function popcustom2(file,title) {
	popup = window.open(file,title,'width=627,height=400,screenX=20,screenY=20,directories=1,location=1,resizable=1,scrollbars=1,status=1,toolbar=1');
	if (document.images) {popup.focus();}
}
function popcustom3(file,title,w,h,x,y) {
	popup = window.open(file,title,'width='+ w + ',height='+ h + ',screenX='+ x + ',screenY='+ y + ',directories=1,location=1,resizable=1,scrollbars=1,status=1,toolbar=1');
	if (document.images) {popup.focus();}
}


var showWarning = false;
var warningText = "";
var pageUrl = window.location;

var bUserAgent=navigator.userAgent.toLowerCase();
var bAppVersion = navigator.appVersion.toLowerCase();
var bAppVersionMinor = parseFloat(bAppVersion);
var bAppVersionMajor = parseInt(bAppVersionMinor);
var isMac = (bUserAgent.indexOf("mac")!=-1);
var isIE = bAppVersion.indexOf('msie');

if (!isMac) {
	if (isIE > -1) {
		if (bAppVersionMajor <= 4) {
			bAppVersionMinor = parseFloat(bAppVersion.substring(isIE+5,bAppVersion.indexOf(';',isIE)));
			bAppVersionMajor = parseInt(bAppVersionMinor);
		}
	}
}

function checkWarning() {
	if (bAppVersionMajor < 5) {
		showWarning = true;
		
		if (isMac) {
			warningMessage = "If you're using Macintosh OS 9, download the latest version of <a href='http://browser.netscape.com/' target='new'>Netscape Navigator</a>.<br />If you're using Macintosh OS X, download the latest version of <a href='http://browser.netscape.com/' target='new'>Netscape Navigator</a> or <a href='http://www.apple.com/downloads/macosx/apple/safari.html' target='new'>Safari</a>.<br />(<b>Note:</b> TFK recommends using these browsers because there isn't an upgraded version of Internet Explorer that supports Macintosh users.)";
		} else {
			warningMessage = "Download the latest version of <a href='http://www.microsoft.com/windows/ie/downloads/critical/ie6sp1/default.mspx' target='new'>Internet Explorer</a> or <a href='http://browser.netscape.com/' target='new'>Netscape Navigator</a>.";
		}

		if (warningCheckCookie() != null) {
			showWarning = warningCheckCookie();
		}
		if (showWarning == true) {
			warningText = '<table border="1" bordercolor="#000000" cellpadding="25" cellspacing="0" width="750px" bgcolor="#FFFFFF">'
			+ '<tr>'
			+ '<td style="font:12px/14px Arial;"><p><b>Your Web browser does not meet the necessary requirements to access our content.</b></p>'
			+ '<p>' + warningMessage + '</p>'
			+ '<p>You may also proceed without upgrading, however some content may not be accessible or display properly. <a href="javascript:warningSetCookie();">Continue without upgrading.</a></p></td>'
			+ '</tr>'
			+ '</table>';
		}
	}
	if (showWarning != "") {
		document.write(warningText);
	}
}

function warningCheckCookie() {
	var cookies=document.cookie;
	var prefix="showWarning=";
	var start=cookies.indexOf(prefix);
	if (start==-1) return null;
	var end=cookies.indexOf(";",start);
	if(end==-1) end=cookies.length;
	return unescape(cookies.substring(start+prefix.length,end));
}

function warningSetCookie() {
	var warningCookie = "showWarning=false"
	document.cookie = warningCookie;
	window.location = pageUrl;
}

function htmlWriter(htmlTag) {
	document.write(htmlTag);
}

function writeAOLSlider() {
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="705" HEIGHT="75" id="kol_2d_nav" ALIGN=""><PARAM NAME=movie VALUE="http://img.timeinc.net/TFK/media/home_705/kol_2d_nav.swf"><param name="wmode" value="transparent"><PARAM NAME=quality VALUE=high><EMBED src="http://img.timeinc.net/TFK/media/home_705/kol_2d_nav.swf" quality=high wmode="transparent"  WIDTH="705" HEIGHT="75" NAME="kol_2d_nav" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');
}
FlashObject = function(swf, id, w, h, ver, c) {
	this.swf = swf;
	this.id = id;
	this.width = w;
	this.height = h;
	this.version = ver || 6; // default to 6
	this.align = "middle"; // default to middle
	this.redirect = "";
	this.sq = document.location.search.split("?")[1] || "";
	this.altTxt = "Please <a href='http://www.macromedia.com/go/getflashplayer'>upgrade your Flash Player</a>.";
	this.bypassTxt = "";
	this.params = new Object();
	this.variables = new Object();
	if (c) this.color = this.addParam('bgcolor', c);
	this.addParam('quality', 'high'); // default to high
	this.doDetect = tiiGetQueryParamValue('tiiDetectFlash');
}

FlashObject.prototype.addParam = function(name, value) {
	this.params[name] = value;
}

FlashObject.prototype.getParams = function() {
	return this.params;
}

FlashObject.prototype.getParam = function(name) {
	return this.params[name];
}

FlashObject.prototype.addVariable = function(name, value) {
	this.variables[name] = value;
}

FlashObject.prototype.getVariable = function(name) {
	return this.variables[name];
}

FlashObject.prototype.getVariables = function() {
	return this.variables;
}

FlashObject.prototype.getParamTags = function() {
	var paramTags = "";
	for (var param in this.getParams()) {
		paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';
	}
	if (paramTags == "") {
		paramTags = null;
	}
	return paramTags;
}

FlashObject.prototype.getHTML = function() {
	var flashHTML = "";
	if (window.ActiveXObject && navigator.userAgent.indexOf('Mac') == -1) { // PC IE
		flashHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '">';
		flashHTML += '<param name="movie" value="' + this.swf + '" />';
		if (this.getParamTags() != null) {
			flashHTML += this.getParamTags();
		}
		if (this.getVariablePairs() != null) {
			flashHTML += '<param name="flashVars" value="' + this.getVariablePairs() + '" />';
		}
		flashHTML += '</object>';
	}
	else { // Everyone else
		flashHTML += '<embed type="application/x-shockwave-flash" src="' + this.swf + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '"';
		for (var param in this.getParams()) {
			flashHTML += ' ' + param + '="' + this.getParam(param) + '"';
		}
		if (this.getVariablePairs() != null) {
			flashHTML += ' flashVars="' + this.getVariablePairs() + '"';
		}
		flashHTML += '></embed>';
	}
	return flashHTML;
}


FlashObject.prototype.getVariablePairs = function() {
	var variablePairs = new Array();
	for (var name in this.getVariables()) {
		variablePairs.push(name + "=" + escape(this.getVariable(name)));
	}
	if (variablePairs.length > 0) {
		return variablePairs.join("&");
	}
	else {
		return null;
	}
}

FlashObject.prototype.write = function(elementId) {
	if(tiiDetectFlash(this.version) || this.doDetect=='false') {
		if (elementId) {
			document.getElementById(elementId).innerHTML = this.getHTML();
		} else {
			document.write(this.getHTML());
		}
	} else {
		if (this.redirect != "") {
			document.location.replace(this.redirect);
		} else {
			if (elementId) {
				document.getElementById(elementId).innerHTML = this.altTxt +""+ this.bypassTxt;
			} else {
				document.write(this.altTxt +""+ this.bypassTxt);
			}
		}
	}
}

function tiiGetFlashVersion() {
	var flashversion = 0;
	if (navigator.plugins && navigator.plugins.length) {
		var x = navigator.plugins["Shockwave Flash"];
		if(x){
			if (x.description) {
				var y = x.description;
				flashversion = y.charAt(y.indexOf('.')-1);
			}
		}
	} else {
		result = false;
		for(var i = 15; i >= 3 && result != true; i--){
			execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
			flashversion = i;
		}
	}
	return flashversion;
}

function tiiDetectFlash(ver) {
	if (tiiGetFlashVersion() >= ver) {
		return true;
	} else {
		return false;
	}
}

/* add Array.push if needed */
if(Array.prototype.push == null){
	Array.prototype.push = function(item){
		this[this.length] = item;
		return this.length;
	}
}
var adConfig = new TiiAdConfig("3475.tfk");
adConfig.setCmSitename("cm.tfk");
 