// JavaScript Document

function rw_url(url){
	window.location.hash = url;
	return true;
}

function switch_flag(id){
	var last_flag = document.getElementById('last_flag').value;
	document.getElementById('flag_'+last_flag).className = 'flag_off';
	document.getElementById('flag_'+id).className = 'flag_on';
	//--
	document.getElementById('cont_'+last_flag).style.display = 'none';
	document.getElementById('cont_'+id).style.display = 'block';
	document.getElementById('texte_article_'+id).style.width = '580px';
	//--
	//document.getElementById('cont_'+last_flag).style.visibility = 'hidden';
	//document.getElementById('cont_'+id).style.visibility = 'visible';
	//--
	document.getElementById('last_flag').value = id;
}

function unpop(id){
	document.getElementById(id).style.display = "none";
}

function class_switch(id, action){
	var nav = navigator.appName;
	if(action == 'over' ){
		var class_obj = document.getElementById(id).className;
		document.getElementById(id).className = class_obj+"-hover";
	}else if(action == 'out'){
		var class_array = document.getElementById(id).className;
		var class_obj = class_array.split('-');
		document.getElementById(id).className=class_obj[0];
	}
}

function plop(id,t){
	if( t == 'v'){
		document.getElementById(id).style.visibility = "visible";
	}else{
		document.getElementById(id).style.display = "block";
	}
}

function unplop(id,t){
	if( t == 'v'){
		document.getElementById(id).style.visibility = "hidden";
	}else{
		document.getElementById(id).style.display = "none";
	}
}

function vide(id){
		document.getElementById(id).value = '';
}

function clean(x){
	document.getElementById(x).value = "";
}

function check_search(){
	var W = document.getElementById('word').value;
	var L = new Number (W.length);
	if ( L<3 ) {
		alert (document.getElementById('search_alert_a').value);	
		return false;
	}else{
		var courant = "leur:leurs:est:ils:nous:vous:sont:été:mais:donc:souvent:toujours";
		var Ac = courant.split(':');
		var AcL = Ac.length;
		var N = true;
		for ( a = 0; a<L ; a++){
			if(W == Ac[a]){
				N = false;
			}else{
				//alert ( Ac[a]+" = "+W+" ? ");
			}		
		}
		if( N==true){ return true; }else{ alert (document.getElementById('search_alert_b').value)+" ("+Ac[a]+")";	return false;}
		/*
		if(N!=0){
			alert (document.getElementById('search_alert_b').value);	
			return false;
		}else{
			return true;
		}
		*/
	}
}





