jQuery(document).ready(function(){
	jQuery('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
		&& location.hostname == this.hostname) {
			var $target = jQuery(this.hash);
			$target = $target.length && $target
			|| jQuery('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				jQuery('html,body')
				.animate({scrollTop: targetOffset}, 1000);
				return false;
			}
		}
	});
});

jQuery(document).ready(function(){

      jQuery('a.blog-more').click(function(){
      		var thisid = jQuery(this).attr("id");
      		thisid = thisid.replace(/read-more-/,"");
      		jQuery(this).hide();
            jQuery('#post-content-' + thisid).show('slow');
            jQuery('#read-less-' + thisid).fadeIn();
      });

   jQuery('a.blog-close').click(function(){
   		 var thisid = jQuery(this).attr("id");
      	 thisid = thisid.replace(/read-less-/,"");
      	 jQuery(this).hide();
          jQuery('#post-content-' + thisid).hide('slow');
          jQuery('#read-more-' + thisid).fadeIn();         
        })
        
          jQuery('a.about-more').click(function(){
      		var thisid = jQuery(this).attr("id");
      		thisid = thisid.replace(/read-more-/,"");
      		jQuery(this).hide();
            jQuery('#post-content-' + thisid).show('slow');
            jQuery('#read-less-' + thisid).fadeIn();
            //jQuery('#about-excerpt').hide();
      });

   jQuery('a.about-close').click(function(){
   		 var thisid = jQuery(this).attr("id");
      	 thisid = thisid.replace(/read-less-/,"");
      	 jQuery(this).hide();
          jQuery('#post-content-' + thisid).hide('slow');
          jQuery('#read-more-' + thisid).fadeIn(); 
         // jQuery('#about-excerpt').show();        
        });
        
         jQuery('ul.miniGallery li a').click(function(){
	   		 jQuery('#added-to-lightbox').hide();
	   		 jQuery('#add-to-lightbox').show(); 
        });
        
         jQuery('#add-to-lightbox').click(function(){
	   		 jQuery('#added-to-lightbox').show();
	   		 jQuery('#add-to-lightbox').hide(); 
	   		 var lbimg = jQuery('#main_project_image').attr('src'); 
	   		 var newvidth = jQuery("#project-thumbnails img.active").attr("src"); 
	   		 var newvid = jQuery("#main_project_video").html(); 
	   		 jQuery.post("/lightbox.php", { newimg: lbimg, newvidth: newvidth, newvid: newvid} );
        });
        

        
         jQuery('#cs-add-to-lightbox').click(function(){
	   		 jQuery('#added-to-lightbox').show();
	   		 jQuery('#cs-add-to-lightbox').hide(); 
	   		 var lbimg = jQuery("#case-study-slideshow img.active").attr("src"); 
	   		 jQuery.post("/lightbox.php", { newimg: lbimg} );
        });
        
         jQuery('#slideshow-next').click(function(){
	   		 jQuery('#added-to-lightbox').hide();
	   		 jQuery('#cs-add-to-lightbox').show(); 
        }); 
        jQuery('#slideshow-prev').click(function(){
	   		 jQuery('#added-to-lightbox').hide();
	   		 jQuery('#cs-add-to-lightbox').show(); 
        });        
        
/*        
        jQuery('#careers-button').click(function(){
      		jQuery(this).hide();
            jQuery('#jobs-content').show('slow');
            jQuery('#careers-less').fadeIn();
      });

  	 jQuery('#careers-less').click(function(){
   			jQuery(this).hide();
            jQuery('#jobs-content').hide('slow');
            jQuery('#careers-button').fadeIn();    
        });
        
        */
        
          jQuery('#mailing-button').click(function(){
            jQuery('#mailing-content').show('slow');
      });

        
        jQuery("#clients-button[rel]").overlay();
        jQuery("#googlemap-button[rel]").overlay();
        jQuery("#lightbox img[rel]").overlay();
    
});

jQuery(function() {
	// initialize scrollable
	jQuery(".scrollable").scrollable({
		circular: true
	});
});


