// Site chambres-et-literie.fr
// 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

var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
var jaffichebul = false;
//offsetX = 0;
//offsetY = 6;
var toolTipSTYLE="";
function initbul()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.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;
  
   aafficher =msg;
   
  
    if(ns4)
    {
      toolTipSTYLE.document.write(aafficher);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }
    if(ns6)
    {
		  document.getElementById("toolTipLayer").innerHTML = aafficher;
		  toolTipSTYLE.display='block';
    }
    if(ie4)
    {
	  	document.all("toolTipLayer").innerHTML=aafficher;
      	toolTipSTYLE.display='block';
    }
  }
}
function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
	var vertScroll = self.pageYOffset;
    x = e.pageX;
    y = e.pageY;
	hauteurf=window.innerHeight;
	largeurf=window.innerWidth;
	hauteurdiv=0;
	largeurdiv=0;
	if(document.getElementById("flamovie")) {
		largeurdiv=document.getElementById("flamovie").width;
	}
	if(document.getElementById("flamovie")) {
		hauteurdiv=document.getElementById("flamovie").height;
	}
	//if (!(hauteurdiv>0)) {
	//	hauteurdiv=document.getElementById("imgbulid").height;
	//	largeurdiv=document.getElementById("imgbulid").width;
	//}
   }
  else
  {
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
	largeurf=document.body.clientWidth;
	largeurdiv=document.all("toolTipLayer").clientWidth;
	hauteurf=document.body.clientHeight;
	hauteurdiv=document.all("toolTipLayer").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 {
	  //if (largeurdiv>0) {
		  if (x>(largeurf/2)) {	
			if ((y-vertScroll)>(hauteurf/2)) {//Bas Droite
				offsetX=-largeurdiv-10;
				offsetY =-hauteurdiv-18;
			} else {//Haut Droite
				offsetY = 0;
				offsetX=-largeurdiv-10;
			}
		} else {
			if ((y-vertScroll)>(hauteurf/2)) { //Bas Gauche
				offsetX=15;
				offsetY =-hauteurdiv-18;
			} else { //Haut Gauche
				offsetX=15;
				offsetY = 0;
			}
		}
	//}
 }
	toolTipSTYLE.right = largeurf-x - offsetX;
	toolTipSTYLE.left = x + offsetX;
    toolTipSTYLE.top = y + offsetY;
  return true;
}
function disableRightClick(e)
{
  var message = "";
  
  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers) 
    {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all))
  {
    if (e.which==2||e.which==3)
    {
      alert(message);
      return false;
    }
  }
  else
  {
    alert(message);
    return false;
  }
}
disableRightClick();

function flabul(str,titre,longueur,largeur) {
bul('<table border="1" cellspacing="0" cellpadding="0" bgcolor="#000000" ><tr><td nowrap class="headerNavigation" align="center" width="'+(largeur-40)+'">'+titre+'</td><td class="headerNavigation" nowrap align="center" width="40">'+longueur+'</td></tr><tr><td nowrap colspan="2"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+largeur+'" height="200" name="flamovie" id="flamovie" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"><param name="movie" value="'+str+'" /><param name="quality" value="high" /><param name="scale" value="noscale" /><embed src="'+str+'" width="'+largeur+'" height="200" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" scale="noscale"></embed></object></td></tr></table>');
}
function imgbul(str,titre,longueur) {
bul('<table border="1" cellspacing="0" cellpadding="0" bgcolor="#000000"><tr><td nowrap class="headerNavigation" align="center" width="200">'+titre+'</td><td class="headerNavigation" nowrap align=center width=40>'+longueur+'</td></tr><tr><td nowrap colspan=2><img src="'+str+'" name="flamovie" id="flamovie"></td></tr></table>');
//alert(document.getElementById("flamovie").height);
}
