function setzc(id,val) 
{
	document.getElementById('m'+id).innerHTML='<input type="hidden" name="' + id + '" id="' + id + '" value="' + val + '">';
}

function setCoords(e) {
  if (is.ns) {
    var xS = e.pageX;
    var yS = e.pageY;
  }
  else {
    var xS = event.clientX;
    var yS = event.clientY;
 }  

  xSouris = xS;
  ySouris = yS;
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement &&
      ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}


function mapClick(e) {

  if (is.ns) {
    xScroll = 0; 
    yScroll = 0;
    yOffset = 223+63; 

    if ( window.innerWidth > 800 ) {
      xOffset = 27-7 +(document.body.offsetWidth - 972 - 20)/2; //188 + (window.innerWidth - 812) / 2;      
    } else {
      xOffset = 30 //188;
    } 
  }
  else {
    scrolls = getScrollXY();
    xScroll = scrolls[0]; 
    yScroll = scrolls[1];
    yOffset = 210+63; 

    if (document.body.offsetWidth>800) {
      xOffset = 27-7 +(document.body.offsetWidth - 972 - 20)/2; //203 + (document.body.offsetWidth - 800) / 2;      
    } else {
      xOffset = 30//203;
    } 
  }

  x = xSouris + xScroll - xOffset;
  y = ySouris + yScroll - yOffset;

  if (x < 0 ) { x = 0; }
  if (y < 0 ) { y = 0; }

  setv('x',x);
  setv('y',y); 
  //document.recherchegeo.y.value = y;
  
//alert("x" + document.recherchegeo.x.value +" y" + document.recherchegeo.y.value);

document.recherchegeo.submit();
}

function setv(id,val)
{
 	document.getElementById(id).value=val;
}

function formSetValue(arg1, arg2) {
  eval('document.recherchegeo.'+ arg1 +'.value = '+ arg2);
  document.recherchegeo.submit();
}

function boussole(arg) {
  document.recherchegeo.dir.value = arg;
  document.recherchegeo.submit();
}
