// JavaScript Document
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  popup()
});


function popup()
{
	tab=document.getElementsByTagName("a");
	for(var i=0; i<tab.length; i++)
	{
		if(tab[i].className)
			if(tab[i].className=="e-mail")
			{
				tab[i].href="mailto:"+tab[i].title.replace(" chez ", "@");
				if(tab[i].textContent)tab[i].textContent=tab[i].textContent.replace(" chez ", "@");
				if(tab[i].innerText)tab[i].innerText=tab[i].innerText.replace(" chez ", "@");
			}
	}

	for(i=0;i<document.getElementsByTagName("a").length;i++)
	{
		if(document.getElementsByTagName("a")[i].className)
		{
			if(document.getElementsByTagName("a")[i].className=="pop")
			{
				document.getElementsByTagName("a")[i].onclick=function()
				{
					pop_up = window.open(this.href,"","width=505, height=720, scrollbars=yes,resizable=yes,toolbar=no");
					return false;
				}
			}
			if(document.getElementsByTagName("a")[i].className=="blank")
			{
				document.getElementsByTagName("a")[i].onclick=function()
				{
					pop_up = window.open(this.href);
					return false;
				}
			}
		}
	}
}
