PortFolio = function(){ 
    this.init();
}

PortFolio.prototype = { 

  do_with_ajax : false,

  init: function() {
    var t = this
    t.behaviour()
  },
  
  behaviour: function() {	
    var t = this
    // overview page
    $('.mirror').each(function() {
			// hover behaviour to logos
    		$(this).mouseover(function() {
    			$(this).addClass('border')
    			$('[rel='+$(this).attr('id')+']').parent().addClass('selected') // highlights the related entry in the nav
			});
			$(this).mouseout(function() {
    			$(this).removeClass('border')
    			$('[rel='+$(this).attr('id')+']').parent().removeClass('selected')
			});
			// onClick we get the portfolio item
			$(this).click(function() {
				window.location.href = '/portfolio/'+$(this).attr('id')+'/'
				return false;
			});
	});
		
    $('ul.portfolio li').each(function() {
    	 $(this).mouseover(function() {
    		$(this).addClass('selected');
    		$('#'+$(this.firstChild).attr('rel')).addClass('logoborder');  // decorate logo image. rel attr holds ID
    	 });
         $(this).click(function() {
          	window.location.href = '/portfolio/'+$(this.firstChild).attr('rel')+'/'
			return false;
         });
    	 $(this).mouseout(function() {
    		$(this).removeClass('selected');
    		$('#'+$(this.firstChild).attr('rel')).removeClass('logoborder');
         });
    });
	
	
    

  
  },
  // populates the player via AJAX by requesting a project section which is returned as rendered HTML
  fetch: function(project, section){ 
	//
    var t = this;
    $.ajax({
        type: 'GET',
        url: '/portfolio/'+project+'/'+section+'/',
        success: function(response){
			alert('responded')
   
        }
    })
  }
  // end prototype methods

};



$(document).ready(function() {

  var portfolio = new PortFolio()
 
  
}); // end