$(document).ready(function() {

	$('a.panel').click(function () {

		$('a.panel').removeClass('selected');
		$(this).addClass('selected');
		
		current = $(this);
		
		$('#wrapper').scrollTo($(this).attr('href'), 800);		
		
		return false;
	});

	$(window).resize(function () {
		resizePanel();
	});
	
	$('#clickWeb').click(function() {
      $('#workWeb').fadeIn('slow', function() {
      });
    });
	
$('#clickPrint').click(function() {
      $('#workPrint').fadeIn('slow', function() {
      });
    });
	
	$('#closeWeb').click(function() {
      $('#workWeb').fadeOut('slow', function() {
      });
    });
	
	
$('#closePrint').click(function() {
        $('#workPrint').fadeOut('slow', function() {
        });
    });
	
	$('#clickOther').click(function() {
		$('#workOther').fadeIn('slow', function() {
		});
	});	
	
	$('#closeOther').click(function() {
        $('#workOther').fadeOut('slow', function() {
        });
    });
	
	$('#exitError').click(function() {
		$('#error').fadeOut('slow', function() {
		});
	});
});

function resizePanel() {

	width = $(window).width();
	height = $(window).height();

	mask_width = width * $('.item').length;
		
	$('#debug').html(width  + ' ' + height + ' ' + mask_width);
		
	$('#wrapper, .item').css({width: width, height: height});
	$('#mask').css({width: mask_width, height: height});
	$('#wrapper').scrollTo($('a.selected').attr('href'), 0);
		
}
