//***DETERMINE DAYTIME SECTION**************
function daySection()
{
var dayUrl = document.location.toString();
this.yr = (dayUrl.indexOf('/yr/')>=0)?1:0;
this.bb = (dayUrl.indexOf('/bb/')>=0)?1:0;
this.gl = (dayUrl.indexOf('/gl/')>=0)?1:0;
this.atwt = (dayUrl.indexOf('/atwt/')>=0)?1:0;
this.price = (dayUrl.indexOf('/price/')>=0)?1:0;
return this;
}

var oDay = new daySection();
var gVarDaySection;
var gVarDaySection = oDay.atwt?'atwt':oDay.bb?'bb':oDay.gl?'gl':oDay.yr?'yr':oDay.price?'price':0;
//********************************************



//***START SUBNAVIGATION CODE*****************
var dt_NS = (document.layers) ? 1 : 0;
var dt_IE = (document.all && document.getElementById) ? 1 : 0;
var dt_N6 = (!document.all && document.getElementById) ? 1 : 0;
var dt_hideMenu = null;

function dtSubNavHide(paramDiv){
if(dt_IE)eval('document.all.'+paramDiv+'.style.visibility="hidden"');
if(dt_NS)eval('document.'+paramDiv+'.visibility="hidden"');
if(dt_N6)
	{
	dt_elm = document.getElementById(paramDiv);
	dt_elm.style.visibility = "hidden";
	}
}

function dtSubNavShow(paramDiv){
dtSubNavHideAll();
if(dt_IE)eval('document.all.'+paramDiv+'.style.visibility="visible"');
if(dt_NS)eval('document.'+paramDiv+'.visibility="visible"');
if(dt_N6)
	{
	dt_elm = document.getElementById(paramDiv);
	dt_elm.style.visibility = "visible";
	}
}

function dtSubNavHideAll(){
dtSubNavHide('divTickets');
dtSubNavHide('divUpdates');
dtSubNavHide('divBehind');
dtSubNavHide('divCommunity');
dtSubNavHide('divExclusives');
dtSubNavHide('divAbout');
}
//***END SUBNAVIGATION CODE*****************



//***START TOP NAV MOUSEOVER CODE************
function dtTopNavHideAll(){
eval('document.btnTopNavHomepage.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_homepage.gif"');
if(gVarDaySection=='price')eval('document.btnTopNavTickets.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_tickets.gif"');
if(gVarDaySection!='price')eval('document.btnTopNavUpdates.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_updates.gif"');
if(gVarDaySection!='price')eval('document.btnTopNavBehind.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_behind.gif"');
eval('document.btnTopNavCommunity.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_community.gif"');
eval('document.btnTopNavExclusives.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_exclusives.gif"');
eval('document.btnTopNavAbout.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_about.gif"');
eval('document.btnTopNavStore.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_store.gif"');
}

function dtTopNavShow(paramBtn){
dtTopNavHideAll();
switch(paramBtn)
	{
	case 'btnTopNavHomepage':
		eval('document.btnTopNavHomepage.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_homepage_over.gif"');
		break;
	case 'btnTopNavTickets':
		eval('document.btnTopNavTickets.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_tickets_over.gif"');
		break;
	case 'btnTopNavUpdates':
		eval('document.btnTopNavUpdates.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_updates_over.gif"');	
		break;
	case 'btnTopNavBehind':
		eval('document.btnTopNavBehind.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_behind_over.gif"');
		break;
	case 'btnTopNavCommunity':
		eval('document.btnTopNavCommunity.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_community_over.gif"');
		break;
	case 'btnTopNavExclusives':
		eval('document.btnTopNavExclusives.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_exclusives_over.gif"');
		break;
	case 'btnTopNavAbout':
		eval('document.btnTopNavAbout.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_about_over.gif"');
		break;
	case 'btnTopNavStore':
		eval('document.btnTopNavStore.src="/daytime/'+gVarDaySection+'/images/global/nav/dt_'+gVarDaySection+'_nav_store_over.gif"');
		break;
	}
}

function dtNavTimeOut() {
	setTimeout("dtSubNavHideAll();dtTopNavHideAll()",36000);
}
//***END TOP NAV MOUSEOVER CODE************



//****FUNCTIONS FOR DYNAMIC POSITIONING OF THE SUBNAV****
function dtShowStyle()
{
	if(document.getElementById('divAdTop')!=null)
	{
		var thiselement = document.getElementById('divAdTop');
		vAdTop = thiselement.offsetTop; 
	}
	if(vAdTop==null||vAdTop=="")
	{
		var vAdTop = 1;
	}
	
	vTickets = eval(parseInt(vAdTop)+148+0);
	vUpdate = eval(parseInt(vAdTop)+148+0);
	vBehinds = eval(parseInt(vAdTop)+148);
	vCommunitys = eval(parseInt(vAdTop)+148+0);
	vExclusive = eval(parseInt(vAdTop)+148+0);
	vAbout = eval(parseInt(vAdTop)+148);	
	dims = vTickets+":"+vAdTop+":"+vUpdate+":"+vBehinds+":"+vCommunitys+":"+vExclusive+":"+vAbout;
	return dims;
}
var global_dims = "";

function dtNavInitialize()
{
global_dims = dtShowStyle();
dims1 = global_dims.split(':');

ticketsTop = dims1[1];
updatesTop = dims1[2];
behindTop = dims1[3];
communityTop= dims1[4];
exclusivesTop = dims1[5];
aboutTop = dims1[6];

document.getElementById('divTickets').style.top = updatesTop;
document.getElementById('divUpdates').style.top = updatesTop;
document.getElementById('divBehind').style.top = behindTop;
document.getElementById('divCommunity').style.top = communityTop;
document.getElementById('divExclusives').style.top = exclusivesTop;
document.getElementById('divAbout').style.top = aboutTop;
}
//****END FUNCTIONS FOR DYNAMIC POSITIONING OF THE SUBNAV****


//****START FUNCTION FOR RANDOM HEADER IMAGE****
/*var dtArrLength = dtRandomImages.length;
var preBuffer = new Array()
var theImage = Math.round(Math.random()*(dtArrLength-1));
function showDaytimeHeader(){
document.write('<img src="'+dtRandomImages[theImage]+'" border="0" alt="">');
}*/
//****END FUNCTION FOR RANDOM HEADER IMAGE****


//********Clarence page function
function openClaence(clip){popaudio = window.open('/daytime/yr/updates/clarence/audplayer.html?' + clip, 'update', 'width=340,height=190,scrollbars=0');}
//********end Clarence page function






/**ALL OLD CODE************************************

function daySection(){
var dayUrl = document.location.toString();
this.yr = (dayUrl.indexOf('/yr/')>=0)?1:0;
this.bb = (dayUrl.indexOf('/bb/')>=0)?1:0;
this.gl = (dayUrl.indexOf('/gl/')>=0)?1:0;
this.atwt = (dayUrl.indexOf('/atwt/')>=0)?1:0;
this.price = (dayUrl.indexOf('/price/')>=0)?1:0;
return this;}

var day = new daySection();
var dayH,dayS,pre;
var dayS = day.atwt?'atwt':day.bb?'bb':day.gl?'gl':day.yr?'yr':day.price?'price':0;
var dayH = day.atwt?'#ffe9be':day.bb?'#ffceff':day.gl?'#ccefff':day.yr?'#ffdad6':day.price?'#e4ffc3':'#ffffff';
var cS = day.atwt||day.bb||day.gl||day.yr||day.price?'gnv_':'gnv_cs_';

var day_home = new Image();day_home.src = '/daytime/images/dt_'+cS+'home.gif';
var day_home_on = new Image();day_home_on.src = '/daytime/images/dt_'+cS+'home_over.gif';
var yr_home = new Image();yr_home.src = '/daytime/images/dt_'+cS+'yr.gif';
var yr_home_on = new Image();yr_home_on.src = '/daytime/images/dt_'+cS+'yr_over.gif';
var bb_home = new Image();bb_home.src = '/daytime/images/dt_'+cS+'bb.gif';
var bb_home_on = new Image();bb_home_on.src = '/daytime/images/dt_'+cS+'bb_over.gif';
var gl_home = new Image();gl_home.src = '/daytime/images/dt_'+cS+'gl.gif';
var gl_home_on = new Image();gl_home_on.src = '/daytime/images/dt_'+cS+'gl_over.gif';
var atwt_home = new Image();atwt_home.src = '/daytime/images/dt_'+cS+'atwt.gif';
var atwt_home_on = new Image();atwt_home_on.src = '/daytime/images/dt_'+cS+'atwt_over.gif';
var price_home = new Image();price_home.src = '/daytime/images/dt_'+cS+'price.gif';
var price_home_on = new Image();price_home_on.src = '/daytime/images/dt_'+cS+'price_over.gif';	
var sitemap = new Image();sitemap.src = '/daytime/images/dt_'+cS+'sitemap.gif';
var sitemap_on = new Image();sitemap_on.src = '/daytime/images/dt_'+cS+'sitemap_over.gif';

day.price?navNum='\,hide(\'navigation3\')':day.atwt||day.bb||day.gl||day.yr?navNum='\,hide(\'navigation5\')':navNum='';var php = 'show.php?showID=';var storeNum = day.atwt?php+'23':day.bb?php+'24':day.gl?php+'28':day.yr?php+'40':day.price?php+'37':'';

var globalLinks = '<tr><td><a href="/daytime/"  onMouseOver="flip(\'dayHome\'\,\'day_home_on\')'+navNum+'\;" onMouseOut="flip(\'dayHome\'\,\'day_home\')\;"><img src="/daytime/images/dt_'+cS+'home.gif" width=145 border=0 name="dayHome"></a></td></tr><tr><td><a href="/daytime/yr/"  onMouseOver="flip(\'yrHome\'\,\'yr_home_on\')\;" onMouseOut="flip(\'yrHome\'\,\'yr_home\')\;"><img src="/daytime/images/dt_'+cS+'yr.gif" width=145 height=25 border=0 name="yrHome"></a><br><a href="/daytime/bb/"  onMouseOver="flip(\'bbHome\'\,\'bb_home_on\')\;" onMouseOut="flip(\'bbHome\'\,\'bb_home\')\;"><img src="/daytime/images/dt_'+cS+'bb.gif" width=145 height=25 border=0 name="bbHome"></a><br><a href="/daytime/gl/"  onMouseOver="flip(\'glHome\'\,\'gl_home_on\')\;" onMouseOut="flip(\'glHome\'\,\'gl_home\')\;"><img src="/daytime/images/dt_'+cS+'gl.gif" width=145 height=25 border=0 name="glHome"></a><br><a href="/daytime/atwt/"  onMouseOver="flip(\'atwtHome\'\,\'atwt_home_on\')\;" onMouseOut="flip(\'atwtHome\'\,\'atwt_home\')\;"><img src="/daytime/images/dt_'+cS+'atwt.gif" width=145 height=25 border=0 name="atwtHome"></a><br><a href="/daytime/price/"  onMouseOver="flip(\'priceHome\'\,\'price_home_on\')\;" onMouseOut="flip(\'priceHome\'\,\'price_home\')\;"><img src="/daytime/images/dt_'+cS+'price.gif" width=145 height=25 border=0 name="priceHome"></a><br><a href="/daytime/dt_sitemap.shtml" onMouseOver="flip(\'sitemap\'\,\'sitemap_on\')\;" onMouseOut="flip(\'sitemap\'\,\'sitemap\')\;"><img src="/daytime/images/dt_'+cS+'sitemap.gif" width=145 height=27 border=0 name="sitemap"></a></td></tr></table>';

function buildNav(){
var dayBuckets = new Array('update','scenes','community','exclusives','about');
var priceBuckets = new Array('ticket','exclusives','community','about');
var dayNavBits = new Array('<table cellspacing=0 cellpadding=0 border=0 width=145><tr><td><a href="/daytime/'+dayS+'/" onMouseOver="flip(\''+dayS+'Title\'\,\''+dayS+'nv_on\')\,hide(\'navigation1\')\;" onMouseOut="flip(\''+dayS+'Title\'\,\''+dayS+'nv\')\;"><img src="/daytime/Common/images/dt_'+dayS+'nv_title.gif" width=145 height=27 border=0 name="'+dayS+'Title"></a><br>','</td></tr>'+globalLinks);

document.write(dayNavBits[0]);

day.price?buckets=priceBuckets:buckets=dayBuckets;
for(s=0,q=0,n=1;s<(buckets.length);s++){
if(buckets[q]=='about'&&!day.price){
storeLink = '<a href="http://store.cbs.com/'+storeNum+'" width=145 height=24 onMouseOver="flip(\''+dayS+'store\'\,\''+dayS+'nv_store_on\'\)\;hide(\'navigation5\')" onMouseOut="flip(\''+dayS+'store\'\,\''+dayS+'nv_store\'\)"><img src="/daytime/Common/images/dt_'+dayS+'nv_store.gif" border=0 name="'+dayS+'store"></a><br>';
}else{storeLink = '';}
document.write('<a href="#"  onMouseOver="flip(\''+dayS+buckets[q]+'\'\,\''+dayS+'nv_'+buckets[q]+'_on\')\,show(\'navigation'+(n++)+'\')\;" onMouseOut="flip(\''+dayS+buckets[q]+'\'\,\''+dayS+'nv_'+buckets[q]+'\')\;"><img src="/daytime/Common/images/dt_'+dayS+'nv_'+buckets[q]+'.gif" width=145 height=24 border=0 name="'+dayS+buckets[q]+'"></a><br>'+storeLink);q++;}
/*'<a href="/daytime/price/tickets/" onMouseOver="flip(\'priceTicket\'\,\'pricenv_ticket_on\')\,hide(\'navigation3\')\;" onMouseOut="flip(\'priceTicket\'\,\'pricenv_ticket\')\;"><img src="/daytime/Common/images/dt_pricenv_ticket.gif" width=145 height=24 border=0 name="priceTicket"></a><br>',
day.price?document.write('<a href="http://store.cbs.com/'+storeNum+'" onMouseOver="flip(\'pricestore\'\,\'pricenv_store_on\'\)\;hide(\'navigation4\')" onMouseOut="flip(\'pricestore\'\,\'pricenv_store\'\)"><img src="/daytime/Common/images/dt_pricenv_store.gif" width=145 height=24 border=0 name="pricestore"></a><br>'):0;
document.write(dayNavBits[1]);}

function buildMenu(menuItem){
menuItem=='update'?navId=1:menuItem=='ticketP'?navId=1:menuItem=='scenes'?navId=2:menuItem=='community'?navId=3:menuItem=='communityP'?navId=3:menuItem=='exclusives'?navId=4:menuItem=='exclusivesP'?navId=2:menuItem=='about'?navId=5:menuItem=='aboutP'?navId=4:0;var dayshow = '/'+dayS;

//SPECIAL EXCEPTIONS
var clarence = (menuItem=='update')&&(day.yr)?'Cla\'ence Update':'';
var clarenceUrl = clarence!=''?'/yr/updates/clarence/':'';
var fanPanel = (menuItem=='exclusives')&&(day.bb)?'Fan Panel':'';
var fanPanelUrl= fanPanel!=''?'/community/fan_panel/':'';
//var familyTree = (menuItem=='exclusives')&&(day.yr||day.bb)?'Family Trees':'';
//var familyTreeUrl = familyTree!=''?dayshow+'/behind/specials/familytree/':'';
var bbespanoel = day.bb?'B&amp;B en espa&#241;ol':'';
var bbespanoelUrl = bbespanoel!=''?dayshow+'/about/spanish/dt_bb_esp_family.shtml':'';
//UPDATES AND PREVIEWS
var Update = new Array('Daily Recap',dayshow+'/updates/daily/','Update Archive',dayshow+'/updates/daily/text/dt_'+dayS+'_up_dly_lastweek.shtml','Sneak Preview',dayshow+'/updates/sneaks/','Video Peeks','/quickies/',clarence,clarenceUrl);
//BEHIND THE SCENES
var Scenes = new Array('Interviews',dayshow+'/behind/interviews/','Special Features',dayshow+'/behind/specials/');
//COMMUNITY
var Community = new Array('Soap Chat','/chat/','Letter Rip',dayshow+'/community/letter/','Mail Bonding',dayshow+'/community/mail/','Viewers Voice',dayshow+'/community/voice/'); 
//EXCLUSIVES
var Exclusives = new Array('Screen Savers','/downloads/dt_scr_index.shtml','Daytime Newsletter','/newsletter/','2004 Daytime Emmys','/specials/emmys_2004/','Daytime Wallpaper','/downloads/dt_wp_index.shtml',bbespanoel,bbespanoelUrl,fanPanel,fanPanelUrl/*,familyTree,familyTreeUrl);
//ABOUT
var About = new Array('Casting Corner',dayshow+'/about/casting/','Seeing Stars',dayshow+'/about/stars/','This Just In',dayshow+'/about/justin/','Cast Bios',dayshow+'/about/bios/','Contact Us',dayshow+'/about/contact/','Show Info',dayshow+'/about/showinfo/','FAQ',dayshow+'/about/faq/');
//Price Tickets
var ticketP = new Array('How To Get Tickets',dayshow+'/tickets/');
//PRICE EXCLUSIVES
var exclusivesP = new Array('Special Features',dayshow+'/behind/specials/','Screen Savers','/downloads/dt_scr_index.shtml');
//PRICE COMMUNITY
var communityP = new Array('Price Mailbag',dayshow+'/community/mailbag/','Price Q&A',dayshow+'/community/qa/');
//PRICE ABOUT
var aboutP = new Array('Cast Bios',dayshow+'/about/bios/','This Just In',dayshow+'/about/justin/','Contact Us',dayshow+'/about/contact/','Show Info',dayshow+'/about/showinfo/','FAQ',dayshow+'/about/faq/');

var protoSections = menuItem=='update'?Update:menuItem=='scenes'?Scenes:menuItem=='community'?Community:menuItem=='exclusives'?Exclusives:menuItem=='about'?About:menuItem=='exclusivesP'?exclusivesP:menuItem=='communityP'?communityP:menuItem=='aboutP'?aboutP:menuItem=='ticketP'?ticketP:0;
var menuSegments = new Array('<div id="navigation'+navId+'" class="navItem" onmouseover="show(\'navigation'+navId+'\')" onmouseout="hide(\'navigation'+navId+'\')\;"><table cellpadding=0 cellspacing=0 border=0 width=180><tr><td width=2 valign=top><img src="/Common/images/spacer_000000.gif" width="2" height="25" border="0" alt=""></td><td align=center bgcolor="#000000"><img src="/Common/images/spacer.gif" width="1" height="3" border="0" alt=""><table bgcolor="'+dayH+'" cellpadding=0 cellspacing=0 border=0 width=174><tr><td><img src="/Common/images/spacer.gif" width=9 height=1 border=0 alt=""></td><td>&nbsp\;</td><td align=right><a href="#" onclick="hide(\'navigation'+navId+'\');return false"><img src="/daytime/Common/images'+dayshow+'_closebox.gif" width="13" height="13" border="0" alt="" hspace=3 vspace=3></a></td></tr><tr><td>&nbsp\;</td><td>','<br></td><td>&nbsp\;</td></tr><tr><td colspan=3 bgcolor="#000000" background=""><img src="/Common/images/spacer.gif" width="1" height="3" border="0" alt=""></td></tr></table></td></tr></table></div>');
document.write(menuSegments[0]);
var f=0;var sections = new Array();
for(x in protoSections){if(protoSections[x]!=''){sections[f++]=protoSections[x]}}
for(n=0,i=0;n<(sections.length);n++){
++i;document.write('<a href="/daytime'+sections[i++]+'"class="'+dayS+'Nav">'+sections[n++]+'</a><br>');}
document.write(menuSegments[1]);}

//builds global daytime navigation table for placement anywhere on the site
function buildGlobalNav(){
daytimeGlobal = '<table cellspacing=0 cellpadding=0 border=0 width=145>'+globalLinks;
document.write(daytimeGlobal);}


all_loaded=true;

*/