jQuery(document).ready(function($) {
        function load(num) {
            $('#homeVideo').load(num);
        }

        $.history.init(function(url) {
                load(url == "" ? "1" : url);
				checkURL();
            });
			
			function checkURL(){
				var currentURL = window.location;
				//alert(currentURL);
				var home1 = "http://www.elevatestudios.us/index.html";
				var home2 = "http://www.elevatestudios.us/";
				var portfolio = "http://www.elevatestudios.us/portfolio.html"
				var people = "http://www.elevatestudios.us/team.html";
				var council = "http://www.elevatestudios.us/council.html";
				var foundation = "http://www.elevatestudios.us/foundation.html";
				var festival = "http://www.elevatestudios.us/festival.html";
				
				
				if (currentURL == portfolio || currentURL == people || currentURL == council || currentURL == foundation || currentURL == festival || currentURL == home1 || currentURL == home2)
				{
					// at main root page
					
				} else
				{
					$(".collapsibleContainerTitle").toggleClass("active");
					 $(".titleContainer").css({'display' : 'none'});
					addShadow();
					//alert("at sub page");
				}
			}
			
			 function addShadow() {
				 $("#gallery").css({'-moz-box-shadow' : '0 0 5px #AAAAAA'});
				  $("#gallery").css({'-webkit-box-shadow' : '0 0 5px #AAAAAA'});
				   $("#gallery").css({'box-shadow' : '0 0 5px #AAAAAA'});
				   $(".shareThisButton").css({'display' : 'inline'});
			 }

        $("a[rel='history']").live('click', function(e) {
                var url = $(this).attr('href');
                url = url.replace(/^.*#/, '');
                load(url);
                $.history.load(url);
				closeIfOpen();
				addShadow();
                return false;
            });
    });
	
	/*
	var theObj = homeVideo;
	
	
	
	function changeColor(theObj,newColor){
	  eval('var theObject = document.getElementById("'+theObj+'")');
	  var action = $(this).attr('title');
	  
	  
	  
	  
	  if(action=="takeAway"){theObject.style.background-image = none;}else{theBG=theObject.style.backgroundColor;}
	  if(theObject.style.color==null){theColor='black';}else{theColor=theObject.style.color;}
	  //alert(theObject.style.color+' '+theObject.style.backgroundColor);
	theObject.style.color = newColor;
	
	}
	*/
	
	


