// JavaScript Document



/*
     portfolioUpdate
     
     function fires when portfolio thumbnails are clicked
     updates the main content with additional portfolio content
*/
function portfolioUpdate( xid ) {

     var img_id = '#img'+xid;
     var content_id = '#cnt'+xid;
     
     var title = $(content_id).find(".h1").html();
     
     //if thumbnail is already selected
     var obj = $(img_id).attr("src");
     if( obj == '/images/v2/portfolio/thumb-border-active.gif' ){
          var url = $(content_id).find(".picnt a").attr('href');
          //alert( url );
          
          
          
          pageTracker._trackEvent('Portfolio', 'Click2', title );
          
          window.location = url;
          
     } else {
     //first click
     
          pageTracker._trackEvent('Portfolio', 'Click1', title ); 
     
     }
     
     //change image to show selected border
     $(".pithumb img").attr("src","/images/v2/portfolio/thumb-border.gif"); 
     $(img_id).attr("src","/images/v2/portfolio/thumb-border-active.gif");
     
     //update the main area with content from selected item
     var htmlStr = $(content_id).html();
     $(".pitem").html( htmlStr ); 

}
