var InMenu, Langue = false, Show = 0;

var OtherLang;
var FN = document.location.href;

if (FN.indexOf("EN.php") != -1)
   FN="indexEN.php";
else if (FN.indexOf(".php") == -1)
   FN="index.php";
else
   FN = FN.substring(FN.lastIndexOf("/") + 1);

if (FN.search("EN.php") != -1)
{
   OtherLang = FN.substr(0, FN.lastIndexOf(".") - 2);
   OtherLang = OtherLang + ".php";
   Langue = true;
}
else
   OtherLang = FN.substr(0, FN.lastIndexOf(".")) + "EN.php";

if (Langue)
{
   MenuEN1N = new Image;
   MenuEN1N.src = "Image/MenuEN1.gif";
   MenuEN1H = new Image;
   MenuEN1H.src = "Image/MenuEN1H.gif";

   MenuEN2N = new Image;
   MenuEN2N.src = "Image/MenuEN2.gif";
   MenuEN2H = new Image;
   MenuEN2H.src = "Image/MenuEN2H.gif";

   MenuEN3N = new Image;
   MenuEN3N.src = "Image/MenuEN3.gif";
   MenuEN3H = new Image;
   MenuEN3H.src = "Image/MenuEN3H.gif";
}
else
{
   Menu1N = new Image;
   Menu1N.src = "Image/Menu1.gif";
   Menu1H = new Image;
   Menu1H.src = "Image/Menu1H.gif";

   Menu2N = new Image;
   Menu2N.src = "Image/Menu2.gif";
   Menu2H = new Image;
   Menu2H.src = "Image/Menu2H.gif";

   Menu3N = new Image;
   Menu3N.src = "Image/Menu3.gif";
   Menu3H = new Image;
   Menu3H.src = "Image/Menu3H.gif";
}

function Prop(Obj, ObjName, UseAlert) 
{
   var Res = ""
   for (var t in Obj)
   {
	if (String(Obj[t]).indexOf("function") == -1)
         Res += ObjName + "." + t + " = " + Obj[t];
      if (UseAlert)
         Res += "\n";
      else
         Res += "<BR>";
   }
   if (window.clipboardData)
      window.clipboardData.setData("Text", Res);

   if (UseAlert)
      alert(Res);
   return Res;
}

function OpenMenu(EnterMenu)
{
   InMenu = EnterMenu;

   if (document.layers)
      document.DivMenu.document.images[EnterMenu].src = eval(EnterMenu + "H.src");
   else
      document.images[EnterMenu].src = eval(EnterMenu + "H.src");
}

function CloseMenu(ExitMenu)
{
   if (InMenu == ExitMenu)
   {
      if (document.layers)
         document.DivMenu.document.images[ExitMenu].src = eval(ExitMenu + "N.src");
      else
         document.images[ExitMenu].src = eval(ExitMenu + "N.src");
   }
}

function ReplaceObject(Obj, NewObj) 
{
	var X = Y = 0;
   var W = Obj.clientWidth;
   var H = Obj.clientHeight;

  	do 
   {
   	X += Obj.offsetLeft;
	   Y += Obj.offsetTop;
	} 
   while (Obj = Obj.offsetParent);

   if (X + W < document.body.offsetWidth / 2)
      NewObj.style.marginLeft = X + W + 12;
   else
      NewObj.style.marginLeft = X - NewObj.clientWidth - 16;

   NewObj.style.marginTop = (Y - (NewObj.clientHeight / 2) + (H / 2));

/*   if (X < document.body.offsetWidth / 2)
      NewObj.style.pixelLeft = X + W + 8;
   else
      NewObj.style.pixelLeft = X - NewObj.clientWidth - 8;

   NewObj.style.pixelTop = (Y - (NewObj.clientHeight / 2) + (H / 2));*/
}

LastIndex = -1;
LastLink = '';
Marque = '';
DisSel = false;

var Type = new Array;
Type[0] = {No:"", Link:"", Str:""};

var Car = new Object(42);
Car[0] = {M:"ACURA", SY:1986, EY:2008};
Car[1] = {M:"AUDI", SY:1969, EY:2008};
Car[2] = {M:"BMW", SY:1952, EY:2008};
Car[3] = {M:"BUICK", SY:1946, EY:2008};
Car[4] = {M:"CADILLAC", SY:1950, EY:2008};
Car[5] = {M:"CHEVROLET", SY:1942, EY:2008};
Car[6] = {M:"CHRYSLER", SY:1950, EY:2008};
Car[7] = {M:"DAEWOO", SY:1998, EY:2002};
Car[8] = {M:"DODGE", SY:1941, EY:2008};
Car[9] = {M:"EAGLE", SY:1988, EY:1999};
Car[10] = {M:"FORD", SY:1930, EY:2008};
Car[11] = {M:"GEO", SY:1989, EY:1997};
Car[12] = {M:"GMC", SY:1950, EY:2008};
Car[13] = {M:"HONDA", SY:1969, EY:2008};
Car[14] = {M:"HUMMER", SY:1992, EY:2008};
Car[15] = {M:"HYUNDAI", SY:1983, EY:2008};
Car[16] = {M:"INFINITI", SY:1990, EY:2008};
Car[17] = {M:"ISUZU", SY:1981, EY:2008};
Car[18] = {M:"JAGUAR", SY:1949, EY:2008};
Car[19] = {M:"JEEP", SY:1945, EY:2008};
Car[20] = {M:"KIA", SY:1993, EY:2008};
Car[21] = {M:"LAND ROVER", SY:1950, EY:2008};
Car[22] = {M:"LEXUS", SY:1990, EY:2008};
Car[23] = {M:"LINCOLN", SY:1950, EY:2008};
Car[24] = {M:"MAZDA", SY:1970, EY:2008};
Car[25] = {M:"MERCEDEZ", SY:1950, EY:2008};
Car[26] = {M:"MERCURY", SY:1946, EY:2008};
Car[27] = {M:"MERKUR", SY:1985, EY:1989};
Car[28] = {M:"MINI", SY:2002, EY:2008};
Car[29] = {M:"MITSUBISHI", SY:1983, EY:2008};
Car[30] = {M:"NISSAN", SY:1961, EY:2008};
Car[31] = {M:"OLDSMOBILE", SY:1950, EY:2004};
Car[32] = {M:"PLYMOUTH", SY:1949, EY:2001};
Car[33] = {M:"PONTIAC", SY:1946, EY:2008};
Car[34] = {M:"PORSCHE", SY:1948, EY:2008};
Car[35] = {M:"SAAB", SY:1950, EY:2008};
Car[36] = {M:"SATURN", SY:1991, EY:2008};
Car[37] = {M:"SUBARU", SY:1958, EY:2008};
Car[38] = {M:"SUZUKI", SY:1980, EY:2008};
Car[39] = {M:"TOYOTA", SY:1958, EY:2008};
Car[40] = {M:"VOLKSWAGEN", SY:1950, EY:2008};
Car[41] = {M:"VOLVO", SY:1950, EY:2008};

function SelectTab(Index, Option, Link)
{
   if (Option != 4 && DisSel)
      return;

   if (Option == -1)
   {
      LastIndex = Option;
      return;
   }

   if (Option == 4 && LastLink != '')
   {
      Obj = document.getElementById('DivSelectYear');
      Obj.style.visibility = 'hidden';

      Obj = document.getElementById('PJ2');
      Obj.style.filter = '';

      Obj = document.getElementById('P4');
      Obj.style.filter = '';

      for (t = 0; t < document.getElementsByName('SELECT').length; t++)
      {
         Obj = document.getElementsByName('SELECT')[t];
         Obj.style.backgroundColor = 'WHITE';
			Obj.style.filter = '';
      }
      DisSel = false;
   }
   else if ((Option == 3 || Option == 5) && LastLink != '')
   {
      DisSel = true;

      Marque = LastLink;
      Cur = document.getElementsByName('SELECT')[LastIndex];

      for (t = 0; t < document.getElementsByName('SELECT').length; t++)
      {
         Obj = document.getElementsByName('SELECT')[t];

         if (Obj == Cur)
            Obj.style.backgroundColor = 'WHITE';
         else
         {
            Obj.style.filter = 'alpha(opacity=30)';
            Obj.style.backgroundColor = '#FFFFAC';
         }
      }
      Obj = document.getElementById('PJ2');
      Obj.style.filter = 'alpha(opacity=30)';

      Obj = document.getElementById('P4');
      Obj.style.filter = 'alpha(opacity=30)';

		if (Option == 3)
		{
			Str = '<TABLE CELLPADDING=1 CELLSPACING=3 WIDTH=100% BORDER=0>\n';
			Str += '<TR><TD ID=P2 ALIGN=CENTER COLSPAN=5><IMG SRC="Image/Drapeau.gif" ALIGN=ABSBOTTOM>';
			Str += '<BR>CHOISISSEZ VOTRE ANNÉES ?<BR>\n';
	      Str += '<IMG SRC="Image/UnderLine.gif" WIDTH=190 HEIGHT=9><BR><BR></TD></TR>\n';

	      for (t = Car[LastIndex].EY; t >= Car[LastIndex].SY; t--)
	      {
	         if ((t - Car[LastIndex].EY) % 5 == 0)
	         {
	            if (t != Car[LastIndex].EY)
	               Str += '</TR>\n';
	            Str += '<TR>\n';
	         }
	         Str += '<TD ALIGN=CENTER><A HREF="Pieces.php?M='+Marque+'&A='+ t +'" CLASS="POPUP">'+ t +'</A></TD>\n';
	      }
		}
		else
		{
			Str = '<TABLE CELLPADDING=1 CELLSPACING=2 WIDTH=100% BORDER=0>\n';
			Str += '<TR><TD ID=P2 ALIGN=CENTER><IMG SRC="Image/Drapeau.gif" ALIGN=ABSBOTTOM>';
			Str += '<BR>CHOISISSEZ LE TYPE DE PIECE ?<BR>\n';
	      Str += '<IMG SRC="Image/UnderLine.gif" WIDTH=215 HEIGHT=9><BR><BR></TD></TR>\n';

			Str += '<TR><TD ALIGN=CENTER><IMG SRC="Image/SepLine.gif" WIDTH=250 HEIGHT=7></TD></TR>\n';
			CurT = '';
			for (t = 0; t < Type.length; t++)
				if (Type[t].No == Index)
					if (CurT != Type[t].Sql)
					{
						if (CurT != '')
						{
							Str += '.</A></TD></TR>\n';
							Str += '<TR><TD ALIGN=CENTER><IMG SRC="Image/SepLine.gif" WIDTH=250 HEIGHT=7></TD></TR>\n';
						}
						Str += '<TR><TD ALIGN=CENTER><A HREF="'+ Type[t].Link +'" CLASS="POPUP"> '+ Type[t].Str;
						CurT = Type[t].Sql;
					}
					else
						Str += ', '+ Type[t].Str;
					
			if (CurT != '')
				Str += '.</A></TD></TR>\n';
			Str += '<TR><TD ALIGN=CENTER><IMG SRC="Image/SepLine.gif" WIDTH=250 HEIGHT=7></TD></TR>\n';
		}
      Str += '</TR><TR><TD ID=P2 ALIGN=CENTER COLSPAN=5><BR><A HREF="javascript:" CLASS="POPUP">PRÉCÉDENT</A><BR>\n';
      Str += '<IMG SRC="Image/UnderLine.gif" WIDTH=90 HEIGHT=9></TD></TR>\n';
      Str += '</TABLE><BR>\n';

      Obj = document.getElementById('DivSelectYear');
      Obj.innerHTML = Str;
      Obj.style.visibility = 'visible';

      ReplaceObject(Cur, Obj); 
   }
   else if (Option == 2 && LastLink != '')
   {
      var Suff = (Langue) ? "EN" : "";
      top.location = LastLink;
   }
   else if (Option == 1)
   {
      Obj = document.getElementsByName('SELECT');
      Obj = Obj[Index];
      Obj.style.filter = 'alpha(Opacity=100, FinishOpacity=60, Style=3, StartX=0, StartY=0, FinishX='+ Obj.clientWidth +', FinishY='+ Obj.clientHeight +')';

		document.getElementsByName('IBTL')[Index].src = "Image/BTLH.gif";
		document.getElementsByName('IBT')[Index].src = "Image/BTH.gif";
		document.getElementsByName('IBTR')[Index].src = "Image/BTRH.gif";
		document.getElementsByName('IBL')[Index].src = "Image/BLH.gif";
		document.getElementsByName('IBR')[Index].src = "Image/BRH.gif";
		document.getElementsByName('IBBL')[Index].src = "Image/BBLH.gif";
		document.getElementsByName('IBB')[Index].src = "Image/BBH.gif";
		document.getElementsByName('IBBR')[Index].src = "Image/BBRH.gif";

      if (LastIndex != Index)
      {
         LastIndex = Index;
         LastLink = Link;
      }
   }
   else
   {
      Obj = document.getElementsByName('SELECT')[Index];
		Obj.style.filter = '';

		document.getElementsByName('IBTL')[Index].src = "Image/BTL.gif";
		document.getElementsByName('IBT')[Index].src = "Image/BT.gif";
		document.getElementsByName('IBTR')[Index].src = "Image/BTR.gif";
		document.getElementsByName('IBL')[Index].src = "Image/BL.gif";
		document.getElementsByName('IBR')[Index].src = "Image/BR.gif";
		document.getElementsByName('IBBL')[Index].src = "Image/BBL.gif";
		document.getElementsByName('IBB')[Index].src = "Image/BB.gif";
		document.getElementsByName('IBBR')[Index].src = "Image/BBR.gif";

      LastIndex = 0;
      LastLink = '';
   }
}

function ShowPub(Option)
{
	if (Option == 1)
	{
		document.writeln("</TD><TD ID=TDMAINR ALIGN=CENTER VALIGN=TOP>");
	
		document.writeln("<BR><IMG SRC=\"Image/Livraison.gif\"><BR><BR>");

		document.writeln("<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=125>");
		document.writeln("<TR><TD ID=P2 ALIGN=CENTER><FONT ID=REDTEXT SIZE=+1>ACHETEZ EN LIGNE</FONT><BR>");
		document.writeln("<IMG SRC=\"Image/Space.gif\" WIDTH=1 HEIGHT=5><BR>");
 		document.writeln("VOS PIECES D'AUTO ET RECEVEZ-LES A VOTRE PORTE EN<BR>");
		document.writeln("<IMG SRC=\"Image/Space.gif\" WIDTH=1 HEIGHT=5><BR>");
		document.writeln("<FONT ID=REDTEXT SIZE=+1>1 JOUR OUVRABLE</FONT></TD></TR>");
		document.writeln("</TABLE><BR>");

		document.writeln("<IMG SRC=\"Image/Cadena.gif\" ALIGN=ABSBOTTOM><BR>");
		document.writeln("<IMG SRC=\"Image/Space.gif\" WIDTH=1 HEIGHT=10><BR>");

		document.writeln("<A HREF=\"https://www.internetsecure.com/cgi-bin/certified.mhtml?merchant_number=13089&language=FR\">");
		document.writeln("<IMG SRC=\"http://www.internetsecure.com/images/ismer-fr_sm.gif\" BORDER=0 WIDTH=98 HEIGHT=33></A><BR>");
		document.writeln("<IMG SRC=\"Image/Space.gif\" WIDTH=1 HEIGHT=7><BR>");
		document.writeln("<FONT SIZE=-2>comme avec</FONT><BR><IMG SRC=\"Image/PayPal.gif\" BORDER=0><BR>");
		document.writeln("<IMG SRC=\"Image/Space.gif\" WIDTH=1 HEIGHT=10><BR>");
		
      document.writeln("<IMG SRC=\"Image/Accept.gif\" BORDER=0><BR>");
      document.write("<A HREF=\"http://www.interaconline.com/learn\" TARGET=_BLANK ONCLICK=\"window.open('http://www.interacenligne.com/renseignements','Learn','toolbar=false,status=false,directories=false,location=false,menubar=false,resizable,scrollbars,width=700,height=500');return false;\">");
      document.writeln("<IMG SRC=\"Image/AcceptI.gif\" BORDER=0></A><BR><BR>");
	}
}

SelCnt = 0;
function DrawBox(Link, L, H, Option)
{
	if (Option)
	{
		if (Link == "")
			document.writeln("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>");
		else
			document.writeln("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 ONCLICK=\"SelectTab("+ SelCnt +", "+ Option +", '" + Link + "')\" ONMOUSEOUT=\"SelectTab(0, -1, '')\">");

		document.writeln("<TR><TD><IMG NAME=IBTL SRC=\"Image/BTL.gif\"></TD>");
		document.writeln("<TD><IMG NAME=IBT SRC=\"Image/BT.gif\" WIDTH=100% HEIGHT=8></TD>");
		document.writeln("<TD><IMG NAME=IBTR SRC=\"Image/BTR.gif\"></TD></TR>");
		document.writeln("<TR><TD><IMG NAME=IBL SRC=\"Image/BL.gif\" WIDTH=8 HEIGHT="+ H +"></TD>");
		if (Link == "" && Option == 4)
			document.writeln("<TD ID=SELECT ALIGN=RIGHT WIDTH="+ (L - 2) +">");
		else if (Link == "" && Option == 3)
			document.writeln("<TD ID=SELECT ALIGN=CENTER VALIGN=TOP WIDTH="+ (L - 2) +">");
		else if (Link == "")
			document.writeln("<TD ID=SELECT ALIGN=CENTER WIDTH="+ (L - 2) +">");
		else
			document.writeln("<TD NAME=SELECT ID=SELECT ALIGN=CENTER WIDTH="+ (L - 2) +" ONMOUSEOVER=\"SelectTab("+ SelCnt +", 1, '" + Link + "')\" ONMOUSEOUT=\"SelectTab("+ SelCnt +", 0, '')\">");
		SelCnt++;
	}
	else
	{
		document.writeln("</TD>");
		document.writeln("<TD><IMG NAME=IBR SRC=\"Image/BR.gif\" WIDTH=11 HEIGHT="+ H +"></TD></TR>");
		document.writeln("<TR><TD><IMG NAME=IBBL SRC=\"Image/BBL.gif\"></TD>");
		document.writeln("<TD><IMG NAME=IBB SRC=\"Image/BB.gif\" WIDTH=100% HEIGHT=11></TD>");
		document.writeln("<TD><IMG NAME=IBBR SRC=\"Image/BBR.gif\"></TD></TR>");
		document.writeln("</TABLE>");

		if (Link == "")
			document.getElementsByName('SELECT')[SelCnt - 1].style.cursor = 'default';
	}
}

function OP(Value)
{
	document.forms.namedItem('Panier').elements.namedItem('OP').value = Value;
	document.forms.namedItem('Panier').submit();
}

function LOG(Value, Form)
{
	Obj = (Form == 0) ? document.forms.namedItem('LogForm') : 
			(Form == 1) ? document.forms.namedItem('CreateForm') : document.forms.namedItem('FormAchat');
	
	if (Form == 2 && ValidationAchat())
	{
		Obj.elements.namedItem('LOG').value = Value;
		Obj.submit();
	}
	if (Form != 2 && ((Value != 1 && Value != 3) || ValidationLog(Obj)))
	{
		if (Form == 0 && (Value == 6 || Value == 2))
			Obj.action = 'index.php';
			
		Obj.elements.namedItem('LOG').value = Value;
		Obj.submit();
	}
}

function ReadCook(Name) 
{ 
	var Value = ""; 
	var Search = Name + "=";
 
	if(document.cookie.length > 0)
	{ 
		Off = document.cookie.indexOf(Search); 
		if (Off != -1) 
		{ 
			Off += Search.length; 
			End = document.cookie.indexOf(";", Off); 
			if (End == -1) 
				End = document.cookie.length; 
			Value = unescape(document.cookie.substring(Off, End));
		} 
	} 
	return Value; 
} 

function WriteCook(Name, Value) 
{ 
	var Expire = new Date((new Date()).getTime() + 18748800); 

	Expire = "; expires=" + Expire.toGMTString(); 
	Path = "; path=/"; 
	document.cookie = Name + "=" + escape(Value) + Expire + Path; 
} 

function CheckBorder()
{
   var W, H;
   if (navigator.appName == "Netscape")
   {
      W = window.innerWidth;
      H = window.innerHeight;
   }
   else
   {
      W = document.body.offsetWidth;
      H = document.body.offsetHeight;
   }

   if (W < 780 && H < 330)
   {
      window.resizeBy(780 - W, 330 - H);
      return true;
   }
   else if (W < 780 && H >= 330)
   {
      window.resizeBy(780 - W, 0);
      return true;
   }
   else if (W >= 780 && H < 330)
   {
      window.resizeBy(0, 330 - H);
      return true;
   }
}

function ResizeBorder()
{
   if (navigator.appName == "Netscape")
      PageW = window.innerWidth;
   else
      PageW = document.body.offsetWidth;

//   document.images['ContentSpace'].width = PageW - 150;
//   document.images['TopSpace'].width = document.images['ContentSpace'].width;
//   document.images['BottomSpace'].width = document.images['ContentSpace'].width;
}

function CheckEmail(Str) 
{
   var knownDomsPat = /^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
   var emailPat = /^(.+)@(.+)$/;
   var specialChars = "\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
   var validChars = "\[^\\s" + specialChars + "\]";
   var quotedUser = "(\"[^\"]*\")";
   var ipDomainPat = /^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
   var atom = validChars + '+';
   var word = "(" + atom + "|" + quotedUser + ")";
   var userPat = new RegExp("^" + word + "(\\." + word + ")*$");
   var domainPat = new RegExp("^" + atom + "(\\." + atom +")*$");
   var matchArray = Str.match(emailPat);

   if (!matchArray) 
   {
      if (Langue)
         alert("Invalid « Email » format !");
      else
         alert("Adresse de « Courrier Électronique » invalide (1)!");
      return false;
   }
   var user = matchArray[1];
   var domain = matchArray[2];

   for (i = 0; i < user.length; i++) 
      if (user.charCodeAt(i) > 127) 
      {
         if (Langue)
            alert("Invalid « Email » format !");
         else
            alert("Adresse de « Courrier Électronique » invalide (2)!");

         return false;
      }

   for (i = 0; i < domain.length; i++)
      if (domain.charCodeAt(i) > 127) 
      {
         if (Langue)
            alert("Invalid « Email » format !");
         else
            alert("Adresse de « Courrier Électronique » invalide (3)!");
         return false;
      }

   if (!user.match(userPat)) 
   {
      if (Langue)
         alert("Invalid « Email » format !");
      else
         alert("Adresse de « Courrier Électronique » invalide (4)!");
      return false;
   }
   var IPArray = domain.match(ipDomainPat);
   if (IPArray) 
   {
      for (i = 1; i <= 4; i++) 
      {
         if (IPArray[i] > 255) 
         {
            if (Langue)
               alert("Invalid « Email » format !");
            else
               alert("Adresse de « Courrier Électronique » invalide (5)!");
            return false;
         }
      }
      return true;
   }
   var atomPat = new RegExp("^" + atom + "$");
   var domArr = domain.split(".");
   var len = domArr.length;
   for (i = 0; i < len; i++) 
      if (domArr[i].search(atomPat) == -1) 
      {
         if (Langue)
            alert("Invalid « Email » format !");
         else
            alert("Adresse de « Courrier Électronique » invalide (6)!");
         return false;
      }

   if (domArr[domArr.length - 1].length != 2 && domArr[domArr.length - 1].search(knownDomsPat) == -1)
   {
      if (Langue)
         alert("Invalid « Email » format !");
      else
         alert("Adresse de « Courrier Électronique » invalide (7)!");
      return false;
   }
   if (len < 2) 
   {
      if (Langue)
         alert("Invalid « Email » format !");
      else
         alert("Adresse de « Courrier Électronique » invalide (8)!");
      return false;
   }
   return true;
}

function Validation()
{
   if (document.Formulaire.Nom && document.Formulaire.Nom.value == "")
   {
      if (Langue)
         alert("You must enter a « Contact Name » !");
      else
         alert("Vous devez spécifier une « Personne à Contacter » !");

	   document.Formulaire.Nom.focus();
	   return false;
   }
   if (document.Formulaire.Courrier && document.Formulaire.Courrier.value == "")
   {
      if (Langue)
         alert("You must enter a « Email » !");
      else
         alert("Vous devez spécifier un « Courrier Électronique » !");
      document.Formulaire.Courrier.focus();
      return false;
   }
   else if (document.Formulaire.Courrier && !CheckEmail(document.Formulaire.Courrier.value))
   {
	   document.Formulaire.Courrier.focus();
	   return false;
   }
   if (document.Formulaire.Sujet && document.Formulaire.Sujet.value == "")
   {
      if (Langue)
         alert("You must enter a « Subject » !");
      else
         alert("Vous devez spécifier un « Sujet » !");
   	document.Formulaire.Sujet.focus();
   	return false;
   }
   if (document.Formulaire.Commentaire && document.Formulaire.Commentaire.value == "")
   {
      if (Langue)
         alert("You must enter a « Message » !");
      else
         alert("Vous devez spécifier un « Message » !");
   	document.Formulaire.Commentaire.focus();
   	return false;
   }
   return true;
}

function ValidationLog(Obj)
{
   if (Obj.Courrier && Obj.Courrier.value == "")
   {
      if (Langue)
         alert("You must enter a « Email » !");
      else
         alert("Vous devez spécifier un « Courrier Électronique » !");
      Obj.Courrier.focus();
      return false;
   }
   if (Obj.Courrier && Obj.Courrier.value != 'Gilbert' && !CheckEmail(Obj.Courrier.value))
   {
	   Obj.Courrier.focus();
	   return false;
   }
   if (Obj.Password && Obj.Password.value == "")
   {
      if (Langue)
         alert("You must enter a « Password » !");
      else
         alert("Vous devez spécifier un « Mot Passe » !");
   	Obj.Password.focus();
   	return false;
   }
   if (Obj.Password && Obj.Password.value.length < 6)
   {
      if (Langue)
         alert("You must enter a minimum of « 6 Caracters » for the password !");
      else
         alert("Vous devez spécifier un minimum de « 6 Caractères » pour le mot passe !");
   	Obj.Password.focus();
   	return false;
   }
   return true;
}

function ValidationAchat()
{
   if (document.FormAchat.xxxCompany && document.FormAchat.xxxCompany.value == "")
   {
      alert("Vous devez spécifier un « Nom » !");
		document.FormAchat.xxxCompany.focus();
		return false;
   }
   if (document.FormAchat.xxxAddress && document.FormAchat.xxxAddress.value == "")
   {
      alert("Vous devez spécifier une « Adresse Civic » !");
		document.FormAchat.xxxAddress.focus();
		return false;
   }
   if (document.FormAchat.xxxCity && document.FormAchat.xxxCity.value == "")
   {
      alert("Vous devez spécifier une « Ville » !");
		document.FormAchat.xxxCity.focus();
		return false;
   }
   if (document.FormAchat.xxxPostal && document.FormAchat.xxxPostal.value == "")
   {
      alert("Vous devez spécifier un « Code Postal » !");
		document.FormAchat.xxxPostal.focus();
		return false;
   }
   if (document.FormAchat.xxxName && document.FormAchat.xxxName.value == "")
   {
      alert("Vous devez spécifier un « Nom sur la Carte » !");
		document.FormAchat.xxxName.focus();
		return false;
   }
   if (document.FormAchat.xxxEmail && document.FormAchat.xxxEmail.value == "")
   {
      alert("Vous devez spécifier un « Courrier Électronique » !");
		document.FormAchat.xxxEmail.focus();
		return false;
   }
   else if (document.FormAchat.xxxEmail && !CheckEmail(document.FormAchat.xxxEmail.value))
   {
		document.FormAchat.xxxEmail.focus();
		return false;
   }
   if (document.FormAchat.xxxPhone && document.FormAchat.xxxPhone.value == "")
   {
      alert("Vous devez spécifier un « Numéro de Téléphone » !");
		document.FormAchat.xxxPhone.focus();
		return false;
   }
   return true;
}

function VariableEnv()
{
   var Value = '<!--#echo var="REDIRECT_STATUS"-->';
   document.write("Erreur " + Value);
}

function _estat(_s, _p, _c)
{
   var _S="http://perso.estat.com/m/00/";
   var _M=_s+"?";
   _M+="n="+Math.round(Math.random()*1000000000);
   _M+="&c="+escape(_c);
   _M+="&p="+escape(_p);
   var _R = (top!=null && top.location!=null && typeof(top.location.href)=="string") ? escape(top.document.referrer) : escape(document.referrer);

   if (_R=="undefined"||_R=="")
      _R="_bm_";
   _M+="&r="+_R;
   if(typeof(screen)=="object")
   {
      _M+="&scw="+screen.width;
      _M+="&sch="+screen.height;
      _M+="&scp="+screen.colorDepth
   };
   document.write('<A HREF="http://www.estat.com/getstats?serial='+_s+'" TARGET="_blank"><IMG'+' BORDER=0 SRC="'+_S+_M+'"></A>');
}

function GetURLParam(Param)
{
   Page = window.location.href;
   Liste = Page.split(new RegExp(Param + "=", "g"));
   Find = "";

   if (Liste.length != 1)
   {
      Find = Liste[1].split(new RegExp("&", "g"));
      if (Find.length != 1)
         Find = Find[0];
   }
   return Find;
}
