<!--
//------------------------
// Tous droits réservés
// Copyright GGH-Trading
//------------------------

var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;

function propr(objet,nom) {
var texte = nom;
 for (var i in objet ) texte =texte+"."+i+" " +objet[i] +"<br>";
return texte;
}

function popup_inscription(tpe,frurl) {
if (tpe*1==0) {nw_fen=window.open('entree_formulaire_bq.php4?frurl='+frurl,'inscription','location=no,status=no,directories=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=760,height=450');}
if (tpe*1==2) {nw_fen=window.open('entree_formulaire_part.php4?frurl='+frurl,'inscription','location=no,status=no,directories=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=760,height=450');}
if (tpe*1==3) {nw_fen=window.open('entree_formulaire_perso.php4?frurl='+frurl,'inscription','location=no,status=no,directories=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=760,height=450');}
nw_fen.focus();
}

function popup_boutons(page) {
nbw_fen=window.open(page,'pboutons','location=no,status=no,directories=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=590,height=450');
nbw_fen.focus();
}

function go_admin(lform){
nw_fen=window.open('','administration','location=no,status=no,directories=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=620,height=450');
nw_fen.document.write('<html><body><'+'script>window.name="administration";<'+'/script><center><br><br><br>Connexion en cours<br><br>Veuillez patienter quelques secondes...</center></body></html>');
lform.target="administration";
lform.submit();
lform.passw.value=""; // effacer le mot de passe maintenant
}

// PROCEDURES POUR FAIRE GLISSER LE MENU
  var NS = (document.layers) ? 1 : 0;
  var IE = (document.all) ? 1: 0;

  self.onError=null;
  currentX = currentY = 0;  
  whichIt = null;           
  lastScrollX = 0; lastScrollY = 0;

  function heartBeat() {
          if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
      if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
          if(diffY != lastScrollY) {
                  percent = .1 * (diffY - lastScrollY);
                  if(percent > 0) percent = Math.ceil(percent);
                  else percent = Math.floor(percent);
                                  if(IE) document.all.slide.style.pixelTop += percent;
                                  if(NS) document.slide.top += percent; 
                  lastScrollY = lastScrollY + percent;
      }
          if(diffX != lastScrollX) {
                  percent = .1 * (diffX - lastScrollX);
                  if(percent > 0) percent = Math.ceil(percent);
                  else percent = Math.floor(percent);
                  if(IE) document.all.slide.style.pixelLeft += percent;
                  if(NS) document.slide.left += percent;
                  lastScrollX = lastScrollX + percent;
          }       
  }
  function checkFocus(x,y) { 
  var totalY, totalX;
          floatx = document.slide.pageX;
          floaty = document.slide.pageY;
          floatwidth = document.slide.clip.width;
          floatheight = document.slide.clip.height;
                  if(20 == 0) totalY = floatheight;
                  else totalY = 20;
                  if(0 == 0) totalX = floatwidth;
                  else totalX = 0;
          if( (x > floatx && x < (floatx+totalX)) && (y > floaty && y < (floaty+totalY))) return true;
          else return false;
  }
  function grabIt(e) {
          if(IE) {
                  whichIt = event.srcElement;
                  while (whichIt.id.indexOf("slide") == -1) {
                          whichIt = whichIt.parentElement;
                          if (whichIt == null) { return true; }
              }
                  whichIt.style.pixelLeft = whichIt.offsetLeft;
              whichIt.style.pixelTop = whichIt.offsetTop;
                  currentX = (event.clientX + document.body.scrollLeft);
                  currentY = (event.clientY + document.body.scrollTop);
                  if(20 == 0) totalY = whichIt.style.pixelHeight;
                  else totalY = 20;
                  if(0 == 0) totalX = whichIt.style.pixelWidth;
                  else totalX = 0;
                  if(!(event.clientX > whichIt.offsetLeft && event.clientX < whichIt.offsetLeft + totalX) || 
                  !(currentY > whichIt.offsetTop && currentY < whichIt.offsetTop + totalY)) whichIt = null;
          } else { 
          window.captureEvents(Event.MOUSEMOVE);
          if(checkFocus (e.pageX,e.pageY)) { 
                  whichIt = document.slide;
                  FloatTouchedX = e.pageX-document.slide.pageX;
                  FloatTouchedY = e.pageY-document.slide.pageY;
          } 
          }
      return true;
  }
  function moveIt(e) {
          if (whichIt == null) { return false; }
          if(IE) {
              newX = (event.clientX + document.body.scrollLeft);
              newY = (event.clientY + document.body.scrollTop);
              distanceX = (newX - currentX);    distanceY = (newY - currentY);
              currentX = newX;    currentY = newY;
              whichIt.style.pixelLeft += distanceX;
              whichIt.style.pixelTop += distanceY;
                  if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;
                  if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;
                  if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;
                  if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
                  event.returnValue = false;
          } else { 
                  whichIt.moveTo(e.pageX-FloatTouchedX,e.pageY-FloatTouchedY);
          if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;
          if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
          if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
          if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
          return false;
          }
      return false;
  }
  function dropIt() {
          whichIt = null;
      if(NS) window.releaseEvents (Event.MOUSEMOVE);
      return true;
  }

// main ici 
function laisser_glisser(){
  if(NS) {
          window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
          window.onmousedown = grabIt;
          window.onmousemove = moveIt;
          window.onmouseup = dropIt;
  }
  if(IE) {
          document.onmousedown = grabIt;
          document.onmousemove = moveIt;
          document.onmouseup = dropIt;
  }
  if(NS || IE) action = window.setInterval("heartBeat()",1);
}

function alert_endev() {
alert("Page en développement");
}

function pop_up(page) {
window.open(page,'_blank','location=no,status=no,directories=no,toolbar=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=380,height=70');
}

function gimme_url(page) { // replace ? by §
var gurl=document.location.href;
if (gurl.indexOf("?")>0) 
	{
	tempo="";
	for (i=0;i<gurl.length;i++) {if (gurl.charAt(i)=="?") {tempo+="§";} else {if (gurl.charAt(i)=="&") {tempo+="*";} else {tempo+=gurl.charAt(i);}}}
	gurl=tempo;
	}
if (page.indexOf("?")>=0) {page=page+"&frurl="+gurl;} else {page=page+"?frurl="+gurl;}	
return page;
}

function popup_lebigquizz2(qz){
var page='http://www.lebigquizz.net/quizz/anonyme.php4?qz='+qz+'';
window.open(gimme_url(page),'lejeu','location=no,status=yes,directories=no,toolbar=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=480,height=300');
}


function noop() {return;}

var ready_tmr=0;

function document_ready() {
// pas de test pour ns4
if ((ns4)||(document.readyState=="complete")) {return true;} else {return false;}
}

var bloquer_tooltip=0;
function toolTip() {return;}

function show_div(divname,txmr,btp,dx,dy) {
if (!btp) btp=0;
if (!txmr) txmr=0;
if (btp==1) {toolTip();bloquer_tooltip=1;} else {bloquer_tooltip=0;}
if (!dx) dx=0;
if (!dy) dy=0;
var obj="";
if (ns4) eval('obj=document.'+divname);
else if(ns6) obj=document.getElementById(divname).style;
else if(ie4) eval('obj=document.all.'+divname+'.style');
obj.visibility="visible";
if (txmr) {clearTimeout(txmr);}
//return obj;
}

function hide_div(divname) {
var obj="";
if (ns4) eval('obj=document.'+divname);
else if(ns6) obj=document.getElementById(divname).style;
else if(ie4) eval('obj=document.all.'+divname+'.style');
obj.visibility="hidden";
}

// blink table
var yetable="";

function def_table() {
if (ns4) {return;}
  else if(ns6) yetable=window.document.getElementById("t_blink");
    else if(ie4) yetable=window.document.all.t_blink;	
}
	
function fluctuat_necm(yetable) {
if (ns4) {return;} 
	else 
	{
	//alert('yo'+yetable.bgColor);
	if (yetable.bgColor=="#ffff88") 
		{yetable.bgColor="#00B97C";//"#FFFF88";
		tmr=setTimeout("fluctuat_necm(yetable)",50);} 
		else 
		{yetable.bgColor="#ffff88";tmr=setTimeout("fluctuat_necm(yetable)",5000);}
	}
}

// procédure pour anim principes
var etape=1;
function anim_page_principe() {
	if (document_ready()) 
	{
	hide_div("dc");
	tme_val=2000;tme_inc=2000;
	if (ready_tmr!=0) {clearTimeout(ready_tmr);}
	// afficher les zones toutes les secondes dans la page sommaire
	if (etape<2) {t2mr=setTimeout('show_div("d2",t2mr,0);',1000);tme_val=tme_val+tme_inc;}
	if (etape<3) {t3mr=setTimeout('show_div("d3",t3mr,0);',2000);tme_val=tme_val+tme_inc;}
	if (etape<4) {t4mr=setTimeout('show_div("d4",t4mr,0);',5000);tme_val=tme_val+tme_inc;}
	if (etape<5) {t5mr=setTimeout('show_div("d5",t5mr,0);',8000);tme_val=tme_val+tme_inc;}
	} 
else 
	{
	show_div("dc");
	ready_tmr=setTimeout('anim_page_principe();',500);
	}
}

function goetape(tpe) {
etape=tpe;
if (document_ready()) {hide_div("dc");}
if (etape<5) {hide_div("d5");}
if (etape<4) {hide_div("d4");}
if (etape<3) {hide_div("d3");}
if (etape<2) {hide_div("d2");}
anim_page_principe();
}

// HIDE SOURCE
/*
var message="Copyright GGH-TRADING";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("alert(message);return false;");
*/

window.name="lbqnet";
//-->
