﻿// Anti-mail non prévu.
// Usage : NoMail( 'fin DNS', 'compte', 'début DNS', 'title du lien' );
function NoMail( s1, s2, s3, title )
{
	document.write( "<a title='" + title + "' href='mailto:" + s2 + "@" + s3 + s1 + "'>" + s2 + "@" + s3 + s1 + "</a>" );
}

// Dessine un flash (correctif pour IE, afin d'éviter le cadre clignotant désagréable)
function draw_flash( name, width, height )
{
	document.write( "<object type=\"application/x-shockwave-flash\" data=\"" + name + "\" style=\"width: " + width + "px; height: " + height + "px\">" );
	document.write( "<param name=\"movie\" value=\"" + name + "\">" );
	document.write( "<param name=\"quality\" value=\"high\">" );
	document.write( "<param name=\"menu\" value=\"false\">" );
	document.write( "</object>" );
}

function recherche()
{
	texte = document.Recherche.Texte.value;
	valid = true;
	if (texte=="")
	{
		alert("Le champ de recherche est vide");
		document.Recherche.Texte.focus();
		valid=false;
	}
	if (valid)
	{
		document.location.href = document.location.href.split("?")[0] + "?p=Search&search="+texte;
	}

}
function fixPNG() {
	if(navigator.appName == 'Microsoft Internet Explorer') {
		var png = /\.png$/;
		var imgs = document.getElementsByTagName("img");
		for(var i = 0 ; i < imgs.length; i++) {
			if(imgs.item(i).src.indexOf(".png")>0) {
				imgs.item(i).style.width = imgs.item(i).offsetWidth;
				imgs.item(i).style.height = imgs.item(i).offsetHeight;
				imgs.item(i).style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + imgs.item(i).src + '\',sizingMethod=\'image\')';
				imgs.item(i).src = '/img/pix.gif';
			}
		}
	}
}

function display(sel)
{
	options = sel.options;
	for (i = 0 ; i < options.length ; i++) 
	{
		if (options[i].value == sel.options[sel.selectedIndex].value) 
		{
			document.getElementById(options[i].value).style.display = "";
		}
		else
		{
			document.getElementById(options[i].value).style.display = "none";
		}		
	}
}

function AffNb(check)
{
	if (check.checked)
	{
		document.getElementById("Nb"+check.value).style.display = "";
	}
	else
	{
		document.getElementById("Nb"+check.value).style.display = "none";
	}
	
}

function calculArhes(){
	tmp  = document.getElementById("TarifTotal").value * 0.25;
	document.getElementById("Arrhes").value = tmp;
	document.getElementById("TotalArrhes").value = parseFloat(tmp) + parseFloat(document.getElementById("Frais").value);
}

function suivant(enCours, suivant, limit)
  {
  if (enCours.value.length == limit)
    document.getElementById(suivant).focus();
  }