TO_LOAD_INDEX++;
TO_LOAD[TO_LOAD_INDEX]='load_truepopups();';

function load_truepopups(){
	// Les vrais popups

	$(".truePopup").click(function(){
		var rev=$(this).attr('rev');
		if(!rev || rev==''){
			var n='PopupFS'+randval(1000,9999).toString();
		}else{
			n=rev;
		}

		$(this).attr('rel',$(this).attr('rel').replace(/screen.height/,screen.height));
		$(this).attr('rel',$(this).attr('rel').replace(/screen.width/,screen.width));
		window.open($(this).attr('href'),n,$(this).attr('rel'));
		return false;
	});

	$(".truePopupMaxScreen").click(function(){
		var rev=$(this).attr('rev');
		if(!rev || rev==''){
			var n='PopupFS'+randval(1000,9999).toString();
		}else{
			n=rev;
		}
		var params=$(this).attr('rel');

		var couples=params.split(',');
		var e;
		var v;
		for(var i=0;i<couples.length;i++){
			e=couples[i].split('=');
			if(e[0]=='width'){
				v=parseInt(e[1]);
				v=Math.min(screen.width,v);
				e[1]=v.toString();
			}else if(e[0]=='height'){
				v=parseInt(e[1]);
				v=Math.min(screen.height,v);
				e[1]=v.toString();
			}
			couples[i]=e.join('=');
		}
		params=couples.join(',');
		window.open($(this).attr('href'),n,params);
		return false;
	});

	$(".popupFS").click(function(){
		var rev=$(this).attr('rev');
		if(!rev || rev==''){
			var n='PopupFS'+randval(1000,9999).toString();
		}else{
			n=rev;
		}
		window.open($(this).attr('href'),n,'width='+screen.width+',height='+screen.height+',resizable=yes');
		return false;
	});

	$(".popupA4").click(function(){

		var rev=$(this).attr('rev');
		if(!rev || rev==''){
			var n='PopupFS'+randval(1000,9999).toString();
		}else{
			n=rev;
		}
		var h=screen.height;
		var w=h/1.5;
		window.open($(this).attr('href'),n,'width='+w+',height='+h+',resizable=yes');
		return false;
	});
}
