/*
Pop up information box II (Mike McGrath (mike_mcgrath@lineone.net,  http://website.lineone.net/~mike_mcgrath))
Permission granted to Dynamicdrive.com to include script in archive
For this and 100's more DHTML scripts, visit http://dynamicdrive.com
*/
var Xoffset = -60;    // modify these values to ...
var Yoffset = 20;    // change the popup position.

// id browsers
var iex = (document.all);
var nav = (document.layers);
var old = (navigator.appName=="Netscape" && !document.layers && !document.getElementById);
var n_6 = (!document.all && document.getElementById);
var yyy = -1000;
var xxx = -1000;
var skn;

if(!old)
{  if(nav)
   {  skn = document.dek;
      document.captureEvents(Event.MOUSEMOVE);
      document.onmousemove = get_mouse;
   }
   else if(iex)
   {  skn = dek.style;
      document.onmousemove = get_mouse;
   }
   else if(n_6)
   {  skn = document.getElementById("dek").style;
      document.addEventListener("mousemove", get_mouse, true);
   }
}
function popup(msg){
  if (lang == "en")
  var descarray = new Array("Backward animation","[Animation]","Back and forth animation","Forward animation","Display the first image","Step backward","Step forward","Display last image","Slow down animation","Speed up animation","Stop animation","Reset speed of animation","Click here to get HELP file","Email comments to production-info@cmc.ec.gc.ca","Click here to find out what's new in Vizaweb","Click here to select a different image to compare with Product 1","Click here to reload Product 1","Click here to find out more about CMC's products","Click here to access the French version of Vizaweb","Click here to access another Vizaweb interface");
  else
	  var descarray = new Array("Animation inverse pour aller de la derni&egrave;re &agrave; la premi&egrave;re image","[Animation]","Animation avant et arri&egrave;re","Animation vers l'avant pour aller de la premi&egrave;re &agrave; la derni&egrave;re image","Afficher la premi&egrave;re image","Reculer d'une image","Avancer d'une image","Afficher la derni&egrave;re image","Ralentir la vitesse de l'animation","Augmenter la vitesse de l'animation","Arr&ecirc;ter l'animation","Cliquez ici pour retourner &agrave; la vitesse initiale de l'animation","Cliquez ici pour avoir de l'aide","Envoyer vos commentaires &agrave; production-info@cmc.ec.gc.ca","Cliquez ici pour savoir ce qu'on a ajout&eacute; r&eacute;cemment &agrave; Vizaweb","Cliquez ici pour s&eacute;lectionner diff&eacute;rentes images &agrave; comparer avec le Produit 1","Cliquez ici pour recharger Produit 1","Cliquez ici pour avoir plus d'information au sujet des produits du CMC","Cliquez ici pour acc&eacute;der &agrave; la version anglaise de Vizaweb","Cliquez ici pour acc&eacute;der &agrave; une autre interface de Vizaweb");
 if(!descarray[msg]){
    descarray[msg]="<font color=red>This popup (#"+msg+") isn't setup correctly - needs description</font>";
 }

var content = "<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"black\" width=\"150\" bgcolor=\"lightyellow\"><td align=\"center\"><span style = \"font-size: 12px; font-family: sans-serif, Arial;\">"+ descarray[msg] +"</span></td></table>";

   if(old)
   {  alert(descarray[msg]);
      return;
   }
   else
   {  yyy = Yoffset;
		xxx = Xoffset;
      if(nav)
      {  skn.document.write(content);
         skn.document.close();
      }
      else if(iex)
      {  document.all("dek").innerHTML = content;
      }
      else if(n_6)
      {  document.getElementById("dek").innerHTML = content;
      }
      
      skn.visibility = "visible";
   }
}


function get_mouse(e)
{  var x,y;

   if (nav)
   {  x = e.pageX;
      y = e.pageY + 10;
      skn.left = x + xxx; 
      skn.top = y + yyy; 
   }
   else if (n_6)
   {  x = e.pageX - 150;
      y = e.pageY - 80;
      skn.left = x + xxx + "px";
      skn.top = y + yyy + "px";
   }
   else if (iex)
   {  
		// New template no longer requires ie to take into account the scroll bar position
      x = event.x - 150;// + document.body.scrollLeft - 150;
      y = event.y - 80;// + document.body.scrollTop - 80;
      skn.left = x + xxx;
      skn.top = y + yyy;
   }
}


function kill()
{  if(!old)
   {  yyy = -1000;
		xxx = -1000;
      if(iex)
      {  
			if(navigator.platform == "MacPPC")
			{
			}else
			{
				document.all("dek").innerHTML = "";
			}
      }
      else if(n_6)
      {  document.getElementById("dek").innerHTML = "";
      } 

      skn.visibility = "hidden";
   }
}

