window.onerror=function(){ return true; }
function gid(_id){ return document.getElementById(_id); }
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; }

imgroot=(location.href.match(/(file\:|tsdev|scrubs-tv)/gi)!=null)?'images':window.location.protocol+'//bventertainment.go.com/tv/touchstone/scrubs/images';
siteroot=(location.href.match(/(file\:|tsdev|scrubs-tv)/gi)!=null)?'':'http://scrubs-tv.com/';

var _proto='http://'; try{ if (window.location.protocol == "https:"){ _proto='https://'; } } catch(lockpee){}
document.writeln('<scr'+'ipt language="javascript" src="//studio.go.com/chrome/chrome.js"><\/scr'+'ipt>');

document.writeln('<style>\
.d { font-family:arial,helvetica; font-size:10px; color:#31696b; font-weight:bold; }\
.t { font-family:arial,helvetica; font-size:12px; color:white; }\
.h { font-family:arial,helvetica; font-size:14px; color:white; font-weight:bold; }\
.l { color:cafdff; }\
.hlnk { font-family:arial,helvetica; font-size:16px; color:white; font-weight:bold; }\
.hlnk:hover { color:cafdff; }\
.hn { color:cafdff; font-weight:bold; }\
.hn:hover { color:8cd3ef; }\
#syndy a{color:cafdff; font-weight:bold;}\
#syndy a:hover{color:8cd3ef;}\
body { scrollbar-highlight-color:#497172; scrollbar-shadow-color:#000000; scrollbar-track-color:#666666; scrollbar-3dlight-color:#666666; scrollbar-arrow-color:#ffffff; scrollbar-base-color:#000000; scrollbar-darkshadow-color:#194142; scrollbar-face-color:#295152; }\
.bored{ border:1px solid #ceffff; }\
#footerspacer{ display:none; }\
</style>');

function writePrivacy(gs) {
document.writeln('<table width="770" border="0" cellspacing="0" cellpadding="0" align="center" background="'+imgroot+'/global/ftr_bg.gif"><tr><td><img src="'+imgroot+'/music/bar.gif" width="770" height="1" alt="" border="0"><br><table width="100%" border="0" cellspacing="0" cellpadding="0" background=""><tr><td valign="top"><img src="'+imgroot+'/blank.gif" width="30" height="45" alt="" border="0"></td><td valign="top" align="center" style="font:11px arial; color:white;">');
if (gs != null){ document.writeln('"Garden State" photo courtesy of Fox Searchlight Pictures<br>'); }
document.writeln('<a href="https://register.go.com/scrubs/index" class="l">Register</a> | <a href="https://register.go.com/scrubs/lists" class="l">Guest Services</a> | <a href="http://register.go.com/go/goFAQ" class="l" target="_blank">Help</a><br>');
writeNBFooterSmall('&copy; Disney*ABC Domestic Television. All rights reserved.',null,"#cafdff");
document.writeln('</td><td valign="top"><img src="'+imgroot+'/touchstone_white.gif" width="130" height="45" alt="Touchstone" border="0"></td></tr></table></td></tr></table>');
init();
}
function goNewsletters(){
window.open("http://register.go.com/scrubs/lists","ScrubsNewsletters","toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=no,width=796,height=490");
}
function writePrefCenter(){
document.writeln('<a href="javascript:goNewsletters();" style="font-family:arial,verdana,helvetica;font-size:11px;color:white;font-weight:bold;">- Visit Our Preference Center -</a><br>');
}

leftPos=1, topPos=1, popW=1, popH=1, popDimensions = "";
function centerIt(popW,popH,urlToCenter,centeredWinName){
var w = 800, h = 600; if (document.all || document.layers || document.getElementById) { w=screen.availWidth; h=screen.availHeight; }
leftPos = (w-popW)/2, topPos = (h-popH)/2; popDimensions = 'width='+popW+',height='+popH+',left='+leftPos+',top='+topPos+',scrollbars=0';
if (urlToCenter != null){ winner=window.open(urlToCenter,centeredWinName,popDimensions); return winner; }
}

function roll(what){c1=document.images[what].src.substring(0,document.images[what].src.length-4); c2=document.images[what].src.substring(document.images[what].src.length-4,document.images[what].src.length); document.images[what].src=c1+'_over'+c2;}
function unroll(what){c1=document.images[what].src.substring(0,document.images[what].src.length-9); c2=document.images[what].src.substring(document.images[what].src.length-4,document.images[what].src.length); document.images[what].src=c1+c2;}

//hitbox variables
try{ var _pn=document.location.href.match(new RegExp("\/([^\/\?\.]*)\.htm"))[1]; } catch(peein){ var _pn='index'; }
if (_pn==""){_gpn="index";}

var _mlc="/TVPlex/Scrubs";
var _acct="DM510312C3MA38EN3;DM51030813MR38EN3;DM5103083LCA38EN3";

function goBoard(){ location.href="http://forums.go.com/forums/scrubs/index"; }

function popVideo(){
window.open('popvideo.html','ScrubsSupermanVideo','width=250,height=145,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0'); }

function writeNav(){
document.writeln('<table border="0" cellspacing="0" cellpadding="0" align="center"><tr><td>');
document.writeln('<img src="'+imgroot+'/scrubs-header-9pm-thurs.jpg" width="770" height="112" alt="" border="0" usemap="#scrubs_hdr"><br>');
document.writeln('<a href="'+siteroot+'guide.html" onmouseover="roll(1)" onmouseout="unroll(1)"><img src="'+imgroot+'/scrubs_nav_eguide.gif" width="123" height="23" alt="episode guide" border="0"></a><a href="'+siteroot+'cast.html" onmouseover="roll(2)" onmouseout="unroll(2)"><img src="'+imgroot+'/scrubs_nav_cast.gif" width="112" height="23" alt="cast and credits" border="0"></a><a href="'+siteroot+'rounds.html" onmouseover="roll(3)" onmouseout="unroll(3)"><img src="'+imgroot+'/scrubs_nav_rounds.gif" width="119" height="23" alt="scrubs rounds" border="0"></a><a href="'+siteroot+'bts.html" onmouseover="roll(4)" onmouseout="unroll(4)"><img src="'+imgroot+'/scrubs_nav_scenes.gif" width="147" height="23" alt="behind the scenes" border="0"></a><a href="'+siteroot+'music.html" onmouseover="roll(5)" onmouseout="unroll(5)"><img src="'+imgroot+'/scrubs_nav_music.gif" width="66" height="23" alt="music" border="0"></a><a href="'+siteroot+'fun.html" onmouseover="roll(6)" onmouseout="unroll(6)"><img src="'+imgroot+'/scrubs_nav_fun.gif" width="84" height="23" alt="fun stuff" border="0"></a><a href="javascript:goBoard();" onmouseover="roll(7)" onmouseout="unroll(7)"><img src="'+imgroot+'/scrubs_nav_board.gif" width="119" height="23" alt="message board" border="0"></a><MAP NAME="scrubs_hdr"><AREA SHAPE="rect" COORDS="4,1,318,88", HREF="'+siteroot+'index.html" ALT="Scrubs - thursdays at 9pm et/pt on NBC"><AREA SHAPE="rect" COORDS="293,89,358,109", HREF="http://www.nbc.com/Scrubs/index.html" ALT="NBC.com" target="_blank"></MAP></td></tr></table>');
}

function writeCastNav(active){
document.write('<table width="770" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td><img src="images/cast/cast_hdr.jpg" width="450" height="36" alt="cast and credits" border="0"><a href="cast.html" onmouseover="roll(\'cast\')" onmouseout="unroll(\'cast\')"><img src="images/cast/cast_nav.gif" width="73" height="36" alt="cast" border="0" name="cast"></a>');
if (active=='credits'){ document.write('<a href="credits.html"><img src="images/cast/credits_nav_over.gif" width="118" height="36" alt="credits" border="0" name="credits"></a>');} else { document.write('<a href="credits.html" onmouseover="roll(\'credits\')" onmouseout="unroll(\'credits\')"><img src="images/cast/credits_nav.gif" width="118" height="36" alt="credits" border="0" name="credits"></a>');}
document.write('<a href="guests.html" onmouseover="roll(\'g1\')" onmouseout="unroll(\'g1\')"><img src="images/cast/gueststars.gif" width="129" height="36" alt="guest stars" border="0" name="g1"></a></td></tr></table>');
}

function popCodeBlue(){ centerIt(450,350,'code_blue.html','code_blue'); }
function writeFunNav(active){
document.writeln('<table width="770" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td>');
document.write('<img src="images/fun/funstuff_hdr.jpg" width="274" height="36" alt="fun stuff" border="0">');
if(active!='downloads'){
document.write('<a href="downloads.html" onmouseover="roll(\'downloads\')" onmouseout="unroll(\'downloads\')"><img src="images/fun/nav_downloads.jpg" width="111" height="36" alt="downloads" border="0" name="downloads"></a>');
} else {
document.write('<a href="downloads.html"><img src="images/fun/nav_downloads_over.jpg" width="111" height="36" alt="downloads" border="0" name="downloads"></a>');
}
document.write('<a href="javascript:popCodeBlue();" onmouseover="roll(\'game\')" onmouseout="unroll(\'game\')"><img src="images/fun/nav_game.jpg" width="155" height="36" alt="code blue game" border="0" name="game"></a>');
if(active!='gallery'){
document.write('<a href="gallery.html" onmouseover="roll(\'gallery\')" onmouseout="unroll(\'gallery\')"><img src="images/fun/nav_gallery.jpg" width="97" height="36" alt="gallery" border="0" name="gallery"></a>');
} else {
document.write('<a href="gallery.html"><img src="images/fun/nav_gallery_over.jpg" width="97" height="36" alt="gallery" border="0" name="gallery"></a>');
}
if(active!='sketches'){
document.write('<a href="sketches.html" onmouseover="roll(\'sketch\')" onmouseout="unroll(\'sketch\')"><img src="images/fun/nav_sketches.jpg" width="133" height="36" alt="set sketches" border="0" name="sketch"></a>');
} else {
document.write('<a href="sketches.html"><img src="images/fun/nav_sketches_over.jpg" width="133" height="36" alt="set sketches" border="0" name="sketch"></a>');
}
document.write('</td></tr></table>');
}

// link disclaimer
function GOurl(url) {
height=170;
if (navigator.appName == "Netscape"){ height+=13;}
var pip=window.open("","disclaimer","width=350,height="+height+",top=1,left=1,screenX=1,screenY=1,statusbar=0,scrollbars=0"); pdiddy=pip.document;
pdiddy.write('<html><head><title>Disclaimer</title>');
pdiddy.write('<scr'+'ipt type="text/javascript" language="javascript">');
pdiddy.write('sendTimer = setTimeout("sendToClientSide()",1500);closeTimer = setTimeout("window.close()",15000);');
pdiddy.write('function sendToClientSide(){window.open("'+url+'");}');
pdiddy.write('</scr'+'ipt></head>');
pdiddy.write('<body bgcolor="black" text="#ffffff" link="#ceffff" vlink="#beefef" alink="#deffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/disclaimer-bg.jpg">');
pdiddy.write('<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" style="border:2px solid #ceffff;"><tr><td><table width="100%" border="0" cellspacing="0" cellpadding="8"><tr><td><p align="justify" style="margin-top:10px"><font style="font:bold 11px arial,helvetica;">The web site you are about to link to is not controlled by "Scrubs" and different terms of use and privacy policy will apply. By proceeding you agree and understand that "Scrubs" is not responsible for the site you are about to access.<br><div style="height:15px"><block type="spacer" width="1" height="1"><br></div>If your page does not load within a few seconds, please <nobr><a href="javascript:sendToClientSide();">click here</a> </nobr>to open it.<div align="center" style="font:bold 10px arial; margin-top:10px;"><a href="javascript:window.close();">close this window</a></div></td></tr></table></td></tr></table></body></html>');
pdiddy.close();
}
// end link disclaimer

function imgClick(e){
if (window.event) { thisimg = window.event.srcElement; } else if (e.target) { thisimg = e.target; } else { return; }
p1=thisimg.src.substring(0,thisimg.src.length-4); p2=thisimg.src.substring(thisimg.src.length-4,thisimg.src.length); popsrc=p1+'-lg'+p2;
popw=thisimg.width*2; poph=(thisimg.height*2)+14;
elliot=centerIt(popw,poph,'','_blank');
elliot.document.writeln('<html><head><title></title><style>td{font-family:arial,helvetica; font-size:10px; font-weight:bold;}</style></head><body bgcolor="#295152" text="White" link="#CAFDFF" vlink="#CAFDFF" alink="White" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><img src="'+popsrc+'" alt=""><br><table width="100%" border="0" cellspacing="0" cellpadding="1"><tr><td>&nbsp;&copy; Touchstone Television.</td><td align="right"><a href="javascript:window.close()">close window</a>&nbsp;</td></tr></table></body></html>');
elliot.document.close();
_hbPageView('pic-view-'+_pn, _mlc);
}
function init(){
myArraySet=new Array(); myImages=new Array(); count=-1;
for (i=0;i<document.images.length;i++){
bob=document.images[i];
if (bob.name!="" && bob.name.indexOf('click-')>-1){
bob.onclick=imgClick; bob.style.cursor='pointer';
}}}

var today=new Date();
function getToday(){
if (params(location.search,'time','')!=''){
today=new Date(params(location.search,'time')); document.cookie='time='+today+'; path=/;';
document.writeln('<div style="position:absolute; top:0px; left:0px; width:250px; height:16px; font:bold 11px arial; color:white; background:#072B5E; border:1px solid white; overflow:hidden; z-index:100;">&nbsp; time: '+today.toString()+'</div>');
} else if (params(document.cookie,'time','')!=''){ today=new Date(params(document.cookie,'time'));
document.writeln('<div style="position:absolute; top:0px; left:0px; width:250px; height:16px; font:bold 11px arial; color:white; background:#072B5E; border:1px solid white; overflow:hidden; z-index:100;">&nbsp; time: '+today.toString()+'</div>');
} else { document.writeln('<scr'+'ipt language="javas'+'cript" src="http://register.go.com/regisandkelly/func'+'tions?vars=today"></scr'+'ipt>'); }
}
function doTimeShift(){ //USAGE= doTimeShift(["July 4, 2005","alert('whatever')"], ["July 5, 2005","alert(today)"], ["July 6, 2005","alert('6th')"]);
for (tim=doTimeShift.arguments.length-1; tim>=0; tim--){
if (today>=new Date(doTimeShift.arguments[tim][0])){ eval(doTimeShift.arguments[tim][1]); break; }
}}