$(document).ready(function() {
		/* effet focus sur champs formulaire */
		var CLogin = $('#ConnectForm input:text');
		CLogin.val('pseudo');
		var CPass = $('#ConnectForm input:password');
		CPass.val('pass');
		CLogin.focus(function(){
		if (CLogin.val() == 'pseudo'){CLogin.val('')}});
		CLogin.blur(function(){
		if (CLogin.val() == ''){CLogin.val('pseudo')}});
		CPass.focus(function(){
		if (CPass.val() == 'pass'){CPass.val('')}});
		CPass.blur(function(){
		if (CPass.val() == ''){CPass.val('pass')}});
				var SearchPseudo = $('#ConnectSearch input:text');
		SearchPseudo.val('Recherchez un utilisateur');
	
		var SearchPseudoEn = $('#ConnectSearchEn input:text');
		SearchPseudoEn.val('Search users');

		SearchPseudo.focus(function(){
		if (SearchPseudo.val() == 'Recherchez un utilisateur'){SearchPseudo.val('')}});
		SearchPseudo.blur(function(){
		if (SearchPseudo.val() == ''){SearchPseudo.val('Recherchez un utilisateur')}});
	
		SearchPseudoEn.focus(function(){
		if (SearchPseudoEn.val() == 'Search users'){SearchPseudoEn.val('')}});
		SearchPseudoEn.blur(function(){
		if (SearchPseudoEn.val() == ''){SearchPseudoEn.val('Search users')}});
		
		
		
		/* Tooltip */
			$("#Deconnect a, #new_mess a, .tooltip").qtip({
				content: {attr: 'title'},
				position: {my: 'top right',at: 'bottom left',viewport: $(window),adjust: {y: 10}},
				hide: {fixed: true,effect: function(offset) {$(this).slideFadeToggle(300);}},
				show: {effect: function(offset) {$(this).slideFadeToggle(300);}}});

		$.fn.slideFadeToggle  = function(speed, easing, callback) {return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);};
		
		/* menu onglets */
		$('#NavCon ul li').hover(
		function(){$(this).find('ul').stop(true, true).slideFadeToggle(300);}, 
		function () {$(this).find('ul').stop(true, true).slideFadeToggle(200);});
		/* ------------ */
		
		$("#carousel_prises li, .bloc_membre,.TblMenu div, div.bloc_groupes").each(function(){
			$(this).qtip({content: {text: $(this).children('.caption_tooltip')},
				style: {maxWidth: 194},
				position: {my: 'bottom center',at: 'top center',viewport: $(window)},
				hide: {fixed: true,delay: 300,effect: function(offset) {$(this).slideFadeToggle(300);}},
				show: {effect: function(offset) {$(this).slideFadeToggle(300);},
				delay: 500}
			});
		});
		$('.imgtooltip').qtip({
				content: {attr: 'alt'},
				style: {maxWidth: 194},
				position: {my: 'bottom center',at: 'top center',viewport: $(window)},
				hide: {fixed: true,delay: 300,effect: function(offset) {$(this).slideFadeToggle(300);}},
				show: {effect: function(offset) {$(this).slideFadeToggle(300);},
				delay: 500
				}
			});

		/* animation opacity */
		$(".appli_android,.appli_iphone, .footerCol3 img, #carousel_prises img, .bloc_membre img, .bloc_groupes, #Flags img, a img").hover(
		function(){$(this).stop(true, true).animate({opacity: '0.7'}, 500);}, 
		function () {$(this).stop(true, true).animate({opacity: '1'}, 200);});
		
		/* Tableaux membres */
		$('tr.TblMbr_tr:even').css('background-color', '#F9F7F4');
		
		$('tr.TblMbr_tr:even').mouseover(function(){$(this).css('background-color', '#ffffff');}).mouseout(function(){$(this).css('background-color', '#F9F7F4');});
		setTimeout(function(){$("div.divmessage").fadeOut("slow", function () {$("div.divmessage").remove();});}, 2000);		
    	});
