$(document).ready(
	function()
	{
		$('#contentBox').DropInUp(300);
		// Hide boxes on startup : do not modify
		$('div.box').hide();
		$('div.popup').hide();
		// Minimize function : do not modify
		$('a.minimize').bind('click', toggleContent);
		// Close function : do not modify
		$('a.close').bind('click',function()
				{
					$(this.parentNode.parentNode.parentNode).hide();
				}
			);
		$('a.closePopup').bind('click',function()
			{
				$(this.parentNode).hide();
			}
		);
		// Draggable function : do not modify
		$('div.box').Draggable(
			{
				ghosting:	true,
				opacity:	0.5,
				fx:			400,
				zIndex:		1
			}
		);
		$('div.popup').Draggable(
			{
				ghosting:	true,
				opacity:	0.5,
				fx:			400,
				zIndex:		1
			}
		);
		$('#contentBox').Draggable(
			{	
				handle:		'div.contentHeader',
				ghosting:	true,
				opacity:	0.5,
				fx:			400,
				zIndex:		2
			}
		);
	}
);

// popup
$("a").filter("[@class^=viewPage]").click(function() {	
	$('div.popup').hide();	
	var monId=$(this).attr("class");
	var Longueur = monId.length;
	var monId2 = monId.substring(8, Longueur)
	$('#popUp'+monId2+'').show().css({ position: "absolute", top: "120px", left: "405px" });
	$('#popUp'+monId2+'').DropInUp(300);
	return false;
});

// Minimize function : do not modify
var toggleContent = function(e) {
	var targetContent = $('div.xtraContent', this.parentNode.parentNode.parentNode);
	if (targetContent.css('display') == 'none') {
		targetContent.slideDown(300);
	}else{
		targetContent.slideUp(300);
	}
	return false;
};
