// MAJ FAVORIS
function majPerso(id_membre,idCatcheur,numCheck,champs) {
	
	if ( id_membre == 0 ) { window.setTimeout("location=('/inscription');",0) ;	
	}else{
			
		var ch = document.getElementById('prefs'+numCheck) ;
	
	
		var action  ;
		if ( ch.checked == true ) {
			action = 1 ;
		}else{
			action = 0 ;
		}
		
		
		$('span#prefs_loading'+numCheck).html('<img src="images/icones/loading.gif" />') ;
	
		
		$.ajax({
			type: 	'POST',
			url: 	'maj_prefs.php',
			data: 	'idMembre=' + id_membre + '&idCatcheur=' + idCatcheur + '&action=' + action + '&champs=' + champs + '',
			success: function(msg){
				
				$('span#prefs_loading'+numCheck).html('') ;
			}
		});
	}	
}


// DEROULEMENT JAVASCRIPT
function LiveScroll(id_div) {
	if (id_div != '') action_div(id_div);
}

function action_div(id_div) {
	var item = null;
	if (document.getElementById) {
		item = document.getElementById(id_div);
	} else if (document.all){
		item = document.all[id_div];
	} else if (document.layers){
		item = document.layers[id_div];
	}
	
	if (!item) { // rien à faire
	} else if (item.style) {
		if (item.style.display == "none") {
			item.style.display = "";
		} else {
			item.style.display = "none";
		}
	} else {
		item.visibility = "show";
	}
}


// BOX ERREUR ET OK
$(function() {	
	// On cachent les textes d'aide
	$('.inlineHelp').hide();
	
	// fading sur les boites d'erreur et de message
	$('.error_box').backgroundFade({sColor:'#000',eColor:'#ff9999',steps:50},function() {
		$(this).backgroundFade({sColor:'#ff9999',eColor:'#000'});
	});
	
	// fading sur les boites de validation
	$('.ok_box').backgroundFade({sColor:'#000',eColor:'#50e750',steps:50},function() {
		$(this).backgroundFade({sColor:'#50e750',eColor:'#000'});
	});
});