// $Id: front.js v1.0, 08/09/2011 00:00:00 tiltedlistener $

/**
*	Controls the frontpage tab system
*/

(function ($) {

  Drupal.behaviors.danlandFront = {
    attach: function (context, settings) {
		
		$('#block-system-main .views-row:gt(0)').hide();
	
		$('#block-views-front-block-1 a').click(function () {
					
					// Get the clicked item's class
					var itemClass = $(this).attr('class');
					
					// Change the backgrounds
					$(this).parents('.views-row').siblings().css('background-image','url(sites/all/themes/danland/images/tab-inactive.png)');
					$(this).parents('.views-row').css('background-image','url(sites/all/themes/danland/images/billboard-bg3.png)');
					
					// Hide everything, show the matching pair
					var current = $('#block-system-main div.' + itemClass);
					$('#block-system-main .views-row').hide();
					$(current).parent().show();					  
		});
		
		

		
	}
	
  }


}(jQuery));;

