/*Revision 1.0.2 */

    /* Ajax Game page refresh */
    var gameBoxScoreURL = document.URL;
    var gameBoxScoreArray = gameBoxScoreURL.split('/');
    var gameCodeString = gameBoxScoreArray[6];
    var gameCode = null;
    if (gameCodeString != null){
        gameCode = gameCodeString.split('?');
    }
    var intervalId = null;
	var ajaxChecker = "on";
	var ajaxCheckerGamepages="on";
	var multiBox=multiPrev=multiPlay=multiRecap=0;
	
	//buy tickets link

	function appendGcidToStubUrl(obj, gcid)

	{
	
	  if(obj.href.match("gcid") == null){
		
			var location = obj.href;
			obj.href=obj.href+"/"+gcid;
			
			obj.onmouseover = function(){
			
				this.href = location;
			
			}
			
			obj.onmouseout = function(){
			
				this.href = location;
			
			}

		}		
	}

// Ad Refresh on Image Change

 var AdRefresh = function(adSpot) {

    try {
        if (adSpot != null && adSpot != 'undefined' && adSpot != '') {
            top.ch_refresher.refresh_ads_by_spot(adSpot);
        }
    } catch(e) {}
    return true;
};

var refreshGame = function (divContainer, gameCode, pageRefresh, appendParam){
    if(p_o(arguments[0]) != null){
			        $.ajax({
					url: "/"+ pageRefresh+"?gameCode=" + gameCode+ appendParam,
					type: 'POST',
					dataType: 'html',
					success: function(html){
								$('#'+divContainer).empty().append(html);
							}
				});
            }
};
var refreshGameForScores = function (divContainer, pageRefresh, appendParam){
    if(p_o(arguments[0]) != null){
            $.ajax({
					url: "/"+ pageRefresh+ appendParam,
					type: 'POST',
					dataType: 'html',
					success: function(html){
								$('#'+divContainer).empty().append(html);
							}
				});
            }
};
var refreshOnload = function(loadObj){
    /* Ajax request for Boxscore summary/gameview */
    clearInterval(intervalId);
    switch (loadObj.id){
        case 'pBpshow.0':
            refreshGame('pBpContainer', gameCode[0], 'game/playbyplay', '');
            if (document.getElementById("pBpContainer")){intervalId = setInterval("refreshGame('pBpContainer', "+gameCode[0]+", 'game/playbyplay', '')",30000);}
        break;
        default:
        var pBpshow = loadObj.id.split(".");
            if (pBpshow[1] != null){
                clearInterval(intervalId);
                refreshGame('pBpContainer', gameCode[0], 'game/playbyplay', '&mode='+pBpshow[1]); 
				if (document.getElementById("tOff") && document.getElementById("tOn") ){
					if (document.getElementById("pBpContainer")){intervalId = setInterval("refreshGame('pBpContainer', "+gameCode[0]+", 'game/playbyplay','&mode="+pBpshow[1]+"')",30000);}
				}
			}
        break;
        }
    };

var F;
var browser=navigator.appName;
var ie ='Microsoft Internet Explorer';


var LoadCalendar = function(){
$('#month0,#month1,#month3,#month4,#month5').datePicker({
    createButton:false,
    showYearNavigation:false,
    verticalOffset:"25px",
    horizontalOffset:"0px",
    showHeader:false,
    setDisplayedMonth:false,
    startDate:'01/01/2007',
    displayClose: true
}).css('cursor','pointer').bind('mouseover', function(){
        $(this).addClass('divToggle');
}).bind('mouseout', function(){
        $(this).removeClass('divToggle');
}).bind('click', function(){
            //debugger;
            //$(this).dpSetDisplayedMonth($(this).attr("value"), myYear($(this).attr("value")));
            var month = 1;
            var year = 2008;

            if(document.getElementById("filterDate")){
                    var monthStr = document.getElementById("filterDate").value.split('/')[0];
                    if(monthStr.substring(0,1) == '0'){
                            monthStr=monthStr.substring(1,2);
                            }
                    var yearStr = document.getElementById("filterDate").value.split('/')[2];
                    month = parseInt(monthStr);
                    year = parseInt(yearStr);

            }
            month-=1;
            $(this).dpSetDisplayedMonth(month, year);
            $(this).dpDisplay();
            $("a.dp-nav-next-month")[0].innerHTML = "Next&nbsp;&gt;";
            $("a.dp-nav-prev-month")[0].innerHTML = "&lt;&nbsp;Prev";
            this.blur();
            return false;
    }
    ).bind('dateSelected',
function(e, selectedDate, $td)
        {
                var slctDate = selectedDate;
                Date.format = "mm/dd/yyyy";
                slctDate = slctDate.asString();
                if(document.getElementById("filterDate")){
                        document.getElementById("filterDate").value = slctDate;
                        var dateStr = document.getElementById("filterDate").value.split("/");
                        document.location="/scores-and-schedules/"+dateStr[2]+dateStr[0]+dateStr[1]+document.location.search;
                    }
                return(false);
        }
    ).bind('blur',function(){$(this).dpClose();return(false);});
    };
 /**
 * Check expanded state of the search options - playerSearchResults.
 * @return {Boolean} isExp
 */
var checkExpanded = function(){
                var isExp = false;
                if($(".expand").length > 0){
                        if($(".expand")[0].style.display == "inline" || $(".expand")[0].style.display == "block"){
                                isExp = true;
                        }else{
                                isExp = false;
                        }
                }
                return isExp;
};

/**
 * Collapse or expand search options based on expanded state via checkExpaned()
 * go through elem[].  If any elem does not have a classname of "visible" then
 * toggle the elem to a hidden state.
 * Also toggle the expand an collapse links to the opposite of whatever the are.
 * @param {Array} elem
 * @see checkExpaned()
 */
var searchCollapseExpand = function(elem){
        var isExpanded = checkExpanded();
        $.each(elem, function(i, n){
                if((n).className.indexOf("visible") == -1)
                {
                        $(n).toggle();
                }
        });
        $(".expand").toggle();
        $(".collapse").toggle();
};
var autoUpdate=false;
/* onload functions */
onload = function() {
	if (document.getElementById("tOff") && document.getElementById("tOn") ){
		autoUpdate=true;
	}
    /**
        Loads popup calendar
    */
            LoadCalendar();
    // initialize table sorter for specificied tables
	$(".league .sortable thead tr th").click(function(){
		$(".league .sortable tbody tr.split").removeClass("split");
	});

	$(".league .sortable").tablesorter({
        headers:{0:{sorter:false},4:{sorter:false},5:{sorter:false},6:{sorter:false},7:{sorter:false},8:{sorter:false},9:{sorter:false},10:{sorter:false},11:{sorter:false},12:{sorter:false},13:{sorter:false}}
    });
	$(".division .sortable").tablesorter({
        headers:{0:{sorter:false},5:{sorter:false},6:{sorter:false},7:{sorter:false},8:{sorter:false},9:{sorter:false},10:{sorter:false},11:{sorter:false},12:{sorter:false},13:{sorter:false},14:{sorter:false}}
    });
    $(".trnsctions .sortable").tablesorter({
        headers:{2:{sorter:false}}
    });
    $(".stats .sortable").tablesorter({
    	headers:{0:{sorter:false},1:{sorter:false}}
    });
    $(".gameLog .sortable").tablesorter({
        headers:{0:{sorter:false}}
    });
    $(".splitStats .sortable").tablesorter({
        headers:{0:{sorter:false}}
    });
    $(".sitStats .sortable").tablesorter({
        headers:{0:{sorter:false}}
    });
    $(".careerStats .sortable").tablesorter({
        headers:{0:{sorter:false}}
    });
	$(".roster .sortable").tablesorter({
    	headers:{3:{sorter:false},4:{sorter:false},5:{sorter:false},7:{sorter:false}}
    });
    $(".plyrSearch .sortable").tablesorter({
    	headers:{}
    });
    $(".plyrStats .sortable").tablesorter({
    	headers:{}
    });
    $(".teamStats .sortable").tablesorter({
    	headers:{}
    });

/**
    Actions for Basic Expanded v. Divions Standings toggle
*/
$(".fltrOptns #bscFltr").addClass("selected");
$('#bscFltr').bind("click", function(){
    if (browser == ie){
        $('table').find('.statPrim').css('display', 'block');
    }else{
        $('table').find('.statPrim').css('display', 'table-cell');
    }
    $('table').find('.statSec').css('display', 'none');
    $('table').find('.statTert').css('display', 'none');
    $(".fltrOptns a").removeClass("selected");
    $(".fltrOptns #bscFltr").addClass("selected");

});

$('#expdFltr').bind("click", function(){
    $('table').find('.statPrim').css('display', 'none');
    if (browser == ie){
        $('table').find('.statSec').css('display', 'block');
    }else{
        $('table').find('.statSec').css('display', 'table-cell');}
    $('table').find('.statTert').css('display', 'none');
    $(".fltrOptns a").removeClass("selected");
    $(".fltrOptns #expdFltr").addClass("selected");
});

$('#vsDvsion').bind("click", function(){
    $('table').find('.statPrim').css('display', 'none');
    $('table').find('.statSec').css('display', 'none');
    if (browser == ie){
        $('table').find('.statTert').css('display', 'block');
    }else{
    $('table').find('.statTert').css('display', 'table-cell');
    }
	$(".fltrOptns a").removeClass("selected");
    $(".fltrOptns #vsDvsion").addClass("selected");
});

/* NBA Player Profile Statistical comparison widget events */
$("#s1").click( function() {
	$("#playerComp table").css('display','none');
	$("#tab1").css('display', 'table');
	$("#playerComp a").removeClass('plyrCompOn');
	$("#s1").addClass('plyrCompOn');
});
$("#s2").click( function() {
	$("#playerComp table").css('display','none');
	$("#tab2").css('display', 'table');
	$("#playerComp a").removeClass('plyrCompOn');
	$("#s2").addClass('plyrCompOn');
});
$("#s3").click( function() {
	$("#playerComp table").css('display','none');
	$("#tab3").css('display', 'table');
	$("#playerComp a").removeClass('plyrCompOn');
	$("#s3").addClass('plyrCompOn');
});
$("#s4").click( function() {
	$("#playerComp table").css('display','none');
	$("#tab4").css('display', 'table');
	$("#playerComp a").removeClass('plyrCompOn');
	$("#s4").addClass('plyrCompOn');
});
/* NBA Team Roster events */
$(".rosterFltr #teams").bind("change", function() {
    F=this.form;
        if (F.teams.value ==''){return false;}
    F.action=F.action+'/'+ F.teams.value +'/roster/';
    window.location=F.action;
});
/* NBA Team Stats events */
$(".teamStatsFltr #teams").bind("change", function() {
    F=this.form;
        if (F.teams.value ==''){return false;}
    F.action=F.action+'/'+ F.teams.value +'/stats/';
    window.location=F.action;
});
/* NBA Team Injuries & Transactions events */
$(".injTransFltr #teams").bind("change", function() {
    F=this.form;
        if (F.teams.value ==''){return false;}
    F.action=F.action+'/'+ F.teams.value +'/injuries-and-transactions/';
    window.location=F.action;
});
/* NBA Schedule events */
$(".teamSchedFltr #calFltr #month, .teamSchedFltr #calFltr #team, .teamSchedFltr #lstFltr #month, .teamSchedFltr #lstFltr #team").bind("change", function() {
    F=this.form;
        if (F.team.value ==''){return false;}
        if (F.id == 'calFltr'){F.action=F.action+'/'+ F.team.value +'/schedule?view=cal&month='+F.month.value;}
        else{F.action=F.action+'/'+ F.team.value +'/schedule?month='+F.month.value;}
        window.location=F.action;

});
$(".teamSchedFltr #calView").bind("click", function() {
        var F = document.getElementById('lstFltr');
        if (F.team.value ==''){return false;}
        F.action=F.action+'/'+ F.team.value +'/schedule?view=cal&month='+F.month.value;
        window.location=F.action;
});
$(".teamSchedFltr #lstView").bind("click", function() {
        var F = document.getElementById('calFltr');
        if (F.team.value ==''){return false;}
        F.action=F.action+'/'+ F.team.value +'/schedule?month='+F.month.value;
        window.location=F.action;
});
/* NBA Team Scores events */
$(".teamScoresFltr #month, .teamScoresFltr #team").bind("change", function() {
        F=this.form;
        if (F.team.value ==''){return false;}
        F.action=F.action+'/'+ F.team.value +'/scores?month='+F.month.value;
        window.location=F.action;
});

/* Prev/Next Form Actions for Calendar Schedule */
$("#prvMonth").bind("click", function() {
var F=document.getElementById('calMonthSched');if(F.month.value == 1) F.month.value = 12; else F.month.value=(F.month.value*1)-1; F.action=F.action+'/'+ $("#team").val() +'/schedule?view=cal';F.submit();
});
$("#nxtMonth").bind("click", function() {
var F=document.getElementById('calMonthSched');if(F.month.value == 12) F.month.value = 1; else F.month.value=(F.month.value*1)+1; F.action=F.action+'/'+ $("#team").val() +'/schedule?view=cal';F.submit();
});

/* Bind Transaction/Injury events to filter form */

$(".trnsctionsFltr #team, .injrysFltr #team, .trnsctionsFltr #month").bind("change", function() {
    F=this.form;F.submit();
});


/* Player search text field clears out on focus */
$("#plyrSrch, #playerNameQuery").bind("focus", function () {
if (this.value=='Enter Player Name'){this.value='';this.style.color='#000';}else{this.style.color='#000';this.style.border='1px solid #7F9DB9';}
});

$(".gmtvcov").bind("mouseover", function () {
    var day = "#"+this.id;
    $(day).next(".tvLstng").css('display', 'block');
});
$(".gmtvcov").bind("mouseout", function () {
    $(".tvLstng").css('display', 'none');
    });

/* View Stats form Search Submision*/
$("#viewStats").bind("click", function(){
        F=this.form;
	    var dt=F.season;
		var sesonval = F.season.value;
		var vals = sesonval.split(" ");

        if (F.category.value ==""){
         alert("Please Select a Category From the Filter");
         return false;
        }
	
  if (F.group.value =="team"){
	
        if(vals[1]=='Post'){
			F.action=F.action+"/"+vals[0]+"?league="+F.league.value+'&subCategory='+F.category.value+"&group="+F.group.value+"&seasonType=postseason";
		}else{
			F.action=F.action+"/"+vals[0]+"?league="+F.league.value+'&subCategory='+F.category.value+"&group="+F.group.value+"&seasonType=regular";
		}
    } else {
        
		if(vals[1]=='Post'){
        F.action=F.action+"/"+vals[0]+"?position="+F.position.value+'&league='+F.league.value+'&subCategory='+F.category.value+"&group="+F.group.value+"&seasonType=postseason";
		}else{
		F.action=F.action+"/"+vals[0]+"?position="+F.position.value+'&league='+F.league.value+'&subCategory='+F.category.value+"&group="+F.group.value+"&seasonType=regular";
		}
   }
	document.location=F.action;return true;
});

/*Enable or disable Position dropdown*/
$("#group").bind("change", function(){
    F=this.form;

    if (F.group.value =="team"){
        F.position.disabled = true;
    } else {
        F.position.disabled = false;
    }
});

/* Team Stats select actions */
$("#activity").bind("change", function () {
F=this.form;F.action=F.action+'/'+ F.teams.value +'/stats?activity=' + this.value;F.submit();
});

/* Validate and submit player search */
$("#srchPlyrs").bind("click", function(){
F=this.form;if(F.playerNameQuery.value =="Enter Player Name" || F.playerNameQuery.value ==""){$("#playerNameQuery").css("border","1px solid #C90202");$("#playerNameQuery").css("color","#C90202");$("#playerNameQuery").val("Enter Player Name");$("#errorEval").text("Please Enter a Name to Search");return false;}else{F.submit();}
});

$("#selectroster").bind("change", function () {
document.location = this.value;
});

/* Player Profile Split stats season filter */
$("#selectseason").bind("change", function() {
document.location = document.location.pathname + "?selectedTab=splitStats&season=" + this.value + "#statsNav";
});
/* Player Profile gamelog season filter */
$("#selectseasongame").bind("change", function() {
document.location = document.location.pathname + "?selectedTab=gameLog&season=" + this.value + "#statsNav";
});

/* Events for Scores and Schedules */
$(".scoresSchedFltr #filterDate").bind("keypress", function (e) {

    if (e.which == 13){
    F=this.form;
	var dt=F.filterDate;
	if (isDate(dt.value)==false){
		dt.focus();
		return false;
	}
         if (F.name == 'slctDate'){
             F.action=F.action+"/"+dateFrmtURL;F.submit();return true;
         }
         }
});

/* Events for Standings Filter */
$(".stndngsFltr #breakdown").bind("change",function(){
    F=this.form;F.action=F.action+"?date="+F.season.value+"&breakdown="+F.breakdown.value;F.submit();return true;
});
$(".stndngsFltr #season").bind("change",function(){
    F=this.form;F.action=F.action+"?date="+F.season.value+"&breakdown="+F.breakdown.value;F.submit();return true;
});

    /** look for a collapse-able container on the Player search page */
    if($("form.canCollapse").length)
    {
            $(".expand").toggle();
            searchCollapseExpand($(".plyrSearch form div"));
    }

    /** bind click to collapse link */
    $(".collapse").bind("click", function(){
            searchCollapseExpand($(".plyrSearch form div"));
            return false;
    });

    /**  bind click to expand link */
    $(".expand").bind("click", function(){
            searchCollapseExpand($(".plyrSearch form div"));
            return false;
    });
$("#customBox").css({left:"20px"});
/* Initialize Ajax request for Game Boxscore */
if (autoUpdate){
         if (document.getElementById("gameBoxScore")){			
              intervalId = setInterval("refreshGame('gamesPreviewTable', "+gameCode[0]+", 'game/boxscore', '')",30000);
              $("#tOn").addClass("on");
              $("#smryVw").addClass("selected");
                  $("#tOn").bind("click", function(){
					if (ajaxCheckerGamepages =="off"){					
                    refreshGame('gamesPreviewTable', gameCode[0], 'game/boxscore', '');
                    intervalId = setInterval("refreshGame('gamesPreviewTable', "+gameCode[0]+", 'game/boxscore', '')",30000);
                    $("#tOff").removeClass("on");
                    $("#tOn").addClass("on");
					ajaxCheckerGamepages="on";
					}

                 });
		
             }
/* Initialize Ajax request for Game PlayByPlay */
         if (document.getElementById("pBpContainer"))
             {
			   intervalId = setInterval("refreshGame('gamesPreviewTable', "+gameCode[0]+", 'game/playbyplay', '')",30000);
               $("#tOn").addClass("on");
               $("#tOn").bind("click", function(){
				if (ajaxCheckerGamepages =="off"){
				refreshGame('gamesPreviewTable', gameCode[0], 'game/playbyplay', '');
                 intervalId = setInterval("refreshGame('gamesPreviewTable', "+gameCode[0]+", 'game/playbyplay', '')",30000);
                    $("#tOff").removeClass("on");
                    $("#tOn").addClass("on");
				ajaxCheckerGamepages="on";
				}
                 });
		
         }
}
 /* Initialize Ajax request for Score & Schedule page */
        if (document.getElementById("scoresSched")){
			intervalId = setInterval("refreshGameForScores('scoresSched','boxscore', '?date="+gameDate+"&histSeason="+histSeason+"')",30000);
               $("#tOn").addClass("on");
               $("#tOn").bind("click", function(){
				if (ajaxChecker=="off"){
                 refreshGameForScores('scoresSched', 'boxscore', '?date='+gameDate+'&histSeason='+histSeason);
                 intervalId = setInterval("refreshGameForScores('scoresSched','boxscore', '?date="+gameDate+"&histSeason="+histSeason+"')",30000);
                    $("#tOff").removeClass("on");
                    $("#tOn").addClass("on");
					ajaxChecker="on";
					 }

                 });
        }
         /* Turn Ajax off */
         $("#tOff").bind("click", function(){
		 if (ajaxChecker=="on" || ajaxCheckerGamepages =="on"){
         clearInterval(intervalId);
             $("#tOn").removeClass("on");
             $("#tOff").addClass("on");
			 ajaxChecker="off";
			 ajaxCheckerGamepages="off";
			 }
         });
         /* Ajax requests for tabbed game pages */
         $("#aPreview").bind("click", function(){
				   if (multiPrev ==0){
					  AdRefresh('300x250_1');
					  clearInterval(intervalId);
					  $("#tabSection").find("a").removeClass("selected");
					  $("#tabSection").find("a").addClass("active");
					  $("#tabSection").find("#aPreview").addClass("selected");
					  $(".timerControl").css('display','none');
					  refreshGame('gamesPreviewTable', gameCode[0], 'game/preview', '');
					  multiPrev++;
					  multiPlay=multiBox=multiRecap=0;
					}
            });
         $("#aBox").bind("click", function(){
					if ($(".timerControl").css('display') == 'none') {$(".timerControl").css('display','block');}				  	
					   if (multiBox ==0){
								  AdRefresh('300x250_1');
								  clearInterval(intervalId);
								  $("#tabSection").find("a").removeClass("selected");
								  $("#tabSection").find("a").addClass("active");
								  $("#tabSection").find("#aBox").addClass("selected");
								  $("#tOn").unbind("click");
								  $("#tOn").bind("click", function(){
								  if (ajaxCheckerGamepages =="off"){
									refreshGame('gamesPreviewTable', gameCode[0], 'game/boxscore', '');
									intervalId = setInterval("refreshGame('gamesPreviewTable', "+gameCode[0]+", 'game/boxscore', '')",30000);
									$("#tOff").removeClass("on");
									$("#tOn").addClass("on");
									ajaxCheckerGamepages="on";
									}
								  });
								  refreshGame('gamesPreviewTable', gameCode[0], 'game/boxscore', '');
								  if (autoUpdate){
										 if (document.getElementById("pBpContainer")){intervalId = setInterval("refreshGame('gamesPreviewTable', "+gameCode[0]+", 'game/boxscore', '')",30000);}
										 if($(".previewStory").html() != null){
												intervalId = setInterval("refreshGame('gamesPreviewTable', "+gameCode[0]+", 'game/boxscore', '')",30000);
										}
								  }		
						multiBox++;
						multiPlay=multiPrev=multiRecap=0;
						}
            });
         $("#aPlay").bind("click", function(){
			 if ($(".timerControl").css('display') == 'none') {$(".timerControl").css('display','block');}
                  if (multiPlay ==0){
						  AdRefresh('300x250_1');
						  clearInterval(intervalId);
						  $("#tabSection").find("a").removeClass("selected");
						  $("#tabSection").find("a").addClass("active");
						  $("#tabSection").find("#aPlay").addClass("selected");
						  $("#tOn").unbind("click");
						  $("#tOn").bind("click", function(){
						 if (ajaxCheckerGamepages =="off"){
							 clearInterval(intervalId);
							 refreshGame('gamesPreviewTable', gameCode[0], 'game/playbyplay', '');
							 intervalId = setInterval("refreshGame('gamesPreviewTable', "+gameCode[0]+", 'game/playbyplay', '')",30000);
							$("#tOff").removeClass("on");
							$("#tOn").addClass("on");
							ajaxCheckerGamepages="on";
							}
						 });
						  refreshGame('gamesPreviewTable', gameCode[0], 'game/playbyplay', '');
						  if (autoUpdate){
								  if (document.getElementById("gameBoxScore")){
								  intervalId = setInterval("refreshGame('gamesPreviewTable', "+gameCode[0]+", 'game/playbyplay', '')",30000);
								  }
								if($(".previewStory").html() != null){
									intervalId = setInterval("refreshGame('gamesPreviewTable', "+gameCode[0]+", 'game/playbyplay', '')",30000);
								}
						  }
						multiPlay++;
						multiBox=multiPrev=multiRecap=0;
					}
            });
         $("#aRecap").bind("click", function(){
					if (multiRecap ==0){
					  AdRefresh('300x250_1');
					  clearInterval(intervalId);
					  $("#tabSection").find("a").removeClass("selected");
					  $("#tabSection").find("a").addClass("active");
					  $("#tabSection").find("#aRecap").addClass("selected");

					  refreshGame('gamesPreviewTable', gameCode[0], 'game/recap', '');
					  multiRecap++;
					  multiBox=multiPrev=multiPlay=0;
					 }
		});

            $(".dblhdrLnk").bind("click", function(){
                var dblHdrId= this.id.split("_");
                    $("#game_"+dblHdrId[1]+"_1").css('display', 'none');
                    $("#game_"+dblHdrId[1]+"_2").css('display', 'block');

            });
             $(".dblhdrLnk2").bind("click", function(){
                var dblHdrId= this.id.split("_");
                    $("#game_"+dblHdrId[1]+"_2").css('display', 'none');
                    $("#game_"+dblHdrId[1]+"_1").css('display', 'block');

            });

        };
var sports3 = {
   toggleMenu:function(e){
      if (!e) e = window.event;
      var cObj = e.srcElement || e.target
      pNode = cObj.parentNode;;
      if(pNode.className == 'hideMenu'){
         pNode.className = '';
      }else if(pNode.className == ''){
         pNode.className = 'hideMenu';
      }
      return false;
   },
   addLoadEvent:function(func) {
      var oldonload = window.onload;
      if (typeof window.onload != 'function') {
          window.onload = func;
      } else {
         window.onload = function() {
            oldonload();
            func();
         }
      }
   },
   onload:function(){
      $("#leftNav .listHead").click(sports3.toggleMenu);
   }
}
sports3.addLoadEvent(sports3.onload);
