


function HomePageController(){
    this.pageLoader = null;
}
HomePageController.prototype.register = function(pageLoader){
    this.pageLoader = pageLoader;
    this.pageLoader.registerPageController(this);
    //this.pageLoader.registerScript("/scripts/HHA2007/shared/AnotherScript.js");
}
HomePageController.prototype.setPageLoader = function(loader){
    this.pageLoader = loader;
}
HomePageController.prototype.onLoad = function(){
    //Hilight current link in left navigation
    //var path = location.pathname.substring(1);
    //$('#primaryNavigation a[@href$="' + path + '"]').addClass('selected');
    
    //var path = location.pathname.substring(1);
    //if(path.toLowerCase().indexOf("/nominees") > -1){
	//	alert("is nominees");
    //}
    
    var path = location.pathname.substring(1).toLowerCase();
    path = path.replace("www.bet.com/", "");
    var primaryNavDiv = document.getElementById("primaryNavigation");
    if(primaryNavDiv){
		var navItems = getElementArrayByTagName(primaryNavDiv, "a", true);
		for(var i=0; i<navItems.length; i++){
			var item = navItems[i];
			var href = item.href.toLowerCase();
			if(href.indexOf(path) > -1){
				overrideColor(item, "#eac64c");
				break;
			}
		}
    }

    
    
    
    var divs_to_make_links = $(".whatsHotList div");
	for(i=0; i<divs_to_make_links.length; i++){
		var current_div = divs_to_make_links[i];
		if(setOnClickFromFirstHref(current_div)){
		
			/*
			$(current_div).hover(
				function () {
					//$(this).addClass("hover");		// <- this doesn't work in ie6
					var actionLink = getFirstElementByTagNameAndClassName(this, "a", "actionLink", false)
					if(actionLink){
						overrideColor(actionLink, "#eac64c");
						overrideBackgroundImageUrl(actionLink, "/WebApplications/betRoot/images/HHA2007/ReadMoreLink_BG_HL.gif");
					}
				},
				function () {
					//$(this).removeClass("hover");		// <- this doesn't work in ie6
					var actionLink = getFirstElementByTagNameAndClassName(this, "a", "actionLink", false)
					if(actionLink){
						removeOverrideColor(actionLink);
						removeOverrideBackgroundImageUrl(actionLink);
					}
				}
			);
			*/
		
		}
	}

	
	// this is needed for IE6
	$(".whatsHotList .actionLink").hover(
		function () {
			//$(this).addClass("hover");		// <- this doesn't work in ie6
			overrideColor(this, "#eac64c");
			overrideBackgroundImageUrl(this, "/WebApplications/betRoot/images/HHA2007/ReadMoreLink_BG_HL.gif");
		},
		function () {
			//$(this).removeClass("hover");		// <- this doesn't work in ie6
			removeOverrideColor(this);
			removeOverrideBackgroundImageUrl(this);
		}
	)
    
     
     // this is needed for IE6
	$(".whatsHotList p").hover(
		function () {
			this.style.textDecoration='underline'; 
		},
		function () {
			this.style.textDecoration='none';
		}
	)
    
    
    //sub_list
 
    //var widgetDiv = $('#countdownWidgetDiv');	// this returns an array, not a sing object
    //var widgetDiv = document.getElementById("countdownWidgetDiv");
    //if(widgetDiv){
	//	widgetDiv.onclick = function(){ document.location ="http://www.bet.com/HHA/hha-widgets"; };
    //}

    // get list of article divs and atach controllers
    
    // add behaviors left menu stuff
    //$(".sublist_holder").click( function(){ ($(this).children('ul')).slideToggle('slow'); } );
    /*
    $(".sublist_holder").hover( function()
                                    { 
                                        ($(this).children('ul')).slideToggle('slow');
                                         $("b").html("[-]");
                                    }, 
                                    function()
                                        { 
                                            ($(this).children('ul')).slideToggle('slow');
                                            $("b").html("[+]")
                                        } 
                                    );
    */
    // add behaviors for barkerBlockLists
    var barkerBlockListsController = new BarkerBlockListsController();
    barkerBlockListsController.initialize();
   
}



if(typeof(_pageLoader) != "undefined" && _pageLoader != null){ 
    var _homePageController = new HomePageController();
    _homePageController.register(_pageLoader);
}


function goToHome()
{
	window.location.href="http://www.bet.com/HHA";
}



