$(document).ready(function() 
{
 	//alert('Jquery loaded!');
 	
 	$(".howto").click(function(){
 	 	$(this).fadeOut("slow");
 	 	showPageInstructions($(this));
 	});

 	$(".popup_close").click(function(){
 		hidePageInstruction();
 		$("#hiddenPPPBar").fadeOut();
 	});
 	
 	$("#hiddenPPPBar").addClass('popup');
 	$("#hiddenPPPBar").fadeIn("slow");
 	
 	if($('#gift').attr('checked'))
 	{
 		showhide('gift','folder');
 	}
 	
 	
 	$(".foldable h4").addClass('js_fold'); 	
 	$(".foldable .foldContent").hide();
 	$(".foldable h4").css("background", "#DDD");
 	$(".foldable .foldContent").css("padding-left", "10px");
 	$(".foldable h4").click(function()
 	{
 		$(this).parent().find(".foldContent").toggle("slow");
 	});
 		
});



function showPageInstructions(element)
{
	$('#popup #title').html("Info");
	$('#popup #content').html(element.attr("title"));	
	$('#popup').fadeIn("fast");
}

function hidePageInstruction()
{
	$('#popup').fadeOut("fast");
	$('.howto').fadeIn("slow");
}


$(".ad").mouseover(function()
{
 	$(this).alpha  = 0.5;
});

$(".ad").mouseout(function()
{
	$(this).alpha  = 1;
});

