// JavaScript Document
$(document).ready(function() {
						  		
	 //default form fields clear on click. Nice bit of UX.
		$("#searchText").click(function(){
		var varSelection = String($(this).val());
		if(varSelection=="Search"){$(this).val('');}
		return false;			
		}); //close $("#search").click	
		
		$("#searchGo").click(function(){
		$varSearch = "http://www.google.com/search?hl=en&safe=off&q=site%3Amenifeeranchstorage.com+" + $("#searchText").val() + "&btnG=Search";
		window.open($varSearch);
		//alert($varSearch);
		return false;			
		}); //close $("#btnSearchSubmit").click	
		
	   //easing
	   jQuery.easing.def = 'easeOutCubic';
	   //jQuery.easing.def = 'easeOutBounce';	
	   $('h2').css({background:"#FFB"}).toggle(function() { $(this).animate({width:100}, 1000);},function() { $(this).animate({width:"100%"}, 1000);})
	   
	   //home tour
	   var leftPos = 0;
	   $("a.tourMenu").click(function(){ 				  
		
		var navTarget = $(this).attr("href");	
			var cellWidth = -1200;
			//alert(navTarget);
			switch (navTarget)
			{
			case "1":
			 $("#maskedContent").animate({left: "0"}, 1500);
			 leftPos = 0;
			 break;
			 case "2":
			 $("#maskedContent").animate({left: "-1200"}, 1500);
			 leftPos = 1200;
			 break;
			 case "3":
			 $("#maskedContent").animate({left: "-2400"}, 1500);
			 leftPos = 2400;
			  break;
			 case "4":
			 $("#maskedContent").animate({left: "-3600"}, 1500);
			 leftPos = 3600;
			  break;	
			  
			default :
			varDistance = (navTarget * cellWidth);
			$("#maskedContent").animate({left: varDistance}, 1500);
			leftPos = Math.abs(varDistance);
			break;
			 
			 case "LEFT":
			 if (leftPos!="0"){
				  leftPos = leftPos - 1200;
				 $("#maskedContent").animate({left: -(leftPos)}, 1500);			
			 }
			 break;
			 case "RIGHT":
			
			 if (leftPos!="3600"){
				  leftPos = leftPos + 1200;
				 $("#maskedContent").animate({left: -(leftPos)}, 1500);	
			 }
			 
			 else if (leftPos=="3600"){
				  leftPos = 0;
				 $("#maskedContent").animate({left: 0}, 1500);	
			 }
			
			 break;
			}					  		
			return false;			
	}); //$("a.tourMenu").click(function(){ 	 END
	
	//start tour on index.php if indicated
	var hash = window.location.hash.substr(1);
	if(hash=="tour"){
	//alert(hash);
	$("#maskedContent").animate({left: "-1200"}, 1500);
	leftPos = 1200;
	}
	   

}); //jQuery $(document).ready END