// JavaScript Document for cadre3 nostradamus.nostradamia.com
var D = document;
var NatWidth = new Array;
var NatHeigh = new Array;
var ns4 = D.layers, ie4 = D.all, ns6=D.getElementById&&!D.all, isFF = (navigator.userAgent.indexOf("Firefox") > -1)  ? true : false, isNS = (navigator.appName == "Netscape") ? true : false, isOP = (navigator.userAgent.indexOf("Opera") > -1)  ? true : false, isSF = (navigator.userAgent.indexOf("Safari") > -1)  ? true : false, isNotAuto = ( isFF || isNS || isSF);
var factorW,ScrWdt,ScrollWdt,factorH=1,ScrHgt,ScrollHgt,factorWH=1,factorImWH=1,numScrWdt,numScrHgt;
//Communes NS IE

 function AreaPosition()
 {
 SmBAdjH = 0;
  if(isNS)
  {
  ScrWdt = window.innerWidth;
  ScrHgt = window.innerHeight;
  }
  else
  {
  ScrWdt = D.body.clientWidth;
  ScrHgt = D.body.clientHeight;
  }
   if(D.getElementById("popSmiley"))
   {
   D.getElementById("popSmiley").style.top='150px';
   D.getElementById("popSmiley").style.left=(ScrWdt-230)+'px';
   }
  if(D.getElementById("pop"))
  AdOpen("pop");
  
  if(D.getElementById("RszFulldoc"))
  D.getElementById("RszFulldoc").style.visibility='visible'; //this
 }

/*
//Fonctions boutons menu
 function MM_findObj(n, d) 
 {
 var p,i,x
  if(!d) d=D
  if((p=n.indexOf("?"))>0&&parent.frames.length) 
  {
  d=parent.frames[n.substring(p+1)].D
  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].D)
   if(!x && d.getElementById) 
   x=d.getElementById(n)
   return x
 }

 function MM_swapImage()
 {
 var i,j=0,x,a=MM_swapImage.arguments
 D.MM_sr=new Array
 for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null)
  {
  D.MM_sr[j++]=x
   if(!x.oSrc) x.oSrc=x.src
   x.src=a[i+2]
  }
 }
 function MM_swapImgRestore() 
 {
 var i,x,a=D.MM_sr
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
  x.src=x.oSrc
 }
 function MM_preloadImages() 
 {
 var d=D
  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 PostDisplay(id,num)
 { 
 Ms="Msg"+num
 Au="Auth"+num
 Cl="ImgClo"+num
  //Display
  if(D.getElementById(id).style.display=='none')
  {
   if(isNS)
   D.getElementById(id).style.display='table-cell'
   else 
   D.getElementById(id).style.display='block'
  }
  else 
  D.getElementById(id).style.display='none'
 //Imgcolor
 Author = D.getElementById(Au).style.display
 Messag = D.getElementById(Ms).style.display
  if(Author == 'none' && Messag == 'none')
  D.getElementById(Cl+'A').src='../../9Bd/Forum/skins/defaut/OpenAll.gif'
  else
  D.getElementById(Cl+'A').src='../../9Bd/Forum/skins/defaut/CloseAll.gif'
 }

 function PostClOpAll(num)
 {
 Ms="Msg"+num
 Au="Auth"+num
 Cl="ImgClo"+num
 Author = D.getElementById(Au).style.display
 Messag = D.getElementById(Ms).style.display
  if(Author == 'none' && Messag == 'none')
  {
   if(isNS)
   Val='table-cell'
   else
   Val='block'
  D.getElementById(Au).style.display=Val
  D.getElementById(Ms).style.display=Val
  D.getElementById(Cl+'A').src='../../9Bd/Forum/skins/defaut/CloseAllLit.gif'
  }
  else
  {
  D.getElementById(Au).style.display='none'
  D.getElementById(Ms).style.display='none'
  D.getElementById(Cl+'A').src='../../9Bd/Forum/skins/defaut/OpenAllLit.gif'
  }
 }
 

 function MM_swapClOp(num) 
 {
 Cl="ImgClo"+num
 Val=D.getElementById(Cl+'A').src
  if (Val.indexOf('OpenAll') > -1)
  D.getElementById(Cl+'A').src='../../9Bd/Forum/skins/defaut/OpenAllLit.gif'
  else
  D.getElementById(Cl+'A').src='../../9Bd/Forum/skins/defaut/CloseAllLit.gif'
 }

 function MM_swapClOpRestore(num) 
 {
 Cl="ImgClo"+num
 Val=D.getElementById(Cl+'A').src
  if (Val.indexOf('OpenAllLit') > -1)
  D.getElementById(Cl+'A').src='../../9Bd/Forum/skins/defaut/OpenAll.gif'
  else
  D.getElementById(Cl+'A').src='../../9Bd/Forum/skins/defaut/CloseAll.gif'
 }

/*
 function popup(url)
 {
  newwin=window.open(url,'NewFenetre','toolbar=no, location=no, menubar=no, scrollbars=yes, resizable=yes, width=350, height=400'); 
 }

function IsValid(chain)
{
 var nbespace=0
 longueur=chain.length
 if(longueur==0)
 { 
  return false; 
 }
 else
 { 
  for(i=0;i<longueur;i++)
  {
   if(chain.charAt(i)==" " || chain.charAt(i)==" ")
   {
    nbespace++;
   }
  }
  if(nbespace==longueur)
  {
   return false
  }
  else
  {
   return true
  }
 }

}

 function Compter(Target, nomchamp)
 {
 StrLen = Target.value.length
  if (StrLen > 9999)
  {
  Target.value = Target.value.substring(0,9999)
  CharsLeft = 9999
  }
  else
  {
  CharsLeft = StrLen
  }
  nomchamp.value = CharsLeft
 }


var submit=false;

 function testsubmitB(Parent)
 {
 var valid1= IsValid(document.formulaire.sujet.value);
  if(valid1==false)
  {
  alert("Veuillez renseigner le sujet");
  return false;
  }
  else
  {
   if (submit==false)
   {
   submit=true
   return true;
   }
   else
   {
   return false;
   }
  }
 }


 function testsubmit()
 {
 var valid1= IsValid(document.formulaire.sujet.value);
  <!-- modif Rio - original: if(parent==0 && valid1==false) --> 
  if(valid1==false)
  {
  alert("Veuillez donner un titre à votre message");
  return false;
  }
  else
  {
   if (submit==false)
   {
   submit=true
   document.formulaire.target = "cadre3";
   document.formulaire.action.value="polldefine";
   return true;
   }
  else
  {
  return false;
  } 
 }

 function preview()
 {
 largeur=screen.width - 150;
 hauteur=screen.height - 150;
 gauche=(screen.width - largeur) / 2;
 haut = (screen.height - hauteur) / 2;
 
 document.formulaire.action.value="preview";
 document.formulaire.target = "MyWindow";
 window.open("","MyWindow","height="+hauteur+", width="+largeur+",scrollbars=yes,left="+gauche+",top="+haut+",titlebar=no,toolbar=no,personalbar=no,menubar=no"); 
 document.formulaire.submit();
} 
}

function Translate()
{
 largeur=screen.width - 150;
 hauteur=screen.height - 150;
 gauche=(screen.width - largeur) / 2;
 haut = (screen.height - hauteur) / 2;
 
 document.formulaire.action.value="translate";
 document.formulaire.target = "NewWindow";
// window.open("http://nostradamus.nostradamia.net/9Bd/Forum/Translate.php","NewWindow","height="+hauteur+", width="+largeur+",scrollbars=yes,left="+gauche+",top="+haut+",titlebar=no,toolbar=no,personalbar=no,menubar=no"); 
// document.formulaire.submit();
}

//Dad functions
var NewX, NewY, nsx, nsy, nstemp;
var dragswitch=0;
var dragapproved=false;

 function drag_drop(name)
 {
  if (!ns4)
  return
 temp=eval(name)
 temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
 temp.onmousedown=down
 temp.onmousemove=move
 temp.onmouseup=up
 }

 function down(e)
 {
 temp.captureEvents(Event.MOUSEMOVE)
 nsx=e.x
 nsy=e.y
 }
 function move(e)
 {
  if(dragswitch==1)
  {
  temp.moveBy(e.x-nsx,e.y-nsy)
  return false
  }
 }

 function drag_drop(e)
 {
  if ( ie4&&dragapproved )
  {
  NewX=tempx+event.clientX-offsetx;
  NewY=tempy+event.clientY-offsety;
  }
  else if ( ns6&&dragapproved )
  {
  NewX=tempx+e.clientX-offsetx;
  NewY=tempy+e.clientY-offsety;
  }

  if(NewX > 0 && NewX < ScrWdt-wdt)
  crossobj.style.left=NewX+'px';
  if(NewY > 0 && NewY < ScrHgt-hgt)
  crossobj.style.top=NewY+'px';
 return false
 }

 function init_drag(e,f,g)
 {
 crossobj = D.getElementById(g);
 var firedobj=ns6? e.target : event.srcElement
 var topelement=ns6? "html" : D.compatMode && D.compatMode!="BackCompat"? "documentElement" : "body"
  while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!=f)
  {
  firedobj=ns6? firedobj.parentNode : firedobj.parentElement
  }
  if (firedobj.id==f)
  {
  offsetx = ie4? event.clientX : e.clientX
  offsety = ie4? event.clientY : e.clientY
  tempx = parseInt(crossobj.style.left)
  tempy = parseInt(crossobj.style.top)
  wdt = parseInt(crossobj.style.width)
  hgt = parseInt(crossobj.style.height)
  dragapproved=true
  D.onmousemove=drag_drop
  }
 }
 function stop_drag() { dragapproved=false }
D.onmouseup=new Function("dragapproved=false");

////drag drop functions end here//////
 function hide_box(a)
 {
 D.getElementById(a).style.display='none'
 }
 function hide_boxTO(a)
 {
  if(D.getElementById(a))
  {
  D.getElementById(a).style.display='none'
  window.setTimeout("AdOpen('pop')",100000);
  }
 }
 function AdOpen(a)
 {
  if(D.getElementById(a))
  {
  Adrand=Math.random();

  AdHgt=D.getElementById(a).style.height.replace(/[^0-9\.]/g,'');
  AdWdt=D.getElementById(a).style.width.replace(/[^0-9\.]/g,'');

  //TopBound high & low
  posAdTMin=50*factorH;
  posAdTMax=(ScrHgt/2)-AdHgt;
  posAdT=Math.max(posAdTMin,(posAdTMin+posAdTMax*Adrand));

  //LeftBound high & low
  posAdWMin = (ScrWdt/3)+20;
  posAdWMax = ScrWdt-AdWdt-20-posAdWMin;
  posAdW = Math.max(posAdWMin,posAdWMin+(posAdWMax*Adrand));
  
  D.getElementById(a).style.top=posAdT+'px';
  D.getElementById(a).style.left=posAdW+'px';
  D.getElementById(a).style.display='block';
  }
 }
*/