/*****************************************/
/* Leroy-Merlin - popender management v2 */
/* event manager                         */ 
/* Author: JGR (Argia) Nov-2005          */
/*****************************************/

/*********************/
/* internet explorer */
/*********************/

/**
  actions to do if the user follows a link (a href)
 */
function IEdolnclick() {
 announceBlocker=0;
 var str = new String(window.event.srcElement.name);
 if(str.length >= 8) {
  var str = str.substr(0,8);
  var str = str.toLowerCase();
  if(str != "lmfr_ext" && str != "lmfr-ext") {
   announceBlocker=1;
  }
 } else {
   announceBlocker=1;
 }
}

/**
  actions to do if the user submit a form
 */
function IEdosubmit() {
 announceBlocker=1;
}

/**
 dispatch the functions to use according to the user's action
 */
function IEeventSetup() {
 var oList = window.document.all;
 var iLoop = 0;
 for(iLoop = 0; iLoop <= oList.length; iLoop++) {
  var elt = oList(iLoop);
  if (elt) {
   if(elt.tagName == "FORM") {
    elt.onsubmit = IEdosubmit;
   } else {
    if(elt.tagName == "A") {
    // elt.onclick = IEdolnclick;
    }
   }
  }
 }
}



/******************/
/* mozilla family */
/******************/

/**
  actions to do if the user follows a link (a href)
 */
function MZdolnclick(evt) {
 var str = new String(evt.target.name);
 if(str.length >= 8) {
  var str = str.substr(0,8);
  var str = str.toLowerCase();
  if(str != "lmfr_ext" && str != "lmfr-ext") {
   announceBlocker=1;
  }
 } else {
   announceBlocker=1;
 }
}

/**
  actions to do if the user submit a form
 */
function MZdosubmit(evt) {
 announceBlocker=1;
}

/**
 dispatch the functions to use according to the user's action
 */
function MZeventSetup() {
 window.captureEvents(Event.CLICK | Event.SUBMIT | Event.MOUSEMOVE);
 window.onsubmit = MZdosubmit;
 /*for(iLoop = 0; iLoop < window.document.links.length; iLoop++) {
  window.document.links[iLoop].onclick = MZdolnclick;
 }*/
}



/********************************************************/
/* use the event manager adapted to the current browser */
/********************************************************/

var ie=(navigator.appName == "Microsoft Internet Explorer")?1:0;
var op=(navigator.appName == "Opera")?1:0;
var ns=(navigator.appName == "Netscape")?1:0;
var mz=(navigator.appName == "Mozilla")?1:0;

if(ie || op) {
 IEeventSetup();
}

if(ns || mz) {
 MZeventSetup();
} 
