$(document).ready(function() {

	// video section tabs
	/*$(".video-list-tabs li a").click(function(){
		$(".video-list-tabs li a").removeClass('selected'); // kill selected tab state
		$("ul.video-list").hide(); // hide all video thumbs
		$(this).addClass('selected'); // highlight current tab
		var current_video_section = $(this).attr('href'); // grab the section to show
		$("ul#"+current_video_section).fadeIn('fast'); // show the current section
		return false;
	});*/
	
	<!--- //catch all links and add mbox// --->
	$('a').click(function() {
		var linkOut = $(this).attr('href');
		if(linkOut.indexOf('search.iqrez') >0 || linkOut.indexOf('search.guestdesk') >0 || linkOut.indexOf('secure.guestdesk') >0) {
			/*if(linkOut.indexOf('?')) {
				linkOut = linkOut + '&mboxSession=' + mboxFactoryDefault.getSessionId().getId()
			} else {
				linkOut = linkOut + '?mboxSession=' + mboxFactoryDefault.getSessionId().getId()
			}*/
			//guestdesk analytics without referral implementation - yosi
			_gaq.push(['_link', linkOut]);
			return false;
		}
	})
	
	// compliant new window code
	$('a[rel="external"]').attr('target', '_blank');
	
	// header promo panel
	$('#slideshow').after('<div id="slideshow-nav"></div>').cycle({ 
		fx:     'fade', 
		speed:  1000, 
		timeout: 7000, 
		pager:  '#slideshow-nav',
		pause: 1 
	});
	
	
	// golf promo panel
	$('#promo-slideshow').after('<div id="slideshow-nav"></div>').cycle({ 
		fx:     'fade', 
		speed:  1000, 
		timeout: 7000, 
		pager:  '#slideshow-nav',
		pause: 1 
	});
	
	
	// pages photo gallery
	$('#pages-slideshow').after('<div id="pages-slideshow-nav"></div>').cycle({ 
		fx:     'fade', 
		speed:  1000, 
		timeout: 4000, 
		next:   '#next2', 
    	prev:   '#prev2', 
		pause: 1 
	});

	
	// disbles right-click on images
	$('img').bind("contextmenu", function(e){ return false; });
	
	// fancybox
	$("a.fancy-image").fancybox();
	
	// video section tabs
	$(".video-list-tabs li a").click(function(){
		$(".video-list-tabs li a").removeClass('selected'); // kill selected tab state
		$("ul.video-list").hide(); // hide all video thumbs
		$(this).addClass('selected'); // highlight current tab
		var current_video_section = $(this).attr('href'); // grab the section to show
		$("ul#"+current_video_section).fadeIn('fast'); // show the current section
		return false;
	});
	
	// form placeholder text removal
	$('form input').focus(function(){
		if($(this).val() == "Email Address" || $(this).val() == "Zip Code"){
			$(this).val('');
		}
	});
	

	
	
	// ------------------------------------
	// OMNITURE
	// ------------------------------------
	if($('.specialTrack').length > 0){
		$('.specialTrack').click(function(){
			s=s_gi(s_account);
			s.linkTrackVars='prop25';
			specialName = $(this).attr('rel');
			s.prop25=specialName.toLowerCase();
			s.tl(this, 'o', specialName.toLowerCase());
		
		});
	 }
	
});
function setUpTabs(){
	if('#media-tabs'){
		$('#media-tabs a').click(function(){
			var activetab = $(this).attr('href');
			$(this).parent().siblings().children('a').removeClass('active');
			$(this).addClass('active');
			$('#media .content-container').hide();
			$('#'+activetab).show();
			return false;
		});
	}
	$('#content-tabs a').click(function(){
		var activetab = $(this).attr('href');
		$(this).parent().siblings().children('a').removeClass('active');
		$(this).addClass('active');
		$('#details-content .content-container-bigger').hide();
		$('#'+activetab).show();
		if(activetab == "Map"){
			loadmap(); // calls the map load function
		}
		return false;
	});
}

