function calculette(stylesheet){
	fenetreNote = window.open('http://www.pagesimmo.com/monagence/calculette.asp?css='+escape(stylesheet),'Calculette','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no,' + 'width=360' + ',height=250');
	fenetreNote.focus();
	fenetreNote.document.close();
	return false;
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}

function domailsubject(mb,ndd,subject)
{
	s = 'mailto:' + mb + '@' + ndd + '?subject=' + subject;
	location.href =  s;
}

function domail(mb,ndd)
{
	s = 'mailto:' + mb + '@' + ndd;
	location.href =  s;
}

function writemail3(mb,ndd,text)
{
	document.write('<a href="javascript:domail(\'' + mb + '\',\'' + ndd + '\')">' + text + '</a>');
}

function writemail2(mb,ndd)
{
	writemail3(mb,ndd,mb + '@' + ndd);
}

function FrontPage_Form1_Validator(theForm)
{

  if (theForm.mail.value == "")
  {
    alert("Tapez une valeur pour le champ \"Email\".");
    theForm.mail.focus();
    return (false);
  }

  if (theForm.mail.value.length < 5)
  {
    alert("Tapez au moins 5 caractères dans le champ \"Email\".");
    theForm.mail.focus();
    return (false);
  }
  return (true);
}

//corrige bug ie6 affichage png
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
function correctImg(){
    if ((version >= 5.5) && (document.body.filters)){
     for(var i=0; i<document.images.length; i++){
     var img = document.images[i]
     var imgName = img.src.toUpperCase()
     if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){
       var imgID = (img.id) ? "id='" + img.id + "' " : ""
       var imgClass = (img.className) ? "class='" + img.className + "' " : ""
       var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
       var imgStyle = "display:inline-block;" + img.style.cssText
       if (img.align == "left") imgStyle = "float:left;" + imgStyle
       if (img.align == "right") imgStyle = "float:right;" + imgStyle
       if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
       var strNewHTML = "<span " + imgID + imgClass + imgTitle
       + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
       + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
       + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
       img.outerHTML = strNewHTML
       i = i-1
       }
      }
     }
 }

function MAInit()
{
    externalLinks();
    correctImg();
}

// IE only !! window.attachEvent("onload", externalLinks);
//window.onload = externalLinks;
//window.addEventListener("onload", correctImg, true);

if(document.addEventListener)
{
    document.addEventListener("DOMContentLoaded", MAInit, false); // for Mozilla
    document.addEventListener("load", MAInit, false); // for other good browsers
} else {
    window.onload = MAInit;
}
