// JavaScript Document

function startUpFunc() {
	randomNum = Math.random() * 150;
	randomNum = Math.round(randomNum);
	
	if(randomNum <= 50) {
		if(randomNum < 15) { pagetopop = 1; }
		if(randomNum >=15 && randomNum <= 20) { pagetopop = 2; }
		if(randomNum >=20 && randomNum <= 25) { pagetopop = 3; }
		if(randomNum > 25 && randomNum <= 30) { pagetopop = 4; }
		if(randomNum > 30 && randomNum <= 35) { pagetopop = 5; }
		if(randomNum > 35 && randomNum <= 40) { pagetopop = 6; }
		if(randomNum > 40 && randomNum <= 45) { pagetopop = 7; }
		if(randomNum > 45) { pagetopop = 8; }

		$("#pub_"+pagetopop).css('display',"block");
	}
}

(function($) { 
	$(document).ready(function(){
		$("#desc1more").click(function() {
			if($("#desc1").css('display') == "block") {
				$("#desc1").css('display',"none");
				$("#desc2").css('display',"block");
			}
		});
		
		$(".pubclose").click(function() {
			$("#"+this.rel).css('display',"none");
			// Repopup foireux ;)
			startUpFunc();
		});
	});
 })(jQuery)