// JavaScript Document
var c=0;
var t;
var timer_is_on=0;

function startTimer() {
	t=setTimeout("doTimer()",10000);
}

function doTimer()
{
	var len = banners.length - 1;
	
	if (c < len) {
		c++;
	}
	else {
		c=0;
	}
	
	changeBanner(c);
	
	startTimer();
}

function changeBanner(c) {
	document.getElementById('bannerImage').src = banners[c][0];
	document.getElementById('bannerLink').href = banners[c][1];	
}


function home_initCallback(carousel)
{
	carouselGlobal = carousel;
	$('#scrollUp').bind('click', function() {
        carousel.prev();
        return false;
    });

    $('#scrollDn').bind('click', function() {
        carousel.next();
        return false;
    });
	
}


$(document).ready(function(){
	
	jQuery('ul.sf-menu').superfish();
	$(document).pngFix(); 
		
	$("#slider").easySlider({
		speed: 1600,
		pause: 2000,
		auto: true, 
		continuous: true,
		prevId: 		'prevBtn',
		prevText: 		'Previous',
		nextId: 		'nextBtn',	
		nextText: 		'Next',
		controlsShow:		true,
		controlsBefore:	'',
		controlsAfter:		'',	
		controlsFade:		true,
		firstId: 		'firstBtn',
		firstText: 		'First',
		firstShow:		false,
		lastId: 		'lastBtn',	
		lastText: 		'Last',
		lastShow:		false,				
		vertical:		false, 
		numeric: 		true,
		numericId: 		'controls'
	});
	
	$("#featuredContainerImages").jcarousel({
        scroll: 2,
		vertical: true,
		auto: 0,
		animation:"slow",
		start: 1,
        initCallback: home_initCallback,
		buttonNextHTML: null,
        buttonPrevHTML: null,
		visible: 3
    });
	
	
	Cufon.replace('h3');
		
	if(banners.length > 0) {
		changeBanner(0);	
		startTimer();
	}
});
