﻿function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function printCheck() {
	if(window.print) {
	  window.print();
	}
	else {
	  alert("This print option does not work with your browser. Please choose \"Print\" from the \"File\" menu to print this document.");
	}
}
/* Disclaimer Code */
var emailDisclaimer = "You have requested to send general comments, questions or suggestions via this unsecured email.  However, we cannot address account-related or personal information through an unsecured email.\n\r\rFor your protection, please do not send any personal information (i.e. Social Security Number, account number, date of birth, etc.).  If you have an issue regarding your account, please contact a representative who will gladly assist you with your question.  Simply call (865) 977-5900, use the Secure Contact Us Form below or stop by one of our locations.";

var linkDisclaimer = "You are leaving the CBBC website. The site you have chosen is independent from CBBC. We do not control this site and do not guarantee the accuracy, completeness, efficiency or timeliness of the information contained therein. Be aware that the Privacy Policy of the linked web site is not that of CBBC.";

function mailConfirm(passedAddress) {
	if (confirm(emailDisclaimer)) {
		window.location.href = passedAddress;
	}
}

function flashPop(passedWebsite) {
	if (confirm(linkDisclaimer)) {
		if (window != top) top.location.href = passedWebsite;
	}
}

function disclaimer(passedWebsite) {
	var oWin;
	if (confirm(linkDisclaimer)) {
		oWin = window.open(passedWebsite,"newWindow");
		if (oWin === null || typeof(oWin) === "undefined") {
			window.location.href = passedWebsite;
		} else {
			return true;
		}
	}
}

/* Menu Code */
function hideMenuObjects() {
	if (!document.getElementById || !document.getElementsByTagName) { return false; }
	var menuObj, menus, n;
	if(parent.mainFrame) {
		menuObj = parent.mainFrame.document.getElementById("navLayers");
	} else {
		menuObj = document.getElementById("navLayers");
	}
	menus = menuObj.getElementsByTagName("div");
	for (n = 0; n < menus.length; n++) {
		menus[n].style.visibility = "hidden";
	}
}

function showMenuObject(id) {
	if (!document.getElementById) { return false; }
	hideMenuObjects();
	if(parent.mainFrame) {
		parent.mainFrame.document.getElementById(id).style.visibility = "visible";
	} else {
		document.getElementById(id).style.visibility = "visible";
	}
}

var timeOut = null;

function navIn() {
	if(parent.mainFrame) {
		if (parent.mainFrame.timeOut != null) {
			parent.mainFrame.clearTimeout(parent.mainFrame.timeOut);
		}
	} else {
		if (timeOut != null) {
			window.clearTimeout(timeOut);
		}
	}
}

function navTimer() {
	if(parent.mainFrame) {
		if (parent.mainFrame.timeOut != null) {
			parent.mainFrame.clearTimeout(parent.mainFrame.timeOut);
		}
		parent.mainFrame.timeOut = parent.mainFrame.setTimeout('hideMenuObjects()',1000);
	} else {
		if (timeOut != null) {
			window.clearTimeout(timeOut);
		}
		timeOut = window.setTimeout('hideMenuObjects()',1000);
	}
}

function positionit(menuArray) {
	var menuCounter, menuTop, verticalOffset, temp, newTop, thisMenu;
	for (i = 0; i < menuArray.length; i++) {
		menuCounter = menuArray[i][0];
		menuTop = menuArray[i][1];
		//menuTop = getStyle(document.getElementById(menuCounter), "top");
		if (document.documentElement.scrollTop) {
			verticalOffset = document.documentElement.scrollTop;
		}
		else {
			verticalOffset = document.body.scrollTop;
		}
		var temp = verticalOffset + parseInt(menuTop,10);
		var newTop = temp.toString() + "px";
		var thisMenu = document.getElementById(menuCounter);
		thisMenu.style.top = newTop;
	}
}

function getStyle(oElm, strCssRule){	
	/* Example: getStyle(document.getElementById("container"), "font-size");
	First parameter is an object reference to the element you want to check.
	Second paramter is the CSS name of the property whose value you want. */
	var strValue = "";
	if(document.defaultView && document.defaultView.getComputedStyle){
		strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
	}
	else if(oElm.currentStyle){
		strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
			return p1.toUpperCase();
		});
		strValue = oElm.currentStyle[strCssRule];
	}
	return strValue;
}