// JavaScript Document

$(document).ready(function(){
	$('#cavity').addClass('current_page');
	

	function loadPage(page,link){
		
		$('.current_page').hide();
		$('.current_page').removeClass();
		$('.current').removeClass();
		$(page).addClass('current_page');
		$(page).fadeIn(200);
		$(link).addClass('current');
	
	}
	
	
	
	
	$('.img').hover(function(){
			$(this).animate({'opacity':0.5})},
					function(){
			$(this).animate({'opacity':1});
	});
		
	
	
	
	
	
	
	$('#link1').click(function(){
		loadPage('#one',this);	
	});
	
	$('#link2').click(function(){
		loadPage('#two',this);
	});
	
	$('#link3').click(function(){
		loadPage('#three',this);
	});
	
		
	
	

	if(window.location.hash == '#design'){
		loadPage('#one','#link1');
	}

	if(window.location.hash == '#web'){
		loadPage('#two','#link2');
	}
	
	if(window.location.hash == '#mobile'){
		loadPage('#three','#link3');
	}
	
	
	
	
});
