$().ready(function(){  
     $.ajaxSetup({ cache: false });
     setInterval("checkAnchor()", 300);
	 $('#contactForm').ajaxForm(function() { 
                alert("Your inquiry has been submitted and will be responded to as soon as possible. Thank you!"); 
        });
	 $(".slider").slider({orientation: 'vertical',
			animate: true,
			min: 0,
			max: 1,
			step: 0.01,
			value: .9,
			slide: function(event, ui) {
				$("#sliderImage").css({opacity: ui.value});
			}
	 });
 }); 
 var section = null;
 var currentAnchor = null;
 function checkAnchor(){  
     //Check if it has changes  
     if(currentAnchor != document.location.hash){
         currentAnchor = document.location.hash;
		 $("#" + section).hide(); //fadeOut
         //if there is no anchor, the loads the default section  
         if(!currentAnchor)  {
		    section = "Home";
			query = "section=Home";}
         else  
         {  
             //Creates the  string callback. This converts the url URL/#main&id=2 in URL/?section=main&id=2  
             var splits = currentAnchor.substring(1).split('&');  
             //Get the section  
             section = splits[0];  
             delete splits[0];  
             //Create the params string  
             var params = splits.join('&');  
             var query = "section=" + section + params;  
			 document.title = 'Copper Lion:' + currentAnchor.replace(/([A-Z])|#/g, " $1");
         }
         //Send the petition  
		 //$("#loading").fadeIn('slow');
		 $("#right").hide(); //fadeOut
         $.get("callbacks.php",query, function(data){ 
			$("#callbackDiv").html(data);
			$("#" + section).show(); //fadeIn
			$("#right").show(); //fadeIn 
			//$("#loading").fadeOut('slow');
	     });  
     } 
 }