/*
 * 
 */
function updateContent(l) {
	loc = l.split('#')
	h2 = loc[1];
	if(typeof(h2) != "undefined"){
		h3 = h2.split('/');
		a1 = "#"+h3[0];
		a2 = "#"+h3[1];
		$('.dcontent').hide();
		//$(a1).show();
		$(a1).slideDown('slow');
		if(a2 != "#") {
			//$(a2).show();
			$(a2).slideDown('slow');
		}
	}
}

// DOM is ready
$(document).ready(function() {
	// easyslider1.7.js
	$('#slider').easySlider({
		auto: true, 
		continuous: true,
		numeric: true,
		speed: 500,
		pause: 8000,
		controlsShow: false
	});

	// Toggle Services Menu when Services Link is clicked
	/*
	$('#nav-services').click(function(){
		$('#services_menu').toggle();
	});
	*/

	//$('a.lightbox').lightBox();
	/*
	$('a.iframe').fancybox({
		width: 760,
		height: 400,
		centerOnScroll: true,
		overColor: '#222',
		overlayOpacity: 0.8
	});
	*/
	$('a.iframe').click(function(){
		window.open(this.href);
		return false;
	});
	$('a.lightbox').fancybox({
		centerOnScroll: true,
		overColor: '#000',
		overlayOpacity: 0.8,
		cyclic: true,
		showNavArrows: true,
		transitionIn: 'fade',
		transitionOut: 'elastic'
	});

	$(window).bind("hashchange", function(){
		//updateContent(location.hash);
		if(location.hash == "" || location.hash=="#"){
			updateContent('#about');
		} else {
			updateContent(location.hash);
		}
	});

	$(window).trigger("hashchange");
	// if link is first entered with 

	// Update Main Page Content based on an Anchor clicked with a class of "clickupdate"
	$('a.clickupdate').click(function(){
		updateContent(this.href);
	});

});
	

