	var current_selected = '';
	
	$(".module-box").click(function() 
	{
		selected('#'+this.id+'-2');
		loadinf('#'+this.id+'-content');
		
		$.fancybox({
			'href'				: '#modal',
			'padding'			: '0',
			'width'				: '885px',
			'height'			: '510px',
			'scrolling'			: 'no',
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic'
		});
    });
	
	
	$(".module-side-box").click(function() 
	{
		selected('#'+this.id);
		loadinf('#'+this.id.substring(0,this.id.length-2)+'-content');
    });
	
	
	function selected(element)
	{
		if(current_selected!='')
		{
		
			$(current_selected).removeClass('selected');
			current_selected	= element;
			$(current_selected).addClass('selected');
		
		}else
		{
			current_selected	= element;
			$(current_selected).addClass('selected');
		}
		
		return false;
	}
	
	function loadinf(element)
	{
		
		$('#modal-content').fadeOut('fast', 
			function()
			{
				$("#modal-content").html($(element).html());
				$("#modal-content").fadeIn();
			}
		);

		return false;
	}
	
