$(document).ready(function() 
{
// load images
	$('#temp').jLoader({
				imgDir: "/store/images/home/",
				imgContainer:"complexImageContainer",
				imgTotal: 4,
				imgFormat: ".png",
        simpleFileNames: false
      }, [
        "venturi",
        "livebook",
        "ion",
        "rain-firewire-expresscard"
      ]);
      
// swap image
	function switchTo(i) {
		$('#featured-product div[id^="featured-"]').hide().eq(i).removeClass('inactive').fadeIn('medium');
	}

  $('#products a').hover(function(event){
  	$('#fp-promo').fadeOut('medium'); // start with default banner
    switchTo($('#products a').index(event.target)); // switch each banner
  });
  switchTo(0);

/*
		$("#product-livebook-studio").hover(function() {
			$("#swap").html('<div class="loader"><img src="/images/navigation/ajax-loader.gif" alt="" width="220" height="19" /></div>');
  		$("#swap").load("livebook-studio/resources/feature.html").hide().fadeIn('slow');
  	});
*/

// highlight row
  $('table tr').hover(function() 
  {
    $(this).addClass('highlight');
	},
		function() 
		{
			$(this).removeClass('highlight');
		});
	});

	var wrap = '';

	$(function() 
	{
	// if the function argument is given to overlay,     
    // it is assumed to be the onBeforeLoad event listener     
	$('a[rel]').overlay({          
		// some expose tweaks suitable for modal dialogs
//		expose: {
//			color: '#000'
//		},	
		effect: 'apple',
		closeOnClick: false,       
        onBeforeLoad: function() 
        {
        	// grab wrapper element inside content             
            wrap = this.getContent().find('.contentWrap');              

            // load the page specified in the trigger             
            wrap.load(this.getTrigger().attr('href'));         
		}
	});
	
});
