$( document ).ready( function() {
	$("a").each( function() {
		if($(this).hasClass("boost")){
			if(!($(this).hasClass("test"))){
				$(this).click( function() {
					var img = $(this).children()[0];
					$.ajax({url:"/out-boost.php",type:"GET",data:"img="+$(img).attr("src")});
				});
			}
		} else {
			var h = window.location.host;
			var l = $(this).attr("href");
			if((l.lastIndexOf(h)==-1)&&(l.substring(0,1) != "/")){
				$(this).click( function() {
					$.ajax({url:"/out.php",type:"GET",data:"i="+$(this).attr("rel")});
				});
			}
		}
	} );
	$("img.thumb").hover( function(e) {
		$(".info-texte").html( $(".site-description[rel='"+$(this).attr("rel")+"']").html() );
		$("#info-bulle").show();
	}, function() {
		$("#info-bulle").hide();
	} ).mousemove( function(e) {
		$("#info-bulle").css( {
			top: e.pageY - 5 - $("#info-bulle").height(), 
			left: e.pageX - 5
		} );
	} );
	blink( ".blink" );
} );

function is_email( e ) {
	var r = new RegExp("^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$");
	return r.test(e);
}
function is_url( e ) {
	var r = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
	return r.test(e);
}
function blink( e ) {
	$(e).toggleClass("hidden");
	window.setTimeout( function () { blink( e ); }, 500 );
}
function randomize( t ) {
	var i, num;
	var nb = t.length;
	var tab = new Array();
	tab = tab.concat(t);
	while( nb > 0) {
		num = Math.floor(Math.random() * nb);
		nb --;
		szTmp = tab[num];
		for( i= num; i < nb; i++) {
			tab[i] = tab[i+1]
		}
		tab[nb] = szTmp;
	}
	tab.reverse();
	return tab;
}
