// JavaScript Document

 $(document).ready(function(){
   $('.mainNavLink').each(
		function(intIndex) {
			var str = $(this).html();
			if(str.length >= 14){
			 $(this).css('padding-top','17px');	
			 $(this).css('height','40px');	
			}
		}
	);
   if(isListings)
   	$('.lThumbContainer a.lightbox').lightBox({fixedNavigation:true});
	
	//removed Cufon from main nav per ticket #: 30425
	//Cufon.replace('#mainNav li.mainNavItem a', {hover:true});						

	//removed Cufon from main nav TOP LEVEL items as well
 	//Cufon.replace('#mainNav a.mainNavLink');
   Cufon.replace('h1');
   Cufon.replace('h2');
   
   /*var windowHeight = $(document).height();
   var divHeight = $("#siteContainerInner").height();
   if(windowHeight > divHeight)
   		$("#siteContainerInner").css('height',windowHeight);*/
	var floatedHeight = $("#floatedCol").height();
	
	var containerheight = $("#siteContainerInner").height()
	
	// 20100105 colin, removed
	if(containerheight < floatedHeight) {
   		//$("#footer").css('marginTop',300);
		if ($("#siteContainerInner").attr('class')=='interior') $("#c1").css('height',floatedHeight-200);
		else $("#c1").css('height',floatedHeight-350);
	}
	
   
   $("ul#mainNav li.mainNavItem:last").css('width','128px');
   $("ul#mainNav li.mainNavItem a.mainNavLinkmainNavLink:last").css('padding-left','24px 6px 0;');
   
   $("a#itinExpand").click( function () {
		$("ul#itinListHolder").slideToggle('normal', function() {
			pos = $("#itinListCap").css('backgroundPosition');
			if(pos == 'top left'){
				$("#itinListCap").css('backgroundPosition','bottom left');
			} else {
				$("#itinListCap").css('backgroundPosition','top left');
			}
			
		});
		return false;
	});
   
/*   $("ul#itinListHolder li").not(".itinLinks").hover(
      function () {
        $(this).css('background-color','#222222');
      }, 
      function () {
        $(this).css('background-color','#000000');
      }
    );*/

	$("ul#itinListHolder li").not(".itinLinks").live("mouseover", function() {
		$(this).css('background-color','#222222');													 
	});
	$("ul#itinListHolder li").not(".itinLinks").live("mouseout", function() {
		 $(this).css('background-color','#000000');												 
	});
   
   //$('.dropdownRoundedInner').corner("round 3px").parent().css({'background-color':'#343434','padding':'1px'}).corner("round 6px")
   
   $("li.mainNavItem:not(.selnomove)").hover(
      function () {
         $("a",this).addClass('sel');
		 $(this).find("div").css('display','block');
		 //$(this).css('overflow','visible');
      }, 
      function () {
		 $("a",this).removeClass('sel');
		 $(this).find("div").css('display','none');
		 //$(this).css('overflow','hidden');
		
      }
    );
   
   $("#secondaryNav ul li a:not(.selnomove)").hover(
      function () {
        $(this).prevAll().css('display','block');
      }, 
      function () {
        $(this).prevAll().css('display','none');
      }
    );
	
//	$(".thumbReflection").reflect({height:.2,opacity:.25,distance:0});
//	$(".thumbReflectionIMGBOX").reflect({height:.4,opacity:.4,distance:0});
	
	$(".calItem").hover(
      function () {
        $(this).addClass('calItemHover');
      }, 
      function () {
        $(this).removeClass('calItemHover');
      }
    );
	
	$('#printBtn').click(function() {
		var currentURL = window.location;
		currentURL.search += "&print=1";
		//window.location.href(currentURL);
		alert("Note: Use the following print dialog box to select your print device.");
		window.location.reload();
		window.print();
		return false;
	});
	
	$("ul#listingCalLinks li:last-child").css('border-right','none');	
	
	/*$(".divIMG a").hover(
     	function () {
			$(this).parent().css('background-position','right top');
      	}, 
      	function () {
        		$(this).parent().css('background-position','left top');
      	}
    	);*/
	
	$(".listingsWrapper .listingCalThumb").hover(
     	function () {
			$(this).prevAll().css('display','block');
      	}, 
      	function () {
        		$(this).prevAll().css('display','none');
      	}
    	);
	

	$(".listingCalItemCallout").hover(
     	function () {
			$(this).css('display','block');
      	}, 
      	function () {
        		$(this).css('display','none');
      	}
    	);
	
	$("#meetingFacilityLink").click( function() {
		$("#meetingFacility").slideToggle();
		$.scrollTo('#meetingFacility', 800);
		return false;
	});
	
	if ( $("#secondaryNav").length == 0 ) { $("#c2Content").css("padding-top", "40px"); }
		// me no likey IE
	
 });
 
