    var active_category = 0;
  	$('a.category-link').each(function(){
  		$(this).mouseover(function(){
  			rotator_mouse_over = true;
  		});
  		$(this).mouseout(function(){
  			rotator_mouse_over = false;
  		});
  		$(this).click(function(){
  			if (active_category != this.id.substr(9)) 
  			{
				if (rotator_mouse_over == true) 
				{
					clearInterval(rotator_interval);
				}
 				$('a#category-'+active_category).removeClass('active');
  				$(this).addClass('active');
  				$('div#rotator-category-' +active_category).css({display: 'none'})
  				$('div#rotator-button-category-' +active_category).css({display: 'none'})
	  			active_category = this.id.substr(9);
  				$('div#rotator-category-' +active_category).css({display: 'block'})
  				$('div#rotator-button-category-' +active_category).css({display: 'block'})
				$('div#rotator-body').scrollLeft(0);
				active_banner = 0;
				var i = 0;
				$('div#rotator-button-category-' +active_category+' img.rotator-button').each(function(){
					if (i++ == 0)
					{
						this.src = this.src.replace('disabled', 'enabled');			
					}
					else
					{
						this.src = this.src.replace('enabled', 'disabled');			
					}
				});
			}
			return false;
  		});
  	});
	$('div#rotator-body').click(function(){
		window.location.href = ($('div#rotator-item-'+ active_category +'-'+ active_banner +' a.item-link')[0].href);
	});
	/* Homepage: Rotator Button Controls */
	var active_banner      = 0;
	var rotator            = false;
	var rotator_mouse_over = false;
	$('div#rotator-body').scrollLeft(0);
	$('img.rotator-button').each(function(){
  		$(this).mouseover(function(){
  			rotator_mouse_over = true;
  		});
  		$(this).mouseout(function(){
  			rotator_mouse_over = false;
  		});
		$(this).click(function(){
			if (rotator_mouse_over == true) 
			{
				clearInterval(rotator_interval);
			}
			current_banner     = document.getElementById('rotator-button-'+ active_category +'-'+ active_banner);
			current_banner.src = current_banner.src.replace('enabled', 'disabled');		
			banner_id          = this.id.substr(17);
			active_banner      = banner_id;
			$(this).attr('src', this.src.replace('disabled', 'enabled'));
			$('div#rotator-body').animate({scrollLeft: (592*banner_id)}, 500);
		});
	}); 
	var rotator_index    = 1;
	var rotator_interval = setInterval(function(){
		$( $_ROTATOR_AUTOLOAD[rotator_index] ).trigger('click');
		if (rotator_index == ($_ROTATOR_AUTOLOAD.length - 1))
		{
			rotator_index = 0;
		}
		else
		{
			rotator_index++;
		}
	}, 4000)

