/*
**  DTML instructions to set caching headers. Inside comments area to play nicer with JS editors.
**
** **   
**   
**   
**   
** */

theurl = window.location.href;
thesubject = escape("Page issue du site http://marne.pref.gouv.fr");
thebody = escape("Consultez cette URL - ")+theurl;
thebolo = "?subject="+thesubject+"&body="+thebody;

function sendemail(){
        window.location.href="mailto:"+thebolo;
        }

var NbrLyr = 1;

if (navigator.appName == "Netscape")
	{
	layerRef="document.layers";
	styleSwitch="";
	ns=1;
	}
	else
	{
	layerRef="document.all";
	styleSwitch=".style";
	ns=0;
	}


function showLayer(layerName) {
 	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
}


function hideLayer(x) {
 	for(var i=0;i<x;i++){
 		eval(layerRef+'["ssbox'+i+'"]'+styleSwitch+'.visibility="hidden"');
 	}
}

displayedBox = 'none';

function getPos(el,sProp) {
	var iPos = 0
	while (el!=null) {
		iPos+=el["offset" + sProp]
		el = el.offsetParent
	}
	return iPos

}

function showBox(boxId, prefix, left, top) {
  buttonId = prefix + boxId;
  if (displayedBox != 'none') {
    hideBox(displayedBox);
  }

  if (document.all) {
    box = document.all[boxId];
    box.style.visibility = 'visible';
    box.style.display = 'block';

    button = document.all[buttonId];
    posLeft = getPos(button, "Left");
    posTop = getPos(button, "Top");
    
    box.style.left = posLeft + left;
    box.style.top = posTop + top;   
  }
  if (document.layers) {
    box = document.layers[boxId]
    box.visibility = 'visible';
    box.display = 'block';

    button = document.layers[buttonId];
    posLeft = getPos(button, "Left");
    posTop = getPos(button, "Top");
    
    box.left = posLeft + left;
    box.top = posTop + top;
  }
  if (document.getElementById && !document.all) {
    box = document.getElementById(boxId);
    box.style.visibility = 'visible';
    box.style.display = 'block';

    button = document.getElementById(buttonId);
    posLeft = getPos(button, "Left");
    posTop = getPos(button, "Top");

    box.style.left = posLeft + left;
    box.style.top = posTop + top;
 }
  displayedBox = boxId;
}

function hideBox(boxId) {
  if (boxId == 'none') {
    boxId = displayedBox;
  }

  if (document.all) {

    document.all[boxId].style.visibility = 'hidden';
    document.all[boxId].style.display = 'none';
  }
  if (document.layers) {
    document.layers[boxId].visibility = 'hidden';
    document.layers[boxId].display = 'none';
  }
  if (document.getElementById && !document.all) {
    box = document.getElementById(boxId);
    box.style.visibility = 'hidden';
    box.style.display = 'none';
  }
}

function delayHideBox(boxId) { 
 setTimeout("hideBox('"+boxId+"')", 3000); 
}


// Tooltip-like help pop-ups used in forms
var ie=0 
if (navigator.appVersion.indexOf("MSIE")!=-1) { 
  ie=1; 
} 

// Tooltip-like help pop-ups used in forms 
function formtooltip(el,flag){

   elem = document.getElementById(el);
   input_id = 'input_' + el;
   input_elem = document.getElementById(input_id);
   inputPosLeft = getPos(input_elem, "Left");
   inputPosTop = getPos(input_elem, "Top");

    if (flag) {  
      if (ie) { 
        elem.parentNode.parentNode.style.zIndex=1000; 
        elem.parentNode.parentNode.style.borderRight='0px solid #000'; 
        // ugly , yes .. but neccesary to avoid a small but very annoying bug in IE6 
      }
      elem.style.visibility='visible';
      elem.style.left = inputPosLeft - 120;
      elem.style.top = inputPosTop;
    } 
    else { 
      if (ie) { 
        elem.parentNode.parentNode.style.zIndex=1; 
        elem.parentNode.parentNode.style.border='none'; 
      } 
      elem.style.visibility='hidden' ; 
   }
  }

