// JavaScript Document
		$(document).ready(function() {

			$(".tab").hide();
			$(".hero").hide();
			variable = $("#tabs li.activeSlide").attr('rel'); 
			$('div[id=' + variable + ']').show();
			$('#home-hero div[rel=' + variable + ']').show();
			$('#cal-adventure').hide();			
			
			$('#home-hero').cycle({
				fx: 'fade' ,
         		speed:  1000,
				timeout: 12000,
				before:   onBefore,
				pager:  '#tabs',
				pagerAnchorBuilder: function(idx, slide) { 
        		// return selector string for existing anchor 
       			 return '#tabs li:eq(' + idx + ') a'; 
   					 } 
				});
			
			function onBefore(curr, next, opts) {
    			var index = opts.currSlide;
    			$('#prev')[index == 0 ? 'hide' : 'show']();
    			$('#next')[index == opts.slideCount - 1 ? 'hide' : 'show']();
				variable = $(this).attr('rel');
				$(".tab").hide();
				$('div[id=' + variable + ']').show();
				}
			
			$('#tabs a').bind('click', function() {
        		variable = $(this).attr('rel'); 
				$(".tab").hide();
				$(".hero").hide();
				$('div[id=' + variable + ']').show();
				$('#home-hero div[rel=' + variable + ']').show();
				$('#tabs li').removeClass('activeSlide');
				$(this).parent().addClass('activeSlide');
				$('#home-hero').cycle('pause');
				$('#home-hero a').show();
				return false;			
			});
			
			
			$('#link-speak').bind('click', function() {
        		$("#cal-speak").show();
				$("#cal-adventure").hide();
				$(this).addClass('active');
				$('#link-adventure').removeClass('active');
				return false;			
			});
			
			$('#link-adventure').bind('click', function() {
        		$("#cal-adventure").show();
				$("#cal-speak").hide();
				$(this).addClass('active');
				$('#link-speak').removeClass('active');
				return false;			
			});
			
		    $('.date').each(function() {
				$(this).text($(this).text().substr(0, 10)); 
			});
			
			$('.blog-item div div span').each(function() {
				$(this).text($(this).text().substr(0, 190)); 
			});
			
			$("#body-background").ezBgResize();
			
			$("#news-email").focus(function(){
    			value=$(this).val();
				$(this).attr("value","");
				});

			
		});

		$(window).bind("resize", function(){
		    $("#body-background").ezBgResize();
		});


