
var news_nfl = news_nfldraft = news_mlb = news_nba = news_nhl = news_cfo = news_cba = news_gol = news_aut = news_ten = news_horse = news_cyc = news_box = news_mma = news_oly = news_soc = news_spn = news_brackets = news_wnba = news_worldsports = news_ncaawbasketball = []; 

var news_nfl = new Array (
["/nfl/story/12549440/peek-at-the-week-reeling-broncos-must-find-way-to-derail-hot-chargers","Peek: Reeling Broncos must find way to derail hot Bolts"],
["/video/player/play/nfl_preview/3h4vHyQi_S6FKFmmkrXB3Uv_dINy3VXZ","<b>Video:</b> Chargers-Broncos preview"],
["/nfl/story/12546218/week-11-start-em-and-sit-em","<b>Eisenberg:</b> Week 11 Start \'Em and Sit \'Em"],
["/video/player/play/nfl_fantasy/5syzOppXHlaOKHXzUZdlT0jvRNar3ENf","<b>Video:</b> Eisenberg\'s Week 11 Start \'Em and Sit \'Em"],
["/nfl/story/12546367/hungry-jonesdrew-rushing-to-elite-stature","<b>Prisco:</b> Hungry Jones-Drew rushing to elite stature"],
["/nfl/story/12550007/steelers-to-face-chiefs-without-d-starters-polamalu-kirschke","Steelers\' Polamalu shelved again by left knee injury"],
["/nfl/story/12549773/broncos-orton-gametime-decision-after-missing-third-practice","Broncos\' Simms ready to start at QB for hurt Orton"]
);
var news_nba = new Array (
["/nba/story/12549915/perfect-team-warkentien-best-gm-to-build-machine","Perfect Team: Warkentien best GM to build machine"],
["/nba/gamecenter/recap/NBA_20091120_ORL@BOS/carter-lewis-help-magic-drop-celtics-win-fourth-straight","Carter, Lewis help Magic drop C\'s, win 4th straight"],
["/nba/gamecenter/recap/NBA_20091120_CLE@IND/lebron-pours-in-40-shaqless-cavs-top-pacers","LeBron pours in 40, Shaq-less Cavs top Pacers"],
["/nba/story/12549655/knicks-decide-to-pass-on-available-iverson","Knicks decide to pass on available Iverson"],
["http://ken-berger.blogs.cbssports.com/mcc/blogs/entry/11838893/18424566","<b>Berger:</b> If not New York, then where, A.I.?"],
["/nba/story/12550731/clippers-broadcasters-suspended-for-haddadi-remarks","Clippers broadcasters suspended for Haddadi remarks"],
["/nba/gamecenter/recap/NBA_20091120_HOU@ATL/smiths-late-tipin-pushes-hawks-to-seventh-straight-win","Smith\'s late tip-in pushes Hawks to 7th straight win"]
);
var news_mlb = new Array (
["/mlb/story/12546460/giants-lincecum-wins-second-consecutive-cy-young-award","Giants\' Lincecum wins second consecutive Cy Young"],
["/mlb/story/12547223/lincecums-backtoback-cy-youngs-draw-durability-question-not-hof","<b>Knobler:</b> Lincecum draws durability question, not HOF"],
["/mlb/story/12550429/nats-strasburg-has-dislocated-knee-wont-need-surgery","Strasburg has dislocated knee, won\'t face knife"],
["/mlb/story/12550384/white-sox-close-to-deal-with-veteran-free-agent-vizquel","White Sox working on deal for shortstop Vizquel"],
["/mlb/story/12549823/cubs-sign-reliever-grabow-to-twoyear-contract","Cubs sign reliever Grabow to two-year contract"],
["/mlb/story/12549822/busy-indians-add-seven-players-to-40man-roster","Busy Indians add seven players to 40-man roster"],
["/mlb/story/12550436/rockies-promote-four-pitchers-one-catcher-from-minors","Rockies add four pitchers, one catcher from minors"]
);
var news_nhl = new Array (
["/nhl/story/12550372/thrills-spills-mark-seasons-quarter-pole","Thrills, spills mark season\'s quarter pole"],
["/nhl/story/12541688/waiver-wire-devils-going-greene","<b>Waiver Wire:</b> Devils going Greene"],
["/nhl/story/12546657/patient-approach-finally-paying-off-for-longsuffering-kings","Patient approach finally paying off for long-suffering Kings"],
["/nhl/gamecenter/recap/NHL_20091120_PHI@SJ/heatley-nets-second-hat-trick-this-season-as-sharks-rip-flyers","Heatley hits for hat trick as Sharks double up Flyers"],
["/nhl/gamecenter/recap/NHL_20091120_COL@VAN/canucks-score-five-straight-to-beat-avalanche-again","Canucks tally five unanswered to beat Avalanche"],
["/nhl/gamecenter/recap/NHL_20091120_FLA@DET/mccabe-tallies-early-in-overtime-to-lift-panthers-over-red-wings","McCabe lifts Panthers over Red Wings with goal in OT"],
["/nhl/gamecenter/recap/NHL_20091120_MON@WAS/canadiens-hold-off-hard-comeback-attempt-by-capitals","Canadiens hold off Capitals in comeback attempt"]
);
var news_cfo = new Array (
["/collegefootball/story/12549613/weekend-watch-list-dropoff-is-steeper-by-the-dozen","Weekend Watch List: Drop-off is steeper by the dozen"],
["/collegefootball/story/12549740/tonys-top-10-is-the-game-a-mustwin-for-rich-rod-squad","Tony\'s Top 10: Is The Game a must-win for Rich Rod?"],
["/collegefootball/story/12549740/tonys-top-10-is-the-game-a-mustwin-for-rich-rod-squad","Tony\'s Top 10: Is The Game a must-win for Rich Rod?"],
["/video/player/play/collegefootball/QVfsCCLjW01hp0RPmV_sOeKB0nrEDbqk","<b>Video:</b> Tillman previews LSU-Ole Miss"],
["/collegefootball/gamecenter/NCAAF_20091121_LSU@MS","<b>LSU at Ole Miss:</b> 3:30 p.m. ET Saturday on CBS"],
["/collegefootball/gamecenter/recap/NCAAF_20091120_BST@UTST/boise-state-stomps-utah-state-behind-martins-four-rushing-touchdowns","Boise State rolls behind Martin\'s four rushing touchdowns"],
["/collegefootball/story/12550203/georgia-tech-adds-another-year-to-coachs-contract","Georgia Tech adds year to Johnson\'s contract"]
);
var news_cba = new Array (
["/collegebasketball/gamecenter/recap/NCAAB_20091120_NC@SYR/syracuse-hammers-no-6-unc-to-win-coaches-vs-cancer-classic","Syracuse hammers No. 6 UNC to win Coaches vs. Cancer"],
["/collegebasketball/story/12549616/knight-to-return-to-indiana-for-hall-fundraiser","Knight to return to Indiana for Hall of Fame fund-raiser"],
["/collegebasketball/gamecenter/recap/NCAAB_20091120_OHST@CA/turners-doubledouble-helps-ohio-state-get-past-cal","Turner\'s double-double helps Ohio State get past Cal"],
["/collegebasketball/gamecenter/recap/NCAAB_20091120_GEOMAS@GATECH/jackets-hold-off-late-rally-by-george-mason-win-consolation-matchup","Georgia Tech fends off George Mason to win in P.R."],
["/collegebasketball/gamecenter/recap/NCAAB_20091120_DAY@NOVA/villanova-holds-off-dayton-in-second-round-of-tipoff","Villanova survives Dayton in second round of Tip-Off"],
["/collegebasketball/story/12550584/ucla-suspends-forward-dragovic-after-felony-assault-charge","UCLA suspends F Dragovic after felony assault charge"],
["/collegebasketball/story/12550873/sally-harrick-wife-of-former-ucla-coach-dies-at-70","Wife of former UCLA coach Harrick dies at 70"]
);
var news_gol = new Array (
["/golf/story/12547099/shotgun-start-clear-difference-of-opinion-on-barron-drug-ban","Shotgun Start: Clear difference of opinion on Barron ban"],
["/golf/story/12549372/westwood-takes-twoshot-lead-in-dubai-over-mcilroy-five-others","Westwood up two over McIlroy, five others in Dubai"],
["/golf/story/12550349/gustafson-closes-on-idle-ochoa-in-rainsoaked-lpga-championship","Gustafson closes on idle Ochoa in LPGA Championship"],
["/golf/story/12548000/japans-maeda-fires-65-moves-into-threeway-tie-for-lead-at-dunlop-phoenix","Maeda fires 65 to grab share of lead in Japan"],
["/golf/story/12547378/cook-browne-in-front-at-pebble-beach-invitational","Cook, Browne in front at Pebble Beach Invitational"],
["/golf/story/12547372/new-jerseys-sybase-classic-off-lpga-tour-schedule","New Jersey\'s Sybase Classic off LPGA Tour schedule"],
["/mcc/blogs/entry/6267041/18393380","<b>Elling:</b> Recent results seem to say all is groovy"]
);
var news_aut = new Array (
["/autoracing/story/12549881/hendrick-a-winner-regardless-of-what-happens-at-homestead","Hendrick a winner regardless of what happens at HMS"],
["/autoracing/story/12546283","<b>Pistone:</b> Track Talk podcast on Homestead"],
["/autoracing/story/12540954/play-the-hamlinkeselowski-feud-for-all-its-worth","Play the Hamlin-Keselowski feud for all it\'s worth"],
["/autoracing/story/12549643/cup-champ-johnson-signs-deal-to-stay-with-hendrick-through-2015","Johnson signs deal to stay with Hendrick until \'15"],
["/autoracing/story/12550427/gordon-i-want-to-keep-driving-for-hendrick-as-long-as-im-competitive","Gordon: I want to keep driving as long as I\'m competitive"],
["/autoracing/story/12550569/harvick-wins-season-finale-at-homestead-to-go-with-owners-title","Harvick wins Trucks\' season finale at Homestead"],
["/autoracing/story/12549818/uneasy-kahne-says-hell-explore-options-due-to-rpms-instability","Citing instability at RPM, Kahne to explore options"]
);
var news_ten = new Array (
["http://bleacherreport.com/articles/291132-mens-tennis-power-rankings-djokovic-gets-better-of-federer-and-nadal","Djokovic tops in Bleacher Report\'s Power Rankings"],
["/tennis/story/12550180/atp-says-it-wont-reopen-agassi-doping-case-since-hes-retired","ATP: No sanction for retired Agassi in doping case"],
["/tennis/story/12550260/nadal-im-in-perfect-shape-heading-into-seasonending-tourney","Nadal in \'perfect shape\' for season-ending tourney"],
["/tennis/story/12550269/del-potro-to-play-at-queens-club-in-2010-improve-grasscourt-game","Del Potro to play at Queen\'s, improve grass game"],
["/tennis/story/12536378/querrey-back-on-court-after-scary-cuts-to-right-arm","Querrey on mend, back on court after scary injury"],
["/tennis/story/12530276/nadal-leads-spain-in-davis-cup-against-czechs","Nadal leads Spain in Davis Cup against Czechs"],
["/tennis/story/12524728/wickmayer-malisse-launch-legal-counter-attack-on-wada","Suspended Wickmayer, Malisse taking WADA to court"]
);
var news_box = new Array (
["/boxing/story/12232607","Mayweather overwhelms smaller Marquez in return to ring"],
["/boxing/story/12232819","Mayweather on top of game ... Boxing? Different story"],
["/boxing/story/12248661","Mayweather agrees to pay $5.6M in back taxes"]
);
var news_cycl = new Array (
["/worldsports/story/10883546","Hincapie going to his fifth Olympics ... but Tour comes first"],
["/cycling/story/10744675","Italian cyclist Fois dead at 34; cause unknown"],
["/cycling/story/10724694","ASO announces teams for Tour; Astana out"],
["/cycling/story/2515896","Retroactive EPO testing welcomed"],
["/cycling/story/2507531","Climber Jimenez wins Tour of Catalunya"],
["/cycling/story/2505040","Armstrong leads USPS team for Tour"]
);
var news_spn = new Array (
["/spin/story/12285282","Hardy Vision: When is Meyer\'s next fairy-tale ending for Florida?"],
["/spin/story/12279094","Latest news"],
["/spin/story/12257872","Hardy Vision: Finally, \'Big Fan\' is the thinking fans\' sports flick"],
["/spin/story/12248478","PCS: Who\'s got the time to be a winner anymore?"],
["/spin/story/12242333","S.P.O.R.T.S. Cam: Survivors and other roles, don\'t miss the villain"],
["/spin/story/12216834","Sonny\'s Side: Worst Sports Video Games Ever"],
["/spin/story/12211427","PCS: When people speaking their minds have no brains"]
);
var news_oly = new Array (
["/olympics/story/10945782","Games close with elaborate ceremony, mixed legacy"],
["/olympics/story/12296295","Obama uses personal story to pitch Chicago"],
["/olympics/story/11072313","Report: China listed possible USA protestors"],
["/worldsports/story/10957699","Phelps to start swim foundation with $1M bonus"]
);
var news_soc = new Array (
["/soccer/story/12552537/ireland-says-rematch-request-has-fallen-on-deaf-ears","Ireland gives up hope of rematch with France"],
["/soccer/story/12550630/beckham-has-bone-bruise-but-expects-to-play-final","Beckham has bone bruise but expects to play final"],
["/soccer/story/12549806/fifa-suspends-iraq-for-political-meddling","FIFA suspends Iraq for political meddling"],
["/soccer/story/12546976/galaxys-donovan-named-mls-mvp-for-first-time","Galaxy\'s Donovan named MLS MVP for first time"],
["/soccer/story/12541393/uruguay-claims-last-spot-for-world-cup-after-aggregate-win-over-costa-rica","Uruguay becomes last nation to qualify for World Cup"],
["/soccer/story/12541155/slovenia-beats-russia-to-reach-world-cup-tournament","Slovenia upsets Russia to reach World Cup next year"],
["/soccer/story/12541171/greece-beats-ukraine-10-to-qualify-for-world-cup","Greece wins in Ukraine to qualify for World Cup"]
);
var news_mma = new Array (
["/mcc/blogs/view/5815454","Latest news"],
["/mma/story/12252567/success-of-ultimate-fighter-has-its-own-aftermath","<b>Martin:</b> Success of \'Ultimate Fighter\' yields \'Aftermath\'"],
["/mma/story/12243602/former-boxing-champ-mayorga-ready-to-try-mma","Former boxing champ Mayorga ready to try MMA"],
["/mma/story/12242977/former-football-star-herschel-walker-signs-with-strikeforce","Ex-NFL star Herschel Walker signs with Strikeforce"],
["/mma/story/12223127/strikeforce-returns-mixed-martial-arts-to-cbs","Strikeforce, Fedor returning to CBS on Nov. 7"],
["/mcc/blogs/entry/17064916/17220015","<b>TUF 10 Blog:</b> Jon Madsen discusses fight vs. Abe Wagner"],
["/mma/story/12211484/mitrione-seeks-transition-from-gridiron-to-cage","<b>Martin:</b> Mitrione seeks transition from gridiron to cage"]
);


CBSi.namespace('gn');

(function() {

    CBSi.gn.tt = new Array(
    	['NFL ','nfl',1],
    	['NFL Draft ','nfldraft',1],
    	['NBA ','nba',1],
    	['MLB ','mlb',1],
    	['NHL ','nhl',1],
    	['College Football ','cfo',1],
    	['College Basketball ','cba',1],
    	['Golf ','gol',1],
    	['Auto Racing ','aut',1],
    	['Tennis ','ten',1],
    	['World Cup ','soc',1],
        ['Soccer','soc',1],
    	['Olympics ','oly',1],
    	['SPiN ','spn',1],
    	['Cycling ','cyc',1],
    	['Boxing ','box',1],
    	['MMA ','mma', 1],
    	['Horse Racing ','horse',1],
        ['Brackets ','brackets',1],
        ['WNBA ','wnba',1],
        ['Women\'s Coll BK ','ncaawbasketball',1],                        
        ['World Sports ','worldsports',1],
    	['More Sports ','more',1]
        );

    CBSi.drop_down=function(){return;}

    CBSi.gn.isOver=false;
    CBSi.gn.timer=null;
    
    CBSi.gn.getMaxRight = function () {    
        CBSi.gn.maxRight = (window.innerWidth) ? 980 + ((window.innerWidth-985)/2)  : 
                           (document.documentElement && document.documentElement.clientWidth) ?  980 + ((document.documentElement.clientWidth-985)/2) : // IE6 with DOCTYPE
                           (document.body.clientWidth) ? 980 + ((document.body.clientWidth-985)/2) : 980; 
    }

    // showLayer
    CBSi.gn.showLayer = function (category,dropdown) {
        var getCoords=[100,155];

        CBSi.gn.HideAllLayers();
        CBSi.gn.getMaxRight();
        CBSi.gn.isOver = true;
        clearTimeout(CBSi.gn.timer);
        
        which_gn = "gn_" + category;
        which_dd = "dd_" + category;
        
        try {
            getCoords=whereami(which_gn); //YAHOO.util.Dom.getXY
        } catch(e) {}

        var theDiv = document.getElementById(which_dd);
        if (theDiv) {
			theDiv.style.top=getCoords[1]+21;
			theDiv.style.left=getCoords[0];
			
			if (theDiv.className == 'cmNOnews') {
				if ((getCoords[0]+120) > CBSi.gn.maxRight) {
					theDiv.style.left=CBSi.gn.maxRight-120;
				}
			} else  {
				 if ((getCoords[0]+430) > CBSi.gn.maxRight) {
					theDiv.style.left=CBSi.gn.maxRight-430;
				}
			}
			
			theDiv.style.visibility='visible';
		}
    	return;
    }
    
    
    // hideAllLayers
    CBSi.gn.HideAllLayers = function() { 
        if (!CBSi.gn.isOver) {
           	var divTemp = document.getElementsByTagName('div');
        	for (i = 0; i < divTemp.length; i++) { 
        		var divString = new String(divTemp[i].id);
        		if (divString.indexOf('dd_') != -1) {
                    divTemp[i].style.visibility = 'hidden';
                }
        	}
        }
    }
    

    // outLayer
    CBSi.gn.hide = function() {
        clearTimeout(CBSi.gn.timer);
        CBSi.gn.isOver = false; 
        CBSi.gn.timer = setTimeout("CBSi.gn.HideAllLayers()",300);
    }
    
    CBSi.gn.show = function() {
        clearTimeout(CBSi.gn.timer);
        CBSi.gn.isOver = false; 
        }
    
    CBSi.gn.buildHeadlines = function() {
        var newsLI = '&nbsp;<b>&#183;</b>&nbsp;';
        var divName='hl_nfl';
    
        for ( i=0 ; i<CBSi.gn.tt.length-1 ; i++ ) {
            if (CBSi.gn.tt[i][2]==false) continue;
            var news = eval('news_' + CBSi.gn.tt[i][1]);
            divName = 'hl_' + CBSi.gn.tt[i][1];
            if (document.getElementById(divName)){
                var html='';
                html+= '<div class="cmH">&nbsp;' +CBSi.gn.tt[i][0] +'News</div>';
                
                /* Write News */
                if (news.length!=0) {
                	for ( j = 0 ; j < news.length ; j++ ) {
                		var linkString = new String(news[j][0]);
                		if ( (linkString.indexOf('http:') == -1) && (linkString.indexOf('javascript') == -1) ) news[j][0] = "http://www.cbssports.com" + news[j][0];
                		if (j < 7) {
                            html += newsLI +'<a href="' +news[j][0] +'">' +news[j][1] +'</a><br>';
                        }
                	}
                           
                }
                document.getElementById(divName).innerHTML = html;         
            }
        }
    }
})();

CBSi.gn.buildHeadlines();

