/**
 * Javascript - jQuery enabled
 * 
 * @package WPFramework
 * @subpackage Media
 */

jQuery(document).ready(function($) {
/* Home page thumb fade */
$('#holiday-thumbs li[class!=nofade]').hoverIntent (
  function () {
    $('img',this).animate({'opacity': '0.5'}, 400);
    $(this).find('span').animate({'top': '0'}, 700);
  }, 
  function () {
  	$('img',this).animate({opacity: '1'} , 400);
  	$(this).find('span').animate({'top': '-80px'}, 600);
  });

	//slider.init();
	//setInterval('slider.slide()', 6000);
	
	$('#slider_container').cycle({
		fx: 'fade',
		timeout: 8000
	});

});


function Slider()
{
	
}

Slider.prototype.init = function()
{
	this.imgCount = jQuery('#slider_container img').length;
	this.currImg = 1;
	this.containerwidth = jQuery('#slideshow_slider').width();
	this.change = '';
}

Slider.prototype.slide = function()
{
	this.currImg ++;
	var change = '-=' + this.containerwidth;
	
	if(this.currImg > this.imgCount)
	{
		this.currImg = 1;
		change  = '0';
	}
	
	jQuery('#slider_container').animate({
		left: change
	}, 1000);
}

var slider = new Slider();
