zlog("Parsing TcNav.js..."); var myNavEvent = false; var currentlyOver = -1; var navEnabled = true; var FLYOUT_CLOSE_DELAY = 500; var FLYOUT_INITIAL_DELAY = 1000; var is_ie = navigator.userAgent.indexOf("MSIE")>=0; var is_mac = navigator.userAgent.toLowerCase().indexOf("mac")>=0; var hand_cursor = is_ie?"hand":"pointer"; var suppress_flyouts = false; if( navigator.userAgent.indexOf("(R1")==-1 ) { /* no flyouts outside of the player */ suppress_flyouts = true; } else if( getCookieValue("RNProduct").replace(/^.*\&SN\=([^\&]*)\&.*$/,"$1").length <= 0 ) { /* No flyouts for FREE users, same logic as not in player */ suppress_flyouts = true; } if( nav_thepage.indexOf("sp=thenext")>=0 ) { /* No flyouts on the THE NEXT sp pages */ suppress_flyouts = true; } function debug (x) { } function flyOut( navid ) { if( myNavEvent ) return; myNavEvent = true; if( !navEnabled ) return; var button = document.getElementById("navbutton"+navid); var nav = allNavObjs[navid]; if( navid != -1 ) { /* Change the button color... */ if( !button.mouseoutcolor ) button.mouseoutcolor = button.style.backgroundColor; button.style.backgroundColor = button.getAttribute("mouseovercolor"); if( currentlyOver == -1 ) { currentlyOver = navid; setTimeout("fixFlyouts(pageNav)",FLYOUT_INITIAL_DELAY); } else { currentlyOver = navid; fixFlyouts(pageNav); } } } function doCloseAllFlyouts() { if( currentlyOver == -1 ) fixFlyouts( pageNav ); } function closeAllFlyouts() { if( myNavEvent ) { myNavEvent = false; return; } currentlyOver = -1; setTimeout("doCloseAllFlyouts()",FLYOUT_CLOSE_DELAY); } window.document.onmouseover = closeAllFlyouts; function revertColor( obj ) { var button = document.getElementById("navbutton"+obj.navObjID); if( button && button.mouseoutcolor ) button.style.backgroundColor = button.mouseoutcolor; } function doCloseFlyout( navid ) { var obj = allNavObjs[navid]; if( currentlyOver ==-1 || !isDirectLineage( allNavObjs[currentlyOver], obj ) ) { /* Actually perform the close... */ revertColor(obj); if( obj.flied || obj.expanded ) { obj.flied=false; if( document.getElementById("flyout"+navid) ) document.getElementById("flyout"+navid).style.visibility="hidden"; for( var i=0 ; i"+nav.flyout_draw()+""; } document.getElementById("flyout"+navid).style.marginTop = flyout_top+"px"; var screen_visible_bottom; if( !is_ie ) screen_visible_bottom = window.innerHeight + window.scrollY; else screen_visible_bottom = top.window.document.body.offsetHeight + top.window.document.body.scrollTop; var bottom_of_flyout = getAbsoluteTop(nav) +document.getElementById("flyout"+navid).offsetHeight; var flyout_overflow = screen_visible_bottom -bottom_of_flyout; if( flyout_overflow < 0 ) flyout_top += flyout_overflow; if( flyout_top > getAbsoluteTop(nav) ) flyout_top = getAbsoluteTop(nav); else flyout_top += button.offsetHeight; document.getElementById("flyout"+navid).style.marginTop = flyout_top+"px"; document.getElementById("flyout"+navid).style.visibility="visible"; } function getAbsoluteTop( obj ) { if( !obj ) return 0; var thisflyout = document.getElementById("flyout"+obj.navObjID); if( thisflyout ) return thisflyout.offsetTop + getAbsoluteTop(obj.parent); else return 0; } function TCNavFlyoutDraw() { var ret = "" + "" + "" + "
"; if( this.kidz ) for( var i=0 ; i
"; return ret; } function isDirectLineage( younger, older ) { for( ; younger ; younger = younger.parent ) if( younger==older ) return true; return false; } function fixFlyouts( obj ) { try{ if( obj.expanded && currentlyOver!=obj.navObjID ) revertColor(obj); } catch(e){ return; } for( var i=0 ; i=0 && isDirectLineage(allNavObjs[currentlyOver], child) ) { if( child.flied || child.expanded ) fixFlyouts(child); else openFlyout(child.navObjID); } else { revertColor(child); if( child.flied || child.expanded ) { fixFlyouts(child); if( child.flied ) doCloseFlyout(child.navObjID); } } } } function TCNavGo(id) { var thisObj = allNavObjs[id]; var tab = thisObj.tab; var theurl = ""; var type = eval("thisObj.type"); if( tier>1 || is_r1c ) var LI=localregion; else var LI=plyrObj.PlayerProperty("LANGUAGEID"); if( !type || !type.length ) { if( thisObj.url ) type="url"; if( thisObj.cid ) type="cid"; } if( thisObj.url && thisObj.url.length>0 ) { if( eval("thisObj.url").indexOf("javascript:") == 0 ) theurl = thisObj.url; else if( eval("thisObj.url").indexOf("http://") == 0 ) theurl = thisObj.url; else theurl = nav_rgx+thisObj.url; } else if( type=="cat" || type=="mncat" ) theurl = nav_rgi+"r/?key="+tab+"&c="+eval("thisObj.cid"); else if( type=="mnbrowse" ) theurl = nav_rgi+"r/?key="+tab+"&c="+eval("thisObj.parent.cid")+"&special=browse_artists"; else if( type=="tc" ) { if( thisObj.tab=="realone" ) theurl = nav_rgi+"r/?tc=realone&LI="+LI; else theurl = nav_rgi+"r/?tc="+eval("thisObj.tab"); } else if( type=="channel" ) theurl = nav_rgi+"channels/r/?id="+eval("thisObj.id")+"&src=flyout"; else if( type=="sp" ) theurl = nav_rgi+"r/?key="+tab+"&sp="+eval("thisObj.sp"); else if( type=="realone_page" ) theurl = nav_rgi+"r/?r1sec="+eval("thisObj.subsection")+"&LI="+LI; else if( type=="realone_page_sub" ) theurl = nav_rgi+"r/?r1sec="+eval("thisObj.parent.subsection")+"&r1page="+eval("thisObj.r1page")+"&LI="+LI; else if( type=="browse_artist" ) theurl = nav_rgi+"r/?key="+tab+"&c=_browse_artists"; else if( type=="browse_channels" ) theurl = nav_rgi+"channels/?topic="+thisObj.topic; else if( type=="home" ) { if( tier>1 ) { theurl = nav_rgx+""; } else { var CO=plyrObj.PlayerProperty("COUNTRYID"); var LP=plyrObj.PlayerProperty("LANGUAGEPREFERENCE"); theurl = nav_rgi+"r/?tc=home&CO="+CO+"&LP="+LP; } } if( theurl.length ) { currentlyOver = thisObj.parent.navObjID; navEnabled = false; fixFlyouts( pageNav ); if( tier==1 ) { if( theurl.indexOf("http://")!=0 ) theurl = "http://" + location.hostname + ( (location.port=="80" || location.port=="") ? "" : ":"+location.port ) + theurl; plyrObj.OpenURLInPlayerBrowser(theurl); } else { document.location.href = theurl; } } else alert("URL Error."); if( window.event ) window.event.cancelBubble = true; } function getColor( type, obj ) { switch( type ) { case "boxcolor": return obj.boxcolor; case "basecolor": return obj.fontcolor; } /* Topic Centers (not selected)... */ if( (obj.type=='tc'&&!obj.expanded) || obj.type=='home' ) { switch( type ) { case "bgcolor": return "e6e6e6"; case "bgcolor_over": return obj.bgcolor; case "fontcolor": return "333333"; } } /* Selected items... */ else if( obj.selected ) { switch( type ) { case "bgcolor": return "ffffff"; case "bgcolor_over": return "ffffff"; case "fontcolor": return obj.fontcolor; } } /* Others... */ else { switch( type ) { case "bgcolor": return (obj.depth()>2)?obj.bgcolor_over:obj.bgcolor; case "bgcolor_over": return (obj.depth()>2)?obj.bgcolor2:obj.bgcolor_over; case "fontcolor": return obj.fontcolor; } } } function TCNavDraw() { var ret = ""; ret += ""; ret += ""; ret += "
"; fixHeight(this.navObjID); return ret; } function fixHeight(navid) { var theheight = document.getElementById("navbutton"+navid)?document.getElementById("navbutton"+navid).offsetHeight:0; if( !is_ie ) theheight--; if( theheight<1 ) { setTimeout("fixHeight('"+navid+"');",1000); return; } document.getElementById("navfakediv1"+navid).style.height = theheight + "px"; if( document.getElementById("navfakediv2"+navid) ) document.getElementById("navfakediv2"+navid).style.height = theheight + "px"; } function topLevelFindOpener() { this.findOpener(); if( !this.expanded ) /* ...must be home if not expanded already */ { this.title = ""; this.expanded = true; } else { this.type="home"; this.basecolor="%base%"; this.bgcolor="%flyout1%"; this.bgcolor2="%flyout2%"; this.bgcolor_over="%flyout3%"; this.fontcolor="%base%"; this.boxcolor="%base%"; } } function TCNavFindOpener() { for( var i=0 ; i
zlog("Done w/TcNav.js.");