//<!--
function showDiv(nomDiv,etat){
	var etat;
	var dNomDiv=document.getElementById(nomDiv);
	
	if(document.getElementById(nomDiv+"Close")){
		var dNomDivClos=document.getElementById(nomDiv+"Close");
		
	}
	
	if(etat){
		dNomDiv.style.display=etat;
		if(dNomDivClos){
			dNomDivClos.style.display=etat;
		}
	}
}
function affiflash(nom,w,h,t,v){
	if(!w) var w="553";
	if(!h) var h="95";
	if(!v) var v="";
	if(v) var vt=" FlashVars=\""+v+"\" ";
	if(!t) var t=" wmode=transparent ";
	else var t="";
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width="+w+" height="+h+">");
  document.write("<param name=\"movie\" value=\""+nom+"\">");
  document.write("<param name=\"quality\" value=\"high\">");
  document.write("<param name=\"FlashVars\" value=\""+v+"\">");
  if(t)document.write("<param name=\"wmode\" value=\"transparent\" />");
  document.write("<embed src="+nom+" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width="+w+" height="+h+"  "+t+" "+vt+"></embed>");
  document.write("</object>");
}

function TabbedPane(tabs,ini,mouvement){
	initia(tabs,ini);
	//var mouvement="click";
	if(!mouvement)var mouvement="mouseover";
	for (id in tabs) {
		Event.observe(id, mouvement, function(e) {
			for (id in tabs){
				$(id+"bis").removeClassName('active');
				$(id+"Cont").hide();
			}

			elt = Event.element(e).readAttribute('id');
			
			$(elt+"bis").addClassName('active');
			$(elt+"Cont").show();
			
			Event.stop(e);
		});
	}
}
function initia(tabs,ini){
	for (id in tabs){
		if(id==ini){
			$(id+"Cont").show();
		}else{
			$(id+"Cont").hide();
		}
	}
}
// SCRIPT MEMBRE //
function testFormAvis(nameForm,btn){ 
		Event.observe(btn, 'click', function(e){
			var tabelet=$(nameForm).getElements();
 			//alert(tabelet.inspect());
 			for (i=0 ; i < tabelet.length; i++){
 				var divIdErr=tabelet[i].id+"_err";
 				if($(divIdErr)){
					$(divIdErr).removeClassName("erreur_no");
					$(divIdErr).innerHTML="";
				}
			}
			for (i=0 ; i < tabelet.length; i++){
				var nameId = tabelet[i].id;
			//	alert(tabelet[i].inspect() +" ==> type==>"+$(nameId).type);
				var divIdErr=nameId+"_err";
				if(!$F(tabelet[i]) && $(divIdErr)){
					
					//$(divIdErr).show();
					$(divIdErr).addClassName("erreur_no");
					
					$(divIdErr).innerHTML="L'information est requise";
					if($(nameId).type!="hidden")$(nameId).focus();
					return false;
				}
			}
			validFormAvis(nameForm);
			Event.stop(e);
		})
}
function validFormAvis(nameForm){
 //	alert("la");
	var param=$(nameForm).serialize();
				new Ajax.Updater("divAjoutAvis","http://www.gralon.net/ajax/valide_ajout_avis.php",{
						asynchronous: true, 
						method: 'post',
						evalScripts:true,
						parameters : param ,
					onCreate: function(e) { 
					//	$('reponseAjout').hide();
	          $('reponseAjout_overlay').show();
	        },
	        onSuccess: function(e) {
	        		$('reponseAjout_overlay').hide();
	        	//	Effect.BlindDown('reponseAjout');
	           // $('resultDispo').show();
					}
				});
}

function valdSsTest(nameForm,btn){
		Event.observe(btn, 'click', function(e){
			validFormAvis(nameForm);
			Event.stop(e);
		})
}
function testPseudo(){
//	alert($(nameForm).serialize());
	var param="q="+$("pseudo").value;
				new Ajax.Updater("divreponse","/ajax/verif-pseudo.php",{
						asynchronous: true, 
						method: 'post',
						parameters : param ,
					onCreate: function(e) { 
					//	$('reponseAjout').hide();
	          $('divreponse_wait').show();
	        },
	        onSuccess: function(e) {
	        		$('divreponse_wait').hide();
	        	//	Effect.BlindDown('reponseAjout');
	           // $('resultDispo').show();
					}
				});
}
//-->

