// JavaScript Document

$(document).ready(function (){
	
	$('.facility').hide(); 
	$('.plan').hide();
	$('.location').hide(); 
	$('.froolplan').hide();
	
	$('.link').live('click', function() {  
		val = $(this).attr("id");
		if(val=="home"){
			$('.home').show();  
			$('.facility').hide(); 
			$('.plan').hide(); 
			$('.location').hide();
			$('.froolplan').hide();
		}else if(val=="facility"){
			$('.home').hide();  
			$('.plan').hide();
			$('.location').hide();
			$('.facility').show(); 
			$('.froolplan').hide();
		}else if(val=="plan"){
			$('.home').hide();  
			$('.plan').show();
			$('.location').hide();
			$('.facility').hide(); 
			$('.froolplan').hide();
		}else if(val=="location"){
			$('.home').hide();  
			$('.plan').hide();
			$('.location').show();
			$('.facility').hide();
			$('.froolplan').hide();
		}else if(val=="froolplan"){ 
			$('.home').hide();  
			$('.plan').hide();
			$('.location').hide();
			$('.facility').hide();
			$('.froolplan').show();
		}
		
		
	 });
						
	$('#slider').nivoSlider();  
	$('#slider_2').nivoSlider({
		effect:'fold',
		slices:10,
		animSpeed:1000,
		pauseTime:7000,
		startSlide:0,
		directionNav:false,
		directionNavHide:false,
		controlNav:false,
		controlNavThumbs:false,
		controlNavThumbsFromRel:false,
		controlNavThumbsSearch: '.jpg',
		controlNavThumbsReplace: '_thumb.jpg',
		keyboardNav:true,
		pauseOnHover:true,
		manualAdvance:false,
		captionOpacity:0.8,
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){}
	}); 
	
	$('#slider_3').nivoSlider({
		effect:'fold',
		slices:10,
		animSpeed:1000,
		pauseTime:7000,
		startSlide:0,
		directionNav:false,
		directionNavHide:false,
		controlNav:false,
		controlNavThumbs:false,
		controlNavThumbsFromRel:false,
		controlNavThumbsSearch: '.jpg',
		controlNavThumbsReplace: '_thumb.jpg',
		keyboardNav:true,
		pauseOnHover:true,
		manualAdvance:false,
		captionOpacity:0.8,
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){}
	}); 
	
	$('#slider_4').nivoSlider({
		effect:'fold',
		slices:10,
		animSpeed:1000,
		pauseTime:7000,
		startSlide:0,
		directionNav:false,
		directionNavHide:false,
		controlNav:false,
		controlNavThumbs:false,
		controlNavThumbsFromRel:false,
		controlNavThumbsSearch: '.jpg',
		controlNavThumbsReplace: '_thumb.jpg',
		keyboardNav:true,
		pauseOnHover:true,
		manualAdvance:false,
		captionOpacity:0.8,
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){}
	}); 
  	
	
	$('.map-search').click(
			function(){
				$('#project-search').slideToggle(); 
				$('#map').jMapping({
					 map_config: {
					  navigationControlOptions: {
						style: google.maps.NavigationControlStyle.DEFAULT
					  },
					  mapTypeId: google.maps.MapTypeId.HYBRID,
					  zoom: 7
					},
				  category_icon_options: function(category){
					if (category.charAt(0).match(/[0]/i)){
					  return new google.maps.MarkerImage('img/arp.png');
					} else if (category.charAt(0).match(/[1]/i)){
					  return new google.maps.MarkerImage('img/condo.png');
					} else if (category.charAt(0).match(/[2]/i)){
					  return new google.maps.MarkerImage('img/building.png');
					} else {
					  return new google.maps.MarkerImage('img/home.png');
					} 
				
				  }
				 
			});
				
	 });
	 
});
