



jQuery.extend({


display: function(div, newhtml){
	    $(div).html(newhtml);
	    },    
	    
	    

portfolio: function(item){	    
		
	    var path 		= 'portfolio/';
	    var pretitle 	= 'Project15 - Portfolio - ';
	    var itemslist 	= '#content_left';
	    var heading 	= '#heading h2';
	    var div_portfolio	= '.portfolioitem';	
	    var class_active	= 'active';
	    var loading 	= '<span style="color:#98CC00;">loading...</span>';
	    var fadetime	= 1500;
	    
	
	    
	    
	    
	    var itemtitle = item.attr('title');
	    var itemlink  = item.attr('rel');
	    var strHref   = item.attr('href');
	    var strQueryString = strHref.substr(strHref.indexOf("#")+1);	
	    
	    location.href = item.attr('href');	
	    $(div_portfolio).hide().load(path+strQueryString);		
	    $.display(heading,loading);
		
	    $().ajaxStop(function(){			
			$(div_portfolio).html("<img src='"+path+strQueryString+"' width='510' height='220'>");			
			$(div_portfolio).fadeIn(fadetime);						
			$(heading).html(itemtitle);
			$('#pname').html(itemtitle);
			if(itemlink != null){
			$('.action a').attr('href',itemlink);
			}
			});  		
				
		
	    
	    
	$("#content_left a").removeClass(class_active);
			
	document.title = pretitle+itemtitle;
	item.addClass(class_active);
	item.blur();
	return false;
			
			
	    }

});



$(document).ready(function() {
	    
	    l = location.href;
	    q = l.substr(l.indexOf("?")+1);
	
	
	    $("#content_left a").click(function() {
			var item = $(this);			
			$.portfolio(item);
			return false;
			});	   	    
	    

	    if(q){
	    $("#content_left").find("a").each(function(i) {
			if($(this).attr('href') == q){
			var item = $(this);
			$.portfolio(item);
			}
			});
	    }
	    
});