DivOut = false;
Tmr = null;

iframeids=["fileWindow"]
iframehide = 'yes';
getFFVersion = navigator.userAgent.substring(navigator.userAgent.indexOf('Firefox')).split('/')[1];
FFextraHeight=parseFloat(getFFVersion) >= 0.1 ? 16 : 0

function resizeCaller () {
 dyniframe = new Array();
 for (i = 0; i < iframeids.length; i++) {
  if (document.getElementById) {resizeIframe(iframeids[i]);}
  if ((document.all || document.getElementById) && iframehide == 'no') {
   tempobj = document.all ? document.all[iframeids[i]] : document.getElementById(iframeids[i])
   tempobj.style.display = 'block';
  }
 }
}

function resizeIframe (frameid) {
 currentfr = document.getElementById(frameid);
 if (currentfr && !window.opera) {
  currentfr.style.display = 'block';
  if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) {
   currentfr.height = currentfr.contentDocument.body.offsetHeight + FFextraHeight;
  } else if (currentfr.Document && currentfr.Document.body.scrollHeight) {
   currentfr.height = currentfr.Document.body.scrollHeight;
  }
  if (currentfr.addEventListener) {
   currentfr.addEventListener('load', readjustIframe, false);
  } else if (currentfr.attachEvent) {
   currentfr.detachEvent('onload', readjustIframe);
   currentfr.attachEvent('onload', readjustIframe);
  }
 }
 scroll(0, 0);
}

function readjustIframe (loadevt) {
 crossevt = (window.event) ? event : loadevt
 iframeroot = (crossevt.currentTarget) ? crossevt.currentTarget : crossevt.srcElement
 if (iframeroot) {resizeIframe(iframeroot.id);}
}

if (window.addEventListener) {
 window.addEventListener('load', resizeCaller, false);
} else if (window.attachEvent) {
 window.attachEvent('onload', resizeCaller);
} else {
 window.onload=resizeCaller;
}

function Mnu_Over (id, lg) {
 obj = document.getElementById('IMG' + id);
 obj.src = './images/menu/' + lg + '/' + id + '_2.png';
}

function Mnu_Out (id, lg) {
 obj = document.getElementById('IMG' + id);
 obj.src = './images/menu/' + lg + '/' + id + '_1.png';
}

function Mnu_Show (id) {
 obj = document.getElementById('DivAbout');
 obj.style.display = 'none';
 obj = document.getElementById('DivEvents');
 obj.style.display = 'none';
 obj = document.getElementById('DivPress');
 obj.style.display = 'none';
 objA = document.getElementById('Site');
 t = objA.offsetTop;
 l = objA.offsetLeft;
 switch (id) {
  case 'About':
   objB = document.getElementById('Div' + id);
   objB.style.top = t + 155 + 'px';
   objB.style.left = l + 357 + 'px';
   objB.style.display = '';
   break;
  case 'Events':
   objB = document.getElementById('Div' + id);
   objB.style.top = t + 161 + 'px';
   objB.style.left = l + 447 + 'px';
   objB.style.display = '';
   break;
  case 'Press':
   objB = document.getElementById('Div' + id);
   objB.style.top = t + 165 + 'px';
   objB.style.left = l + 537 + 'px';
   objB.style.display = '';
   break;
  case 'Home':
   objB = document.getElementById('Div' + id);
   objB.style.top = t + 134 + 'px';
   objB.style.left = l + 248 + 'px';
   objB.style.display = '';
   break;
 }
}

function Mnu_Hide (id) {
 objB = document.getElementById('Div' + id);
 objB.style.display = 'none';
}

function Div_Over () {
 clearTimeout(Tmr);
}

function Div_Out_Tmr (id) {
 Tmr = setTimeout('Div_Out(\'' + id + '\')', '200');
}

function Div_Out (id) {
 if (DivOut) {
  DivOut = false;
  Mnu_Hide(id);
 }
}

function Show_Rep (id) {
 obj = document.getElementById('FAQ' + id);
 if (obj.style.display == '') {
  obj.style.display = 'none';
 } else {
  hDIV = document.getElementsByTagName('div');
  for (i = 0; i < hDIV.length; i++) {
   if (hDIV[i].id.substr(0, 3) == 'FAQ') {
    hDIV[i].style.display = 'none';
   }
  }
  obj = document.getElementById('FAQ' + id);
  obj.style.display = '';
 }
 Mnu_Show('Home');
}

function Open_Form (page) {
 window.open('http://www.reachforlife.eu/forms/' + page + '_UK.php', 'Form', 'width=700, height=563, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, copyhistory=no, resizable=no');
}

function Sign () {
 temp0 = "";
 if (form1.nom.value == "") {
  temp0 = temp0 + "Veuillez remplire le champ \"Nom\".\r\n";
 }
 if (form1.mail.value == "") {
  temp0 = temp0 + "Veuillez remplire le champ \"E-Mail\".\r\n";
 }
 if (temp0 != "") {
  alert(temp0);
  return false;
 } else {
  return true;
 }
}

function test () {
 temp0 = "";
 if (form1.Nom.value == "") {
  temp0 = temp0 + "Veuillez remplire le champ \"Nom\".\r\n";
 }
 if (form1.Mail.value == "") {
  temp0 = temp0 + "Veuillez remplire le champ \"E-Mail\".\r\n";
 }
 if (temp0 != "") {
  alert(temp0);
  return false;
 } else {
  return true;
 }
}