$(document).ready(function() {
  // Anchors
   $('a.active.collapsible').live('click', function(event) {
     $(this).removeClass("active");
     var href = $(this).attr("href");
     $(href).hide();
     $(this).find('span.response').html("Show");
     return false;
   });

   $('a.collapsible:not(.active)').live('click', function(event) {
     $(this).addClass("active");
     var href = $(this).attr("href");
     $(href).show();
     $(this).find('span.response').html("Hide");
     return false;
   });

   // Hide any elements that are not hidden but should be
   $('a.collapsible:not(.active)').each(function(){
     if($(this).attr("href") != '#search'){
       var href = $(this).attr("href");
       $(href).hide();
     }
   });
   
   $('.place-holder-text').focus(function() {
     if(this.value == this.defaultValue) {
       this.value = '';
       $(this).addClass('active')
     }
   });

   $('.place-holder-text').blur(function() {
     if(this.value == '') {
       this.value = this.defaultValue;
       $(this).removeClass('active')
     }
   });
   
   
   $('a[rel*=facebox]').facebox();
   
	  // $('a[href*=#top]').click(function() {
	  // 		  if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
	  // 		    var $target = $(this.hash);
	  // 		    $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
	  // 		    if ($target.length) {
	  // 		  	  var targetOffset = $target.offset().top;
	  // 				  $('html,body').animate({scrollTop: targetOffset}, 1000);
	  // 				  return false;
	  // 		    }
	  //   }
	  // });
	
})
