// JavaScript Document

$(document).ready(function() {
	
	$('#overlay').remove();
	
	//Set content div height by adjusting margins		
	$('#content').css({
		marginTop: $('#nav').height() + 105 + "px",
		marginBottom: $('#footer').height() + "px"
	});
		
		
		
	//Dropdown Menu						   
	$('#nav li ul').css({
		display: "none",
		left: "auto"
	});
	$('#nav li').hover(function() {
		$(this)
			.find('ul')
			.css({display: "block"});
		}, function() {
		$(this)
			.find('ul')
			.css({display: "none"});
		
	});

	$('#nav li ul li a').hover(function() {
		
		$(this).css({
			width: "9em",
			backgroundColor: "#297cca"
		});

	}, function() {
		
		$(this).css({
			backgroundColor: "#000"
		});

	});
		
	//Load home.html on page load
		
		$("#content_slideshow").css({display: "block"}).easySlider({
				auto: true, 
				continuous: true,
				controlsShow: false,
				pause: 8000
		});	
		FB.init({
			appId  : 'a5cb22a787afab94277dc74b9186935d',
			status : true, // check login status
			cookie : true, // enable cookies to allow the server to access the session
			xfbml  : true  // parse XFBML
	    });
	
		get_rss_feed();
	
	
	
	
	//Link controls
		//Links in the nav bar update the #content DIV
			$('a').click(function(e) {
			if($(this).attr('id')==='webcam') {
				$("#webcam").colorbox({width:"90%", height:"80%", iframe:true});
			};
			});
			
			
			$('a').live('click', function(e) {
			if ($(this).attr('class')==='internal') {
				var url = $(this).attr('href') + ' #container';
				$('#content').load(url, function() {
					$('a.colorbox').colorbox();
					$("a[rel='gallery_new']").colorbox();
					$("a[rel='gallery_old']").colorbox();
					$( 'html, body' ).animate( { scrollTop: 0 }, 0 );

				});
				e.preventDefault();
				this.blur();
			};
			});
			
			
			
			
			
			
		
	});
		
			

		
					
			






