//  checkFormConnexion(theform)

function checkFormConnexion(theform) {
	// tests infos sur compte
	if(theform.pseudo.value == "") {
		alert("Le champ Pseudo est obligatoire");
		theform.pseudo.focus();
		return false;
	}
	if(theform.password.value == "") {
		alert("Le champ Mot de passe est obligatoire");
		theform.password.focus();
		return false;
	}
	// tout est bon, envoi des infos
	return true;
}

/////////////////////////// BULLES /////////////////////////////////
function Hide() {
	nd();
}

// AffBulle > bulle minimale qui suit la souris et qui se cache des que la souris sort du lien
function Aff(texte) {
	return overlib(texte,TEXTSIZE, '11px',FGCOLOR,'#FFFFCC',OFFSETX,15,OFFSETY,15,WRAP,0,MOUSEOFF); // ,SHADOW,SHADOWOPACITY,60
}

// AffBulle2 > bulle avec titre qui reste en place
function Aff2(titre,texte) {
	titre = "&nbsp;"+titre+"&nbsp;";
	return overlib(texte,STICKY,CAPTION,titre,CLOSETEXT,'',CAPTIONSIZE, '10px',TEXTSIZE, '11px',FGCOLOR,'#FFFFCC',OFFSETX,5,OFFSETY,10,WRAP,0,MOUSEOFF); // ,SHADOW,SHADOWOPACITY,60
}

// showLayer(layerName)
function showLayer(layerName) {
  if (document.layers) document.layers[layerName].visibility="show";
  if (document.all) document.all[layerName].style.visibility="visible";
  else if (document.getElementById) document.getElementById(layerName).style.visibility="visible";
}

//  hiddeLayer(layerName)
function hiddeLayer(layerName) {
  if (document.layers) document.layers[layerName].visibility="hide";
  if (document.all) document.all[layerName].style.visibility="hidden";
  else if (document.getElementById) document.getElementById(layerName).style.visibility="hidden";
}

// moveLayer
function moveLayer(layerName,offsetx,offsety) {
  var layer;
  if (document.layers) layer = document.layers[layerName];
  if (document.all) layer = document.all[layerName].style;
  else if (document.getElementById) layer = document.getElementById(layerName).style;
  var largeur = ( largeur_fenetre() - 900 ) / 2 + offsetx;
  var hauteur = offsety + 10;
  
  layer.left = largeur;
  layer.top = hauteur;
}

function largeur_fenetre()
{
 if (window.innerWidth) return window.innerWidth;
 else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
 else return 0;
}

function hauteur_fenetre()
{
 if (window.innerHeight) return window.innerHeight  ;
 else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
 else return 0;
}

function PopupImage2(img) {
	titre="AutreVue.net - Double-cliquer pour fermer";
	w=open("",'image','width=640,height=480,toolbar=no,scrollbars=yes,resizable=yes');
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE>");
	w.document.write("<SC"+"RIPT language=java"+"script> 	 window.status='Double-cliquer pour fermer'; function checksize()  { 		if (document.images['img'].complete) {  			var resizeWidth = document.images[0].width+28;			var resizeHeight = document.images[0].height+74;			if(document.images[0].width > window.screen.width) {resizeWidth = window.screen.width - 20; resizeHeight += 17; }			if(document.images[0].height > window.screen.height) resizeHeight = window.screen.height - 40;						window.resizeTo(resizeWidth,resizeHeight); 			window.focus();		} 		else { 			setTimeout('checksize()',250) 			} 		}</"+"SCRIPT></HEAD>");
	w.document.write("<BODY bgcolor=black onload='checksize()' onDblClick='self.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><center><IMG src='"+img+"' border=0 name='img' title='Double-cliquez pour fermer'></center>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

function oblig(inputObject,inputName) {
	if(inputObject.value == "") {
		alert("Le champ "+inputName+" est obligatoire");
		inputObject.focus();
		return false;
	}
	return true;
}

function ObjGetPos(obj_){
  var PosX = 0;
  var PosY = 0;
  var Obj  =  obj_;
  //-- Si l'objet existe
  if( Obj){
    //-- Si propriété existe
    if( Obj.offsetParent){
    	
      //-- Récup. Position Objet
      PosX = Obj.offsetLeft;
      PosY = Obj.offsetTop;

      //-- Tant qu'un parent existe
      while( Obj = Obj.offsetParent){
        //-- Ajout position Parent
        PosX += Obj.offsetLeft;
        PosY += Obj.offsetTop;
      }
    }
  }
  //-- Retour des positions
  return([PosX, PosY]);
}