nav = navigator.appName.substring(0,3);
ver = navigator.appVersion.substring(0,1)
function addFav()
	{
	if (nav == "Mic" && ver >= 4)
		{
		url_site="http://www.lescolos.com/";
		titre_site = "Lescolos";
		document.write('<A HREF="#" class="blanc11" onClick="window.external.AddFavorite(url_site, titre_site);return(false);"><b>Ajoutez lescolos.com à vos favoris...</b></A>')
		}
	else
		{
		document.write('<span class="blanc11">Faites CTRL+D pour ajouter lescolos.com &agrave; vos favoris!</span>')
		}
	}
function findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function changeProp(objName,theProp,theValue) { //v6.0
  var obj = findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}
function checkLength(texteArea,lenghtText,maxLength)
{
  lenghtText.value = maxLength - texteArea.value.length;
  if ( lenghtText.value < 0 )
  {
    texteArea.value = texteArea.value.substr(0,maxLength);
    lenghtText.value = maxLength - texteArea.value.length;
    if (lenghtText.value == -1)
    {
    texteArea.value = texteArea.value.substr(0,maxLength-1);
    lenghtText.value = 1;
    }
  }
}

function dem_ident_o()
{
changeProp('ident_form_page','style.display','block');	changeProp('ident_ins','style.display','block');	
changeProp('id_form','style.display','block');			changeProp('ident_ins_form','style.display','none');			
changeProp('perdu_pass','style.display','block');		changeProp('ident_avert','style.display','block');
}
function dem_ident_i()
{
changeProp('ident_form_page','style.display','block');	changeProp('ident_ins','style.display','none');
changeProp('id_form','style.display','none');			changeProp('ident_ins_form','style.display','block');	
changeProp('perdu_pass','style.display','none');		changeProp('ident_avert','style.display','none');
}
function dem_ident_f(f,o)
{
changeProp('ident_form_page','style.display','none');	changeProp(f,'style.display','none');	changeProp(o,'style.display','block');
}
function menu_haut_a()
{
	changeProp('sous_mh1','style.display','none');	changeProp('mh1','style.borderBottomColor','white');
	changeProp('sous_mh11','style.display','none');	changeProp('mh11','style.borderBottomColor','white');
	changeProp('sous_mh2','style.display','none');	changeProp('mh2','style.borderBottomColor','white');
	changeProp('sous_mh3','style.display','none');	changeProp('mh3','style.borderBottomColor','white');
	changeProp('sous_mh4','style.display','none');	changeProp('mh4','style.borderBottomColor','white');
	changeProp('sous_mh5','style.display','none');	changeProp('mh5','style.borderBottomColor','white');
	changeProp('sous_mh6','style.display','none');	changeProp('mh6','style.borderBottomColor','white');
}
function menu_haut(menu)
{
menu_haut_a();
	if (menu=="sous_mh1")	{	changeProp('sous_mh1','style.display','block');	changeProp('mh1','style.borderBottomColor','#8668A9');	}
	if (menu=="sous_mh11")	{	changeProp('sous_mh11','style.display','block');	changeProp('mh11','style.borderBottomColor','#326AC6');	}
	if (menu=="sous_mh2")	{	changeProp('sous_mh2','style.display','block');	changeProp('mh2','style.borderBottomColor','#FF9933');	}
	if (menu=="sous_mh3")	{	changeProp('sous_mh3','style.display','block');	changeProp('mh3','style.borderBottomColor','#333399');	}
	if (menu=="sous_mh4")	{	changeProp('sous_mh4','style.display','block');	changeProp('mh4','style.borderBottomColor','#669933');	}
	if (menu=="sous_mh5")	{	changeProp('sous_mh5','style.display','block');	changeProp('mh5','style.borderBottomColor','#CC0066');	}
	if (menu=="sous_mh6")	{
	changeProp('sous_mh6','style.display','block');	changeProp('mh6','style.borderBottomColor','#8090B8');
	changeProp('head_membres','style.display','block');changeProp('ident_menu','style.display','block');
	changeProp('ident_form','style.display','none');	
	}
	if (menu=="sous_mh7")	{	changeProp('sous_mh7','style.display','block');	changeProp('mh7','style.borderBottomColor','#F4EB00');	}
}

function lc_onload(){
nav = navigator.appName.substring(0,3);
	if (screen.width < 1050)		{ changeProp('cont_general','style.width','100%'); }
	if (screen.width > 1050)		{ changeProp('cont_general','style.width','1000px'); }
}
function change_hiden(champ,v)
{
document.getElementById(champ).value=v;
}

function eval_select_rech(f)
{
	var xhr_object = null;
	
	if(window.XMLHttpRequest) // Firefox
		xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) // Internet Explorer
		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");

	var method   = "POST";
	var filename = "XMLHttpRequest.php";
	var s1		=f.elements["rech_select"].value;
	var data     = null;
	
	if(s1 != "" )
		data = "s1="+s1;
		
	xhr_object.open(method, filename, true);
	
	xhr_object.onreadystatechange = function anonymous() {
		if(xhr_object.readyState == 4) {
	  		if (document.getElementById)
    		{
    		document.getElementById("text_form").innerHTML = xhr_object.responseText;
    		}
  			else if (document.all) 
    		{
    		document.all["text_form"].innerHTML = xhr_object.responseText;
    		}
		}
	}

	if(method == "POST")
		xhr_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

	xhr_object.send(data);
}

function ann_modif_form_go(etape)
{
var ann_tpe_r=document.getElementById('ann_tpe_r').value;
	if (ann_tpe_r==1)
	{
		if (etape==1)		{		changeProp('ann_f_1','style.display','none');		changeProp('ann_f_2','style.display','block');		}
		if (etape==2)		{		changeProp('ann_f_2','style.display','none');		changeProp('ann_f_3','style.display','block');		}
		if (etape==3)		{		changeProp('ann_f_3','style.display','none');		
				if (document.getElementById('ann_nb_enf').value>1)
				{		changeProp('ann_f_5','style.display','block');}		else		{		changeProp('ann_f_4','style.display','block'); }
							}
		if (etape==4)		{		changeProp('ann_f_5','style.display','none');		changeProp('ann_f_4','style.display','none');
				if (document.getElementById('ann_nb_enf').value>1)
				{		changeProp('ann_f_6','style.display','block');}		else		{		changeProp('ann_f_7','style.display','block'); }
							}
		if (etape==6)		{		changeProp('ann_f_7','style.display','none');		changeProp('ann_f_8','style.display','block');		}
		if (etape==7)		{		changeProp('ann_f_6','style.display','none');		changeProp('ann_f_8','style.display','block');		}
		if (etape==8)		{		changeProp('ann_f_8','style.display','none');		changeProp('ann_f_9','style.display','block');		}
		if (etape==9)		{		changeProp('ann_f_9','style.display','none');		changeProp('ann_f_13','style.display','block');		}
		if (etape==13)		{		changeProp('ann_f_13','style.display','none');		changeProp('ann_f_14','style.display','block');		}
		if (etape==14)		{		changeProp('ann_f_14','style.display','none');		changeProp('ann_f_99','style.display','block');		}
	}
	if (ann_tpe_r==2)
	{
		if (etape==1)		{		changeProp('ann_f_1','style.display','none');		changeProp('ann_f_11','style.display','block');		}
		if (etape==11)		{		changeProp('ann_f_11','style.display','none');
				if (document.getElementById('ann_tpe_gpe').value==1)
				{		changeProp('ann_f_5','style.display','block');}		else		{		changeProp('ann_f_12','style.display','block'); }
		
							}
		if (etape==4)		{		changeProp('ann_f_5','style.display','none');		changeProp('ann_f_12','style.display','block');		}
		if (etape==12)		{		changeProp('ann_f_12','style.display','none');		changeProp('ann_f_6','style.display','block');		}
		if (etape==7)		{		changeProp('ann_f_6','style.display','none');		changeProp('ann_f_8','style.display','block');		}
		if (etape==7)		{		changeProp('ann_f_6','style.display','none');		changeProp('ann_f_8','style.display','block');		}
		
	}
}

