//TEXTE DEFILANT
function changetickercontent(){
      crosstick.style.clip="rect(0px 0px auto 0px)"
      crosstick.innerHTML=tickercontents[currentmessage]
      highlightmsg()
}

function highlightmsg(){
      var msgwidth=crosstick.offsetWidth
      if (clipwidth<msgwidth){
      clipwidth+=highlightspeed
      crosstick.style.clip="rect(0px "+clipwidth+"px auto 0px)"
      beginclip=setTimeout("highlightmsg()",20)
      }
      else{
      clipwidth=0
      clearTimeout(beginclip)
      if (currentmessage==tickercontents.length-1) currentmessage=0
      else currentmessage++
      //setTimeout("changetickercontent()",tickdelay)
      }
}

function start_ticking(){
     crosstick=document.getElementById? document.getElementById("highlighter") : document.all.highlighter
     crosstickParent=crosstick.parentNode? crosstick.parentNode : crosstick.parentElement
     if (parseInt(crosstick.offsetHeight)>0)
     crosstickParent.style.height=crosstick.offsetHeight+'px'
     else
     setTimeout("crosstickParent.style.height=crosstick.offsetHeight+'px'",100) 
     changetickercontent()
}

//FIN TEXTE DEFILANT

function goblink()
	{
	if(document.getElementById && document.all)
		{
		blink_tab = document.getElementsByTagName('blink');
		for(a=0;a<blink_tab.length;a++)
			{
			if(go_visibility[a] != "visible")
				go_visibility[a] = "visible";
			else
				go_visibility[a] = "hidden";
			blink_tab[a].style.visibility=go_visibility[a];
			}
		}
	setTimeout("goblink()", 500);
	}

function OpenWindow(URL, name, style)
{
	window.open(URL, name, style);
}
function resizePopUp(monImage, monTitre)
{
  w = window.open('','chargement','top=120,left=120');
  w.document.write( "<html><head><title>"+monTitre+"</title>\n" ); 
  w.document.write( "<script language='JavaScript'>\n"); 
  w.document.write( "IE5=NN4=NN6=false;\n"); 
  w.document.write( "if(document.all)IE5=true;\n"); 
  w.document.write( "else if(document.getElementById)NN6=true;\n"); 
  w.document.write( "else if(document.layers)NN4=true;\n"); 
  w.document.write( "function autoSize() {\n"); 
  w.document.write( "if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+31)\n"); 
  w.document.write( "else if(NN6) self.sizeToContent();\n");
  w.document.write( "else window.resizeTo(document.images[0].width,document.images[0].height+20)\n"); 
  w.document.write( "self.focus();\n"); 
  w.document.write( "}\n</scri");
  w.document.write( "pt>\n"); 
  w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad='javascript:autoSize();'>" );
  w.document.write( "<a href='javascript:window.close();'><img src='"+monImage+"' border=0 alt='"+monTitre+"'></a>" ); 
  w.document.write( "</body></html>" );
  w.document.close(); 
}
function alternativepopimage(img,titre) { 
w=open("",'image','top=120,left=120,toolbar=no,scrollbars=no,resizable=no'); 
w.document.write("<html><head><title>"+titre+"</title>\n<script type='text/javascript'>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+10,document.images[0].height+30); window.focus();} else { settimeout('checksize()',250) } }</"+"script>"); 
w.document.write("</head><body onload='checksize()' onblur='window.close()' onclick='window.close()' topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>"); 
w.document.write("<img src='"+img+"' border='0' alt='image' /></body></html>"); 
w.document.close(); 
} 
function popimage(img,titre,width,height) 
{
	w=open("","image","top=120,left=120,menubar=no,directories=no,resizable=yes,scrollbars=no,toolbar=no,location=no,width="+width+",height="+height); 
	w.document.write("<html><head><title>"+titre+"</title>\n"); 
	w.document.write("</head><body onblur='window.close()' onclick='window.close()' topmargin=5 leftmargin=5 marginwidth=0 marginheight=0>"); 
	w.document.write("<center><img src='"+img+"' border='0' alt='image' /></center></body></html>"); 
	w.document.close(); 
}

function VerifMasque(idObjet, Masque)
{
	var oSaisie = document.getElementById(idObjet);
	if (oSaisie != null)
	{
		var sVal = new String(oSaisie.value);
		if (sVal != '' && sVal.match(Masque) == null)
		{
			oSaisie.value = '';
			oSaisie.focus();
		}
	}
}

function VerifMail()
{
 	verif_email = document.getElementById("email_internaute").value ;
	var msg ;
	msg ="" ; 	
	
		if (verif_email.indexOf("@")<3)
	  	{
			msg = "L'adresse mail que vous avez renseigné est invalide." ;
		  	alert(msg);
			return false ;
		}
		else
		{
			return true ;
		}
}

function change_pho(La_source,id_article)
{

  document.images["Princ"+id_article].src = La_source;
  
  /*if (navigator.appName == "Netscape" )
  {
	var apres_url = window.location.toString();
    if ( (pos = apres_url.indexOf("&PHO")) != -1)
    {
      apres_url = apres_url.substr(0,pos);
    }
    location.href = apres_url+"&PHO="+La_source+"&scroll="+window.pageYOffset;
  }
  else
  {*/
    for(i=0 ; i<document.images.length ; i++)
    {
      StrSrc = document.images[i].src.toString();
      if (StrSrc.indexOf("photo") != -1 )
      {
        if (document.images[i].src == document.images["Princ"+id_article].src)
        {
          document.images[i].border=2;
        }
        else
        {
          document.images[i].border=0;
        }
      }
    }
    document.images["Princ"+id_article].border=0;
  //}
}
