setHomeBg = function(){
	
	$('#background_img').hide();
	
	/*$('#new_home_list a').hover();*/
	
	/* ========  Rollovers */
	
	$('#new_home_list li').hover(function () {
		if($(this).hasClass('white')){
			$(this).find('div.entry_promo_img').hide();
			$(this).find('a').show();
			$(this).css({'cursor':'pointer'});
		}else{
    		$(this).css({'background-position': '0 -920px', 'cursor':'pointer'});

		}
 	}, function () { 
		if($(this).hasClass('white')){
			$(this).find('div.entry_promo_img').show();
			$(this).find('a').hide();
			$(this).css({'cursor':'auto'});
		}else{
    		$(this).css({'background-position': '0 0', 'cursor':'auto'});
		} 
  	}).click(function() {
		window.location = $(this).find('a:first').attr('href');
		return false;	
	});
	
	
	/* ========  Carousel */
	
	//if($('#new_home_list').hasClass('cycle_disabled')){
		/*
		if($('#new_home_list li:first').hasClass('white')){
			$('#master').addClass('page_product_promo');								   
		};*/
		//
		if($('#new_home_list li:first div.entry_bg_img').hasClass('Green')){
			$('img#logo').attr('src','/images/almo-office-logo-black.png');
			$('img#footer_logo').attr('src','/images/almo-office-logo-small-black.png');
			$('#master').addClass('page_promo_green');
		};
		if($('#new_home_list li:first div.entry_bg_img').hasClass('Red')){
			$('img#logo').attr('src','/images/almo-office-logo-black.png');
			$('img#footer_logo').attr('src','/images/almo-office-logo-small-black.png');
			$('#master').addClass('page_promo_red');
		};
		if($('#new_home_list li:first div.entry_bg_img').hasClass('Blue')){
			$('img#logo').attr('src','/images/almo-office-logo-black.png');
			$('img#footer_logo').attr('src','/images/almo-office-logo-small-black.png');
			$('#master').addClass('page_promo_blue');
		};
		if($('#new_home_list li:first div.entry_bg_img').hasClass('Yellow')){
			$('img#logo').attr('src','/images/almo-office-logo-black.png');
			$('img#footer_logo').attr('src','/images/almo-office-logo-small-black.png');
			$('#master').addClass('page_promo_yellow');
		};
		//
		$bgimg = 'url('+$('#new_home_list li').children('.entry_bg_img').html()+')';
		$('body').css('background-image', $bgimg);
		//$('#background_img').css('background-image', $bgimg);
		//$('#background_img').show();
	/*}else{
		$('#new_home_list').cycle({
			fx: 'fade',
			before: function(){
				if($(this).hasClass('white')){
					$('#master').addClass('page_product_promo');								   
				}else{
					$('#master').removeClass('page_product_promo');		
				};
				$bgimg = 'url('+$(this).children('.entry_bg_img').html()+')';
				$('#background_img').css('background-image', $bgimg);
				$('#background_img').fadeIn('slow');
			},
			end: function(){
				$('#background_img').css('background-image', 'none');
				$('#background_img').hide();
			},
			timeout: 10000
		});
	}*/
	
};

$(document).ready(function(){
	
	if('div#background_img'){
		setHomeBg();
	};
	
});
