// ouki commerce Version 1.05
// © GOMOT Alexandre 2005  alex@ouki.com
// Application e-commmerce propriété de GOMOT Alexandre developpeur & auteur
// Utilisation de l'application sous licence temporaire
// Toute modification du code est interdite sans accord de l'auteur
// Chanhing the source code is prohibited by author
//Part of the code income from dreamweaver
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
var jaffichebul = false;
iniX = 4;
iniY = 0;
var toolTipSTYLE;
function initbul()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.buldiv;
    else if(ns6) toolTipSTYLE = document.getElementById("buldiv").style;
    else if(ie4) toolTipSTYLE = document.all.buldiv.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmousemove = moveToMouseLoc;
  }
}
//temporisation de 100ms pour eviter la l'effet de sintillement en changement de zone
function rbul() {jaffichebul=false;setTimeout('bul();',20);}
function bul(msg) {
  if(bul.arguments.length < 1) // hide
  {
  	if (!jaffichebul) {
    	if(ns4) toolTipSTYLE.visibility = "hidden";
    	else toolTipSTYLE.display = "none";
	}
  }
  else // show
  {
  	jaffichebul = true;
  	if (msg=='') {msg='Cliquez pour voir la fiche complète et autres dimensions.';}
    var content =
    '<table border="0" cellspacing="0" cellpadding="0" class="bullcssc"><tr><td class="bullcssd" nowrap>' + msg +
    '</td></table>';
    if(ns4)
    {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }
    if(ns6)
    {
		  document.getElementById("buldiv").innerHTML = content;
		  toolTipSTYLE.display='block'
    }
    if(ie4)
    {
	  	document.all("buldiv").innerHTML=content;
      	toolTipSTYLE.display='block'
    }
  }
}
function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
	var vertScroll = self.pageYOffset;
	var horizScroll = self.pageXOffset;
    x = e.pageX;
    y = e.pageY;
	hauteurdiv=0;
	largeurdiv=0;
	largeurf=window.innerWidth;
	if (document.getElementById("buldiv").style.Width>0) {
		largeurdiv=document.getElementById("buldiv").style.Width;
	} else if (document.getElementById("buldiv").width>0) {
		largeurdiv=document.getElementById("buldiv").width;
	} else if(document.getElementById("buldiv_size")) {
		largeurdiv=document.getElementById("buldiv_size").width;
	}
  	hauteurf=window.innerHeight;
	if (document.getElementById("buldiv").style.Height>0) {
		hauteurdiv=document.getElementById("buldiv").style.Height;
	} else if (document.getElementById("buldiv").height>0) {
		hauteurdiv=document.getElementById("buldiv").height;
	} else if(document.getElementById("buldiv_size")) {
		hauteurdiv=document.getElementById("buldiv_size").height;
	}
	if (isNaN(largeurdiv)) {
		largeurdiv=0;
	}
	if (isNaN(hauteurdiv)) {
		hauteurdiv=0;
	}
	}
  else
  {
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
	largeurf=document.body.clientWidth-document.body.scrollLeft;
	largeurdiv=document.all("buldiv").clientWidth;
	hauteurf=document.body.clientHeight-document.body.scrollTop;
	hauteurdiv=document.all("buldiv").clientHeight;
  }
  if (ie4) {
	  if (x>(largeurf/2)) {	
			if (y>(hauteurf/2)) {//Bas Droite
				offsetX=-largeurdiv;
				offsetY =-hauteurdiv-6;
			} else {//Haut Droite
				offsetY = 20;
				offsetX=-largeurdiv;
			}
	 } else {
			if (y>(hauteurf/2)) { //Bas Gauche
				offsetX=0;
				offsetY =-hauteurdiv-6;
			} else { //Haut Gauche
				offsetX=0;
				offsetY = 20;
			}
	 }
  } else {
	offsetY = 4;
	offsetX=6;
	if (largeurdiv>0) {
		if ((x-horizScroll)>(largeurf/2)) {	
			if ((y-vertScroll)>(hauteurf/2)) {//Bas Droite
				offsetX=-largeurdiv-10;
				offsetY =-hauteurdiv-18;
			} else {//Haut Droite
				offsetX=-largeurdiv-10;
				offsetY = 0;
			}
		} else {
			if ((y-vertScroll)>(hauteurf/2)) { //Bas Gauche
				offsetX=10;
				offsetY =-hauteurdiv-18;
			} else { //Haut Gauche
				offsetX=10;
				offsetY = 0;
			}
		}
	}
  }
  toolTipSTYLE.right = (largeurf-x - offsetX-iniX)+"px";
  toolTipSTYLE.left = (x + offsetX+iniX)+"px";
  toolTipSTYLE.top = (y + offsetY+iniY)+"px";
  return true;
}