window.onerror=function(){ return true; };

styles=[
[".even","padding:0; margin:3px 3px 3px 18px;"],
["#searchform","margin:0; padding:0;"],
["#searchform input","width:178px; font:11px arial; margin-top:18px; border:1px solid #999; color:#666; padding-left:3px;"],
["#searchform select","width:178px; font:11px arial; margin-top:12px; border:1px solid #999; color:#666;"],
["#youmayalsolikeTable td","vertical-align:top; text-align:center; font:10px verdana; padding:0 10px 0 10px; color:#666666;"],
["#FOOTERDIV a","margin:0 10px 0 10px;"],
["a","text-decoration:none; font:bold 10px verdana; color:#0090C7;"],
["td, div","font:10px/14px verdana; color:#666666;"],
["#MORELIST","padding:0; margin:3px 3px 3px 25px;"],
["#MORELIST a","color:white;"],
["#MORELIST li","list-style-image:url(/v/images/li-arrow.gif); margin:5px 0 5px 0;"]
];

document.writeln('<style>');  for (sty in styles){ document.writeln(styles[sty][0]+'{ '+styles[sty][1]+' }'); }  document.writeln('</style>');

var chromeWidth="994";

document.writeln('<scr'+'ipt language="javascript" src="//disney.go.com/detect/scripts/master_flash_full.js"><\/scr'+'ipt>');

try{ _gpn=/([\w-~]*)(\.htm|$|\?|\#|\.cgi\.asp)/i.exec(location.href)[1]; } catch(pn){ _gpn='home'; } if (_gpn==""){ _gpn="home"; }


function params(wut,qp,dflt){ dflt=(dflt==null)?'':dflt; try{r=unescape(wut.match(new RegExp(qp+"=+([^&;]*)"))[1]);}catch(qp){r=dflt;} return r; }
function addZero(vNumber){ return ((vNumber<10)?"0":"")+vNumber; }
function gid(_id){ return document.getElementById(_id); }
function inner(_gid,_text){ gid(_gid).innerHTML=_text; }
function show(){ for (i=0; i<show.arguments.length; i++){ gid(show.arguments[i]).style.display='block'; }}
function hide(){ for (i=0; i<hide.arguments.length; i++){ gid(hide.arguments[i]).style.display='none'; }}

function AddEvent(obj, evType, fn){ 
if (obj.addEventListener){ obj.addEventListener(evType, fn, false); return true; }
else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; }
else { return false; } 
}


function $flash(ef){ //new $flash({ movie:'', w:'100%', h:'173', bgcolor:'', base:'', vars:'', id:'' }).render();
ef.w=(ef.w==null)?'590':ef.w; ef.h=(ef.h==null)?'450':ef.h; ef.id=(ef.id==null)?'flashmovie':ef.id; ef.wmode=(ef.wmode==null)?'opaque':ef.wmode;
sendback={}
flashstr='<object id="'+ef.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ef.w+'" height="'+ef.h+'"><param name="movie" value="'+ef.movie+((ef.vars!=null)?'?'+ef.vars:'')+'"><param name="quality" value="high"><param name="menu" value="false"><param name="wmode" value="'+ef.wmode+'"><param name="scale" value="noscale"><param name="allowScriptAccess" value="always"><param name="show" value="#ffffff">';
if (ef.base!=null){flashstr+='<param name="base" value="'+ef.base+'">'; }
if (ef.salign!=null){flashstr+='<param name="salign" value="'+ef.salign+'">'; }
if (ef.bgcolor!=null){flashstr+='<param name="bgcolor" value="'+ef.bgcolor+'">'; }
if (ef.vars!=null){flashstr+='<param name="flashVars" value="'+ef.vars+'">'; }
flashstr+='<embed name="'+ef.id+'" id="'+ef.id+'" src="'+ef.movie+((ef.vars!=null)?'?'+ef.vars:'')+'" menu="false" quality="high" pluginspage="//www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ef.w+'" height="'+ef.h+'" swLiveConnect="true" wmode="'+ef.wmode+'" scale="noscale" allowScriptAccess="always"';
if (ef.base!=null){flashstr+=' base="'+ef.base+'"'; }
if (ef.salign!=null){flashstr+=' salign="'+ef.salign+'"'; }
if (ef.bgcolor!=null){flashstr+=' bgcolor="'+ef.bgcolor+'"'; }
if (ef.vars!=null){flashstr+=' FlashVars="'+ef.vars+'"'; }
flashstr+='></embed></object>';
sendback.toString=function(){ return flashstr; }
sendback.render=function(){ document.writeln(flashstr); }
sendback.inner=function(targetgid){ gid(targetgid).innerHTML=flashstr; }
return sendback;
}


function DoFlashDetection(){ CreateInterface(); DetectFlash(); }



function rollins(e){ /*---ROLLOVER FUNCTIONS---*/
if (window.event) { thislink = window.event.srcElement; } else if (e.target) { thislink = e.target; } else { return; }
for (j=0;j<myArraySet.length;j++){ if (myArraySet[j][0]==thislink.id+'_over'){document.getElementById(thislink.id).src=myArraySet[j][1].src; break;}}}
function unrollins(e){
if (window.event) { thislink = window.event.srcElement; } else if (e.target) { thislink = e.target; } else { return; }
for (k=0;k<myArraySet.length;k++){ if (myArraySet[k][0]==thislink.id){ document.getElementById(thislink.id).src=myArraySet[k][1].src; break;}}}
function rolloverInit(){
myArraySet=new Array(); myImages=new Array(); count=-1;
for (i=0;i<document.links.length;i++){
elk=document.links[i];
if (elk.id!=""){
bob=document.getElementById('i'+elk.id); if (bob!=null){ unName=bob.src; count++;
c3=bob.src.replace(/_off\./gi,'_ovr.').replace(/_on\./gi,'_ovr.').replace(/-off\./gi,'-on.').replace(/-1\./gi,'-2.');
thisImage=new Image(); thisImage.src=c3; myArraySet[count]=new Array(bob.id+'_over',thisImage);
elk.onmouseover=rollins; count++; thisImage=new Image(); thisImage.src=unName; myArraySet[count]=new Array(bob.id,thisImage);elk.onmouseout=unrollins;
bob.src=c3; bob.src=unName; //FLIP REAL QUICK TO PRELOAD
}}}}


/*---XML IMPORT/PARSING FUNCTIONS---*/
isSafari=(navigator.appVersion.match(/safari/gi)!=null);
function nval(_wut){ try{
returnValue=((isSafari)?((_wut.childNodes.length>0)?_wut.firstChild.nodeValue:_wut.nodeValue):((navigator.appName=="Netscape")?_wut.textContent:_wut.text)); return (returnValue!=null)?returnValue:''; }catch(nov){ return ''; }}
function gtn(_wut,_tag,index){ rt=_wut.getElementsByTagName(_tag);
return ((rt.length>1)?((index!=null)?nval(rt[index]):rt):((rt.length==0)?'':((index!=null)?rt:nval(rt[0])))); }
function gtn0(_wut,_tag){ tempgtn=gtn(_wut,_tag); if (typeof(tempgtn)=='string'){ tempgtn=gtn(_wut,_tag,0); }  return tempgtn; }
function importXML(xmlobj){
_xmlfile=xmlobj.url; _xmlRtn=xmlobj.obj; _act=xmlobj.action;

if (window.XMLHttpRequest && !(window.ActiveXObject)){
xmlDoc=new XMLHttpRequest(); xmlDoc.onreadystatechange=function(){ if (xmlDoc.readyState==4){ eval(_xmlRtn+"=xmlDoc.responseXML"); eval(_act); }}
xmlDoc.open("GET",_xmlfile,true); xmlDoc.send(null);
} else if (document.implementation && document.implementation.createDocument){
xmlDoc=document.implementation.createDocument("","",null); xmlDoc.onload=function(){ eval(_xmlRtn+"=xmlDoc"); eval(_act); }
xmlDoc.load(_xmlfile);
} else if (window.ActiveXObject){
xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.onreadystatechange=function(){ if (xmlDoc.readyState==4){ eval(_xmlRtn+"=xmlDoc"); eval(_act); }}
xmlDoc.load(_xmlfile);
} else  { return; }
//xmlDoc.load(_xmlfile);

}
function getAtt(_wut,_att){ return _wut.getAttribute(_att); }
function getIndexByAttribute(_wut,_att,_val){ ri=-1; if (_wut.length>0){ for (i=0; i<_wut.length; i++){ if (getAtt(_wut[i],_att)==_val){ ri=i; break; }}} return ri; }
/*---END XML IMPORT/PARSING FUNCTIONS---*/


function Joiterator(joey){
this.items=joey.items; this.count=joey.items.length; this.numshow=joey.numshow; this.currentItem=this.items[0]; this.currentPage=0;
if (this.numshow=="all"){ this.numshow=this.count; }
try{ this.pageCount=Math.floor(joey.items.length/joey.numshow)+1; }catch(j){ this.pageCount=1; }
var jtp=[]; var jtcp=-1;
for (jj=0; jj<this.count; jj++){
if (jj%this.numshow==0 || isNaN(jj%this.numshow)){ jtcp++; jtp[jtp.length]=[]; }
this.items[jj].index=jj; jtp[jtcp][jtp[jtcp].length]=this.items[jj];
}
this.pages=jtp; this.pageCount=this.pages.length;
this.isFirst=function(){ return (this.currentPage==0 || this.count==0); }
this.isLast=function(){ return (this.currentPage==this.pageCount-1 || this.count==0); }
this.next=function(){ if (!this.isLast()){ this.currentPage++; this.currentItem=this.pages[this.currentPage][0]; }}
this.back=function(){ if (!this.isFirst()){ this.currentPage--; this.currentItem=this.pages[this.currentPage][0]; }}
this.setPage=function(_pageToGet){ if (!isNaN(_pageToGet) && _pageToGet>=0 && _pageToGet<this.pageCount){ this.currentPage=_pageToGet; this.currentItem=this.pages[this.currentPage][0]; }}
return this;
}



/*---SORT ARRAY FUNCTIONS---*/
function sortByNumber(_ary,reverse){ if (reverse){ return _ary.sort(function(a,b){return(b-a)}); } else { return _ary.sort(function(a,b){return(a-b)}); }}
function randomSort(_ary){ return _ary.sort(function(){ return (Math.round(Math.random())-0.5) }) }


function randy(hi,lo){ lo=(lo==null)?1:lo;hi=(hi==null)?10:hi; do{ randall=Math.floor(Math.random()*(hi+1)); } while(!((randall>=lo)&&(randall<=hi))); return randall; }


var today=new Date();

if (location.href.indexOf('socialstudies')!=-1 || params(location.search,'Cat','0')=='22'){ categoryID="22"; navpage="socialstudies"; }
else if (location.href.indexOf('mathscience')!=-1 || params(location.search,'Cat','0')=='17'){ categoryID="17"; navpage="mathscience"; }
else if (location.href.indexOf('healthsafety')!=-1 || params(location.search,'Cat','0')=='21'){ categoryID="21"; navpage="healthsafety"; }
else if (location.href.indexOf('languagearts')!=-1 || params(location.search,'Cat','0')=='19'){ categoryID="19"; navpage="languagearts"; }
else if (location.href.indexOf('disneynature')!=-1 || params(location.search,'Cat','0')=='18'){ categoryID="18"; navpage="disneynature"; }
else if (location.href.indexOf('aboutus')!=-1){ categoryID="0"; navpage="aboutus"; }
else { categoryID="0"; navpage="default"; }


/*---GLOBAL NAVIGATION---*/
function writeTopNav(){

document.writeln('<div id="header" class="clearfix" style="position:relative;">\
<h1><a id="homepage_title" class="colors_homepage_title" href="http://dep.disney.go.com/index.html" title=""><span>Disney Educational Productions</span></a></h1>\
<div id="util_nav">\
<ul>\
<li><a href="http://www.dep-store.com/register.asp">Register</a> <a href="http://www.dep-store.com/login.asp"><img src="/v/images/login.gif" alt="" title="" /></li>\
<li><a href="http://www.dep-store.com/myaccount.asp">Check Order Status</a></li>\
</ul>\
</div>\
<div id="view_cart">\
<a href="http://www.dep-store.com/shoppingcart.asp?Check=True"><img src="/v/images/cart.gif" alt="" title="" align="bottom" /> <img src="/v/images/view-cart.gif" alt="" title="" align="bottom" /></a>\
</div>\
<div id="depnav">\
<ul>\
<li class="li1"><a href="http://dep.disney.go.com/aboutus.html" title=""><span>About Us</span></a></li>\
<li class="li2"><a href="http://dep.disney.go.com/disneynature.html" title=""><span>Nature</span></a></li>\
<li class="li3"><a href="http://dep.disney.go.com/socialstudies.html" title=""><span>Social Studies</span></a></li>\
<li class="li4"><a href="http://dep.disney.go.com/languagearts.html" title=""><span>Language & Fine Arts</span></a></li>\
<li class="li5"><a href="http://dep.disney.go.com/mathscience.html" title=""><span>Math &amp; Science</span></a></li>\
<li class="li6"><a href="http://dep.disney.go.com/healthsafety.html" title=""><span>Health &amp; Safety</span></a></li>\
<li class="li7"><a href="http://dep.disney.go.com/itt-electoralcollege.html" title=""><span>Interactive Teaching Tools</span></a></li>\
</ul>\
</div>\
</div>');

AddEvent(window,'load',setNavActive);

}

function goSearch(){
if (gid('queryinput').value=="enter search terms"){ gid('queryinput').value="" }
if (location.href.indexOf('search.html')==-1){
location.href="http://dep.disney.go.com/search.html?q="+gid('queryinput').value+"&cat="+gid('selectgrade').value+","+gid('selectsubject').value+","+gid('selectseries').value;
} else { doSearch(); }
}

function checkClearBox(boxer){
if (boxer.value=="enter search terms"){ boxer.value=""; }
}


function writeSearchBox(){

document.writeln('<form id="searchform" action="javascript:goSearch()">\
<div style="background:url(/v/images/background-search.gif) no-repeat; width:213px; height:183px;">\
<div style="height:149px; padding:0 0 0 18px;">\
\
<input type="text" name="queryinput" id="queryinput" value="enter search terms" onclick="checkClearBox(this)">\
<br>\
<select id="selectgrade">\
<option value="0">Grade Level</option>\
<option value="25">Elementary</option>\
<option value="26">Middle & Jr. High</option>\
<option value="24">High School</option>\
</select>\
<br>\
<select id="selectsubject">\
<option value="0">Subject</option>\
<option value="18">Disney Nature</option>\
<option value="22">Social Studies</option>\
<option value="19">Language & Arts</option>\
<option value="17">Math & Science</option>\
<option value="21">Health & Safety</option>\
</select>\
<br>\
<select id="selectseries">\
<option value="0">Series</option>\
<option value="29">The Science Of Disney Imagineering</option>\
<option value="30">ABC News Classroom</option>\
<option value="31">Based On Books</option>\
<option value="32">Bill Nye The Science Guy</option>\
<option value="33">Disney\'s Animal World</option>\
<option value="34">New True Life Adventures</option>\
<option value="35">Schoolhouse Rock</option>\
<option value="36">The Eyes of Nye</option>\
</select>\
</div>\
<div style="text-align:right; padding-right:18px;"><input type="image" src="/v/images/button-search.gif" style="width:50px; height:24px; margin-top:0; border:0; padding-left:0;"></div>\
</div>\
</form>');

}


function $leftPromo(lp){

if (lp.href==null){ lp.href=lp.url; }
document.writeln('<div id="LEFTPROMO" style="position:relative; width:218px; height:262px; background:url(/v/images/background-leftpromo.jpg) no-repeat;">\
\
<div style="position:absolute; left:9px; top:10px; width:200px; height:205px;"><a href="'+lp.href+'"><img src="'+lp.image+'" alt="'+lp.title+'" border="0"></a></div><br>\
<div style="position:absolute; top:217px; left:18px; width:180px; height:32px;">\
<div style="font:bold 10px verdana; color:#0090C7;">'+lp.title+'</div>\
<div style="font:10px verdana; color:#666666;">'+lp.text+'</div>\
</div>\
<div style="position:absolute; left:9px; top:10px; width:200px; height:250px;">\
<a href="'+lp.href+'"><img src="/v/images/blank.gif" width="200" height="250" border="0" alt=""></a>\
</div>\
\
</div><br>');

}


function writeFooter(){

document.writeln('<div id="FOOTERDIV" style="background:url(/v/images/background-footer.gif) no-repeat; width:1007px; height:32px;">\
<div align="center" style="padding-top:7px; font:10px verdana; color:black;">\
<a href="http://dep.disney.go.com/customer-service.html">Help/Customer Service</a> | <a href="http://dep.disney.go.com/help.html">FAQ</a> | <a href="http://dep.disney.go.com/faq_return.html">Order Policies</a>\
</div>\
</div>');

}

function goProduct(_productid){
location.href="http://www.dep-store.com/ProductDetails.asp?ProductCode="+_productid;
}

function setNavActive(){
var _nav = document.getElementById('depnav').getElementsByTagName('A');
for(var n=0; n<_nav.length; n++){ if((_nav[n].href).indexOf(navpage)>0){ _nav[n].className = 'active'; break; }}
}

function GOurl(url){
url=url.replace(/ *$/mg,'').replace(/^ */mg,'');
if (url.indexOf('http')==-1){ url="http://"+url; }
window.open("http://home.disney.go.com/guestservices/disclaimers/redirect?destination="+escape(url));
}