function ro()
{
	$('.ro').mouseover( function()
	{
		rep = ".";
		ext = $(this).attr('src').substr(-4, 4);
		src = $(this).attr('src').replace(rep, "-on.");
		$(this).attr('src', src);
		
	});
	$('.ro').mouseout( function()
	{
		rep = "-on.";
		ext = $(this).attr('src').substr(-4, 4);
		src = $(this).attr('src').replace(rep, ".");
		$(this).attr('src', src);
		
	});
}

function marquee(){
	if( $('#banner .spinner').length > 0 ){
		$('#banner .spinner').cycle({
			timeout: 8000, 
			speed: 500/*, 
			easing: 'easeInOutExpo', 
			next: '#info-swivel .next', 
			prev: '#info-swivel .prev' */
		});
	}
}
function reviewsSpinner(){
	if( $('#mod-reviews .spinner').length > 0 ){
		$('#mod-reviews .spinner').cycle({
			timeout: 0, 
			speed: 500,/*, 
			easing: 'easeInOutExpo', */
			next: '#mod-reviews .next', 
			prev: '#mod-reviews .prev' 
		});
	}
}

function eventsSpinner(){
	if( $('#mod-featured-events .spinner').length > 0 ){
		$('#mod-featured-events .spinner').cycle({
			timeout: 0, 
			speed: 500,
			cleartype : !$.support.opacity,
			cleartypeNoBg : true,
			next: '#mod-featured-events .next a', 
			prev: '#mod-featured-events .prev a',
			pager: '#mod-featured-events ul.clearfix .pager',
			pagerAnchorBuilder: function( idx, slide ){
				return '#mod-featured-events .pager:eq('+(idx)+') a';
			}
		});
	}
}
function preplannedTripsModule(){
	if( $('#mod-preplanned-trips .spinner').length > 0 ){
		$('#mod-preplanned-trips .spinner').cycle({
			timeout: 0, 
			speed: 500,
			cleartype : !$.support.opacity,
			cleartypeNoBg : true,
			next: '#mod-preplanned-trips .next a', 
			prev: '#mod-preplanned-trips .prev a',
			pager: '#mod-preplanned-trips ul.clearfix .pager',
			pagerAnchorBuilder: function( idx, slide ){
				return '#mod-preplanned-trips .pager:eq('+(idx)+') a';
			}
		});
	}
}

function datepick(){
	if( $('.datepicker').length > 0 ){
		$('.datepicker').datepicker({
			dateFormat: "yy-mm-dd", 
			dayNamesMin: ['S','M','T','W','T','F','S']
		});
	}
}

$(document).ready( function()
{
	ro();
	marquee();
	reviewsSpinner();
	eventsSpinner();
	preplannedTripsModule();
	datepick();
});