<!--
/*!
 **************************************************
 * Copyright 2010 - Danny Carmical
 * http://luckykind.com
 **************************************************/

var $j = jQuery.noConflict();


$j(document).ready(function() {
	var aqua1 = $j('#rip-aqua1');
	var aqua2 = $j('#rip-aqua2');
	var aqua3 = $j('#rip-aqua3');
	var aqua1img = $j('#rip-aqua1-img');
	var aqua2img = $j('#rip-aqua2-img');
	var aqua3img = $j('#rip-aqua3-img');
		
	aqua1img.hover(
		function(){
			$j(this).find('.aqua-hover-img img').animate({
				opacity:0.3
			},300);
			
			aqua1.show();
		},
		function(e){
			$j(this).find('.aqua-hover-img img').animate({
				opacity:1
			},300);
			aqua1.hide();
		}
	);
	
	aqua2img.hover(
		function(){
			$j(this).find('.aqua-hover-img img').animate({
				opacity:0.3
			},300);
			aqua2.show();
		},
		function(){
			$j(this).find('.aqua-hover-img img').animate({
				opacity:1
			},300);
			aqua2.hide();
		}
	);

	aqua3img.hover(
		function(){
			$j(this).find('.aqua-hover-img img').animate({
				opacity:0.3
			},300);
			aqua3.show();
		},
		function(){
			$j(this).find('.aqua-hover-img img').animate({
				opacity:1
			},100);
			aqua3.hide();
		}
	);
	
	/*******************************************************
	 *
	 * Attractions Tabs
	 *
	 *******************************************************/
	
	var attr_na_tab = $j('#at-na'); 		// North American Tab
	var attr_ovs_tab = $j('#at-ovs');	// Overseas Tab
	
	var attr_na = $j('#attractions-america'); 		// North American Section
	var attr_ovs = $j('#attractions-overseas'); 	// Overseas Section
	
	attr_na_tab.bind('click',function(){
		attr_ovs_tab.removeClass('at-active');
		$j(this).addClass('at-active');
		attr_ovs.hide();		
		attr_na.show();
	});

	attr_ovs_tab.bind('click',function(){
		attr_na_tab.removeClass('at-active');
		$j(this).addClass('at-active');
		attr_na.hide();		
		attr_ovs.show();
	});
	
	
	// Brands Navigation
	var attr_brands = $j('#attractions-brands-carousel ul li');
	var attr_brands_count = attr_brands.length;
	var attr_brands_prev = $j('#attractions-brands-carousel a.abc-prev');
	var attr_brands_next = $j('#attractions-brands-carousel a.abc-next');
	var attr_brands_min = 7;

	var attr_brands_pos = 0;
	
	var attr_animate = 500;
		
	attr_brands_next.bind('click',function() {
		if(attr_brands_min == 6) {
			attr_brands_min++;
		}
		if(attr_brands_min == (attr_brands.last().index() + 1)) {
			attr_brands_pos = attr_brands_pos - 90;
			attr_brands.animate({
				left:attr_brands_pos
			},attr_animate);
			attr_brands_min++;
		} else if(attr_brands_min < attr_brands_count) {
			attr_brands_pos = attr_brands_pos - 140;
			attr_brands.animate({
				left:attr_brands_pos
			},attr_animate);
			attr_brands_min++;
		}
		return false;
	});

	attr_brands_prev.bind('click',function(){
		if(attr_brands_min == (attr_brands.last().index() + 2)) {
			attr_brands_min--;			
		}
		if(attr_brands_min == 7) {
			attr_brands_pos = 0;
			attr_brands.animate({
				left:attr_brands_pos
			},attr_animate);
			attr_brands_min--;
		} else if(attr_brands_min > 7) {
			attr_brands_pos = attr_brands_pos + 140;
			attr_brands.animate({
				left:attr_brands_pos
			},attr_animate);
			attr_brands_min--;
		}
		return false;
	});
	
	var attractions = $j('.brand-showcase > div');
	
	attractions.hover(
		function(){
			$j('.attr-hover-img img',this).animate({
				opacity:0.5
			},300);
			$j('> div',this).show();
		},
		function(){
			$j('.attr-hover-img img',this).animate({
				opacity:1
			},300);
			$j('> div',this).hide();			
		}
	);
	
	
	
	/*******************************************************
	 *
	 * Twitter
	 *
	 *******************************************************/
	
		var tweet_box = $j('#twitter-block > p');
		var tweet_user = $j('#twitter-block > p > a').attr('id');
		
		if(tweet_user!=null) {
			tweet_user = tweet_user.substr(3);
		}
		
		if(tweet_box!=null) {
			tweet_box.append('<span id="tweet-status"> - loading tweet... <img src="' + temp_dir + '/images/ajax-loader-tweet.gif" /></span>');
			$j.ajax({
			         url: temp_dir + '/library/get-tweet.php?tu=' + tweet_user,
			         cache: false,
			         type: 'GET',
			         success: function(result) {
								tweet_box.children('span').html(' - ' + result);
			         	      }
				    });
		}
	
});

-->	
