//windowWidth=790;
//windowHeight=530;
//if (parseInt(navigator.appVersion) >= 4) window.moveTo((screen.width/2)-(windowWidth/2+10),(screen.height/2)-(windowHeight/2+20));

function flvS5() {
 var v1=((parseInt(navigator.appVersion)>4||navigator.userAgent.indexOf("MSIE")>-1)&&(!window.opera))?"px":"";
 return v1;
}
v5=flvS5();

function flvS7(v1,v2) {
 var v4=(document.layers)?v1:v1.style;
 eval("v4.height='"+v2+v5+"'");
}

function flvS8(v1,v2) {
 var v4=(document.layers)?v1:v1.style;
 eval("v4.left='"+v2+v5+"'");
}

function flvS9(v1,v2) {
 var v4=(document.layers)?v1:v1.style;
 eval("v4.top='"+v2+v5+"'");
}

function flvS3(v1){
 var v2=MM_findObj(v1),v3=0,v4=0,v5=0,v6=0;
 if (!v2){
  this.x=this.y=this.h=this.w=0;
  return;
 }
 var v7=((document.layers) ? v2:v2.style);
 v3=v7.left;
 v4=v7.top;
 if ((v3==""||v4=="")&&document.all && !window.opera){
  if (v3==""){
   v3=v2.offsetLeft;
  }
  if (v4==""){
   v4=v2.offsetTop;
  }
 }
 if (v2.offsetHeight) {
  v5=v2.offsetHeight;
  v6=v2.offsetWidth;
 } else if (document.layers){
  v5=v7.clip.height;
  v6=v7.clip.width;
 }
 this.x=parseInt(v3);
 this.y=parseInt(v4);
 this.h=parseInt(v5);
 this.w=parseInt(v6);
}

function ShowHideActif(prefixe, divactif, flag) {
 ShowHide(prefixe+'actif',divactif, flag);
}
function ShowHide(prefixe, divnum, flag) {
 if ((obj=MM_findObj(prefixe+divnum))!=null) {
  v=flag;
  if (v=='hide') {
   if (obj.style) {
    obj=obj.style;
    v='hidden';
   }
  } else {
   if (obj.style) {
    obj=obj.style;
    v='visible';
   }
  }
  obj.visibility=v;
 }
}

function Defile(divnom, sens) {
 var strtxt=divnom,strcont='cont'+strtxt;
 var objcont=MM_findObj(strcont),objtxt=MM_findObj(strtxt);
 if (!objcont) {
  return;
 }
 if (objcont["XAS"]!=null) {
  clearTimeout(objcont["XAS"]);
  objcont["XAS"]=null;
 }
 if (sens!=0) {
  var pas=2;
  var rctcont=new flvS3(strcont);
  var rcttxt=new flvS3(strtxt);
  var txty=rcttxt.y;
  var txth=rcttxt.h;
  var rcth=rctcont.h;
  var newtxty=txty+(pas*sens);
  if (txth<=rcth || newtxty>0) {
   newtxty=0;
  } else {
   if (newtxty<-1*(txth-rcth)) {
    newtxty=-1*(txth-rcth);
   } else {
    objcont["XAS"]=setTimeout("Defile('"+divnom+"',"+sens+")");
   }
  }
  flvS9(objtxt,newtxty);
 }
}
function GereFleches(nomdiv, preffleches) {
 var rctdivtxt=new flvS3(nomdiv);
 var rctdivcnt=new flvS3('cont'+nomdiv);
 var divtxth=rctdivtxt.h;
 var divcnth=rctdivcnt.h;
 if (divtxth<divcnth || divcnth==0) {
  ShowHide(preffleches,'plus','hide');
  ShowHide(preffleches,'moins','hide');
 } else {
  ShowHide(preffleches,'plus','show');
  ShowHide(preffleches,'moins','show');
 }
}

function Modif(table, field, trait, idname, idvalue) {
 window.open("admin/modif.php?table="+table+"&field="+field+"&action="+trait+"&idname="+idname+"&idvalue="+idvalue, "MODIF","width=796, height=500, scrollbars=yes");
}

function AddTeam(blocnum) {
 window.open("admin/addteam.php?blocnum="+blocnum, "MODIF","width=796, height=520, scrollbars=yes");
}

function ChangeOrder(table, field, sens, idname, idvalue) {
 document.location="admin/changeorder.php?table="+table+"&field="+field+"&sens="+sens+"&idname="+idname+"&idvalue="+idvalue;
}

function OuvrUpload(fichier) {
 window.open("admin/popupload.php?fichier="+fichier,"upload","width=400, height=210");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
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.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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.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_showHideLayers(prefixe, divtoshow, nbdiv) {
 for (i=1; i<=nbdiv; i++) {
  if ((obj=MM_findObj(prefixe+i))!=null) {
  v='hide';
  if (obj.style) {
   obj=obj.style;
   v='hidden';
  }
  obj.visibility=v;
  }
 }
 if ((obj=MM_findObj(prefixe+divtoshow))!=null) {
  v='show';
  if (obj.style) {
   obj=obj.style;
   v='visible';
  }
  obj.visibility=v;
 }
}

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);
