// JavaScript Document
//Ajouter aux favoris 
//<a href="javascript:window.external.AddFavorite('http://www.ADRESSE.com', 'NOM_DU_SITE')"></a>


//##################### SHOW DIV ###########################################//
//<a href="javascript:ShowMe('forfait2');">
function ShowMe(ID){
/*
ID c'est le ID du div à ouvrir
*/
leDiv =document.getElementById(ID);
	if (leDiv.style.display == 'none')
	{
		leDiv.style.display = 'block';
	} else {
		leDiv.style.display = 'none';
		document[ID + '_'].src='images/design/header_produits/' + ID + '_o.gif';
	}
}
//#############################################################################//
//  LE GOOGLE MAP //
function go_to_google_map(){ 
	var theForm = document.form_google;
	//alert('toto');
	window.open('http://maps.google.ca/maps?f=d&hl=fr&saddr=' + theForm['numero'].value + '+' + theForm['lst_type'].value + '+' + theForm['route'].value + '+' + theForm['ville'].value + '+' + theForm['province'].value + '+' + theForm['pays'].value + '&daddr=2301,+Rang+St-Malo+Trois-Rivieres+(Quebec)+G8V+1X6&layer=&sll=46.375545,-72.523301&sspn=0.058033,0.159645&ie=UTF8&z=13&om=1' + theForm['ville'].value);
}
//#############################################################################//
//###################### IEUPDATE.JS  POUR LES FLASH ########################//
// INCLUDE <script type="text/javascript" src="ieupdate.js"><//script>
//À INCLUDE ENTRE LE FLASH --> <script type="text/javascript">startIeFix();<//script>
// <!-- --><script type="text/javascript">endIeFix();<//script>

var bo_ns_id = 0;

function startIeFix(){
  if(isIE()){
    document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');
  }
}

function endIeFix(){
  if(isIE()){
    document.write('</div>');
    var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
    var theCode = theObject.innerHTML;
    theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))
    document.write(theCode);
  }
}

function isIE(){
  // only for Win IE 6+
  // But not in Windows 98, Me, NT 4.0, 2000
  var strBrwsr= navigator.userAgent.toLowerCase();
  if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
    if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){
      return false;
    }
    if(strBrwsr.indexOf("win98") > -1 ||
       strBrwsr.indexOf("win 9x 4.90") > -1 ||
       strBrwsr.indexOf("winnt4.0") > -1 ||
       strBrwsr.indexOf("windows nt 5.0") > -1)
    {
      return false;
    }
    return true;
  }else{
    return false;
  }
}
//###################### SLIDE SHOW ########################################//

	//CODE D'APPEL DE FONCTION
	//<img name="bato" src="image01.jpg" border=0><input type="button" value="-->" onClick="imageSuivante('bato')">
	//
	
	
	var nbrImage = 6; //Nombre d'images disponibles
	var imageCourante = 1; // l'index de l'image courante initialisé a 1 parce que c'est la 1 qui commence
	var prefixe = "image";
	var suffixe = ".jpg";


	function imageSuivante(imageNom)
	{
	     imageCourante ++;
	     if(imageCourante > nbrImage)
	          imageCourante = 1;
	     changerImage(imageNom)
	}

	function imagePrecedente(imageNom)
	{
	     imageCourante --;
	     if(imageCourante == 0)
	          imageCourante = nbrImage;
	     changerImage(imageNom)
	}

	function changerImage(imageNom)
	{
	     if(imageCourante < 10)
     	          code = "0" + imageCourante;
	     else
	          code = imageCourante;
	     document[imageNom].src = prefixe + code + suffixe;
	}
	
	
	
//#######################  IMAGE POP-UP ############################
function afficheMaxi(chemin)
  {

  i1 = new Image();
  i1.src = chemin;

  html = '<HTML><HEAD></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=5 MARGINHEIGHT=0 body bgcolor="#ffffff"><CENTER><img SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+24,document.imageTest.height+40)"></CENTER></BODY></HTML>';
  popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=0, width=500, height=700, left=250, top=125');
  popupImage.document.open();
  popupImage.document.write(html);
  popupImage.document.close()
  }
