// JavaScript Document

$(document).ready(function(){
						   
	$(function() {
	  $defaultdescription = $("#nav-description").html();
	  
	  $('.rollover').hover(function() {
		   $(this).fadeOut(100);
		   var currentImg = $(this).attr('src');
		   $(this).attr('src', $(this).attr('hover'));
		  $(this).attr('hover', currentImg);
		  $(this).fadeIn(400);						
	   }, function() {
		   var currentImg = $(this).attr('src');
		   $(this).attr('src', $(this).attr('hover'));
		   $(this).attr('hover', currentImg);
		  
	   });  
	  
	  	
	});
	
	
	$('.topnavigation a').hover(
		function() {
		  $("#nav-description").html($(this).attr('rel'));	 
	 }, function() {
		  $("#nav-description").html($defaultdescription);
	});
	
	
	$('.nav-thumb').hover(
	function() {
		if ($(this).hasClass("active-thumb")==false){
		 $('.nav-thumb').each(function(idx,el){  el.style.opacity=''; });
		  $(this).animate({"opacity": 1.0},0);
		 }
	 }, function() {
		  if ($(this).hasClass(".active-thumb .nav-thumb")==false){
		  	$(this).each(function(idx,el){  el.style.opacity=''; });
		 }
		
	});
	
	
	$(".portfolio_list a").click(function (e) {
	 e.preventDefault();
	 $new = $(this);
	$('#selected_item').fadeOut(200,function(){
		$('#selected_item').attr('src',$new.attr('href'));
		$('#selected_item').attr('alt',$new.attr('title'));
	});
	$('#selected_item').fadeIn(500);
		
    }); 
	
});


