$(document).ready(function() { 	
	
	//figure out the filename
	var pathname = window.location.pathname;
    var filename = pathname.split('/');
    filename = filename[filename.length-1]; 
	
	//Set home to active if there is no filename
   	if(filename == "") { 
   		$("ul#nav a.home").parent().addClass("active"); 
   	}
   	else {
		//search each link for the filename in the href
		$("ul#nav a").each(function() {
		   if($(this).attr("href") == filename){ 
				$(this).parent().addClass("active"); //if the filename matches, set it to active
				$(this).parent().parent().parent('li').addClass("active"); //make sure it sets the active class at least one level up
		   }
		});
   	
   	}
   	
	
	//superfish menu
	$('ul.sf-menu').superfish({autoArrows: false,  pathClass: 'active', pathLevels:    2});
	
	
	//set sidebar image
	$('#wrapper').css('background-image', 'url(' + $('#background_image img').attr('src') + ')' );
	
	
	
	//lightbox
	$('.colorbox').colorbox({maxHeight:'90%', width:'90%', opacity:.5});
	
		
});

// Parameters for flash movies embedded via swjobject
var params = {
  wmode: "opaque"
};