
var miny = 71
var maxy = 91
var ouvert = 0
var nbdiv=5
var posy = new Array();
var maxy=91
var miny=71
var top, doc

function Init(){
	var i
	for (i=1;i<=nbdiv;i++) {posy[i]=miny}
	AA_animmenu();
	MM_preloadImages('/images/fond_onglet.gif');
}

function AA_animmenu(){
	for (var i=1;i<=nbdiv;i++){
		if (ouvert==i){posy[i]++} else {posy[i]--}
		if (posy[i]>maxy){posy[i]=maxy}
		if (posy[i]<miny){posy[i]=miny}
		placeobj(i,posy[i])
	}
	setTimeout("AA_animmenu()",15)
}

function placeobj(objet,y){
	document.getElementById('l'+objet).style.top = y + 'px'
}

function AA_close(){ouvert=0}

function AA_open(z){ouvert=z}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  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=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function getXmlHttp(){ 
	var oq
	if(window.XMLHttpRequest){
		oq= new XMLHttpRequest();}
	else if (window.ActiveXObject){
		oq = new ActiveXObject("Microsoft.XMLHTTP");}
	else{
		alert("Impossible d'instancier l'objet XMLHTTP");
		return;}
	return oq
}

function sendpw(i){
	var ro = getXmlHttp()
	ro.open("GET","partenaires.ajax?email=" + document.getElementById("TBMail").value +'&fksociete='+i, true)
	ro.send(null)
	document.getElementById("mdp").innerHTML = "Recherche en cours"
	ro.onreadystatechange=function(){
		if(ro.readyState==4){document.getElementById("mdp").innerHTML = ro.responseText}
	}
}

// ##### ANIMATION FLASH #####
function CreateFlash(id, chemin, width, height, vars){
    //id : id de l'element dans lequel on va ecrire le flash
    var d = document.getElementById(id);
    var flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '">' +
    '<param name="movie" value="' + chemin + '" />' +
    '<param name="quality" value="high" />' +
    '<param name="wmode" value="transparent" />' +
    '<param name="flashvars" value="' + vars + '">' +
    '<embed src="' + chemin + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" flashvars="' + vars + '" width="' + width + '" height="' + height + '"></embed></object>'

    d.innerHTML = flash
}

function changeOnglet(el){
	var objs = $('ongletscontenu').select('DIV#volet1, DIV#volet2, DIV#volet3, DIV#volet4, DIV#volet5, DIV#volet6, DIV#volet7, DIV#volet8, DIV#volet9, DIV#volet10, DIV#volet11, DIV#volet12, DIV#volet13')
	objs.each(function(node){if (node) {node.hide()}}) 
	var ongs = $('menuOnglets').select('TD#item1, TD#item2, TD#item3, TD#item4, TD#item5, TD#item6, TD#item7, TD#item8, TD#item9, TD#item10, TD#item11, TD#item12, TD#item13')
	ongs.each(function(node){if (node) {node.className = ""}}) 
	$('item'+ el).className = "active";
    	$('volet'+ el).show();		   
}
