// 						jquery map 
// 
//	author: 		Chad Payne
//	contact:		chad@gydesign.com
// 	date:			10/04/2009

$(document).ready(function() {   
						   
//********************************************
//	Clickable ajax loading map
//********************************************
// catches clicks on area elements
   $('area').click(function(){
								
		//grabs the url to load
		var toLoad = $(this).attr('href');
		
		// toggles content then excutes load function
		$('#projectbox').fadeOut(600,loadContent);
		
		function loadContent() {
			$('#projectbox').load(toLoad,'',showNewContent);
		}
		function showNewContent() {
			$('#projectbox').fadeIn(800);
		}
		
		// makes links not work like normal
		return false;
    
    });
   
   $('.maplink').click(function(){
								
		//grabs the url to load
		var toLoad = $(this).attr('href');
		
		// toggles content then excutes load function
		$('#projectbox').fadeOut(600,loadContent);
		
		function loadContent() {
			$('#projectbox').load(toLoad,'',showNewContent());
		}
		function showNewContent() {
			$('#projectbox').fadeIn(800);
		}
		
		// makes links not work like normal
		return false;
    
    });   
   
   $('.defaultmaplink').click(function(){
								
		//grabs the url to load
		var toLoad = $(this).attr('href');
		
		// toggles content then excutes load function
		$('#projectbox').fadeOut(600,loadContent);
		
		function loadContent() {
			$('#projectbox').load(toLoad,'',showNewContent());
		}
		function showNewContent() {
			$('#projectbox').fadeIn(800);
		}
		
		// makes links not work like normal
		return false;
    
    });   
   

}); 
