//teste d'un formulaire
function verif()
{	var stop=0;
	var str='';
	var adresse = document.formulaire.mail.value;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	
	if ((document.formulaire.nom.value == "")||(document.formulaire.nom.value == "Votre nom"))
	{	stop=1;
		str=str+'\n Veuillez entrer votre nom.';
	}
	
	if ((document.formulaire.prenom.value == '')||(document.formulaire.prenom.value == "Votre prénom"))
	{	stop=1;
		str=str+'\n Veuillez entrer prenom.';
	}
	
	if ((document.formulaire.mail.value == '')||(document.formulaire.mail.value == "Votre e-mail"))
	{	stop=1;
		str=str+'\n Veuillez entrer votre adresse e-mail.';
	}
	else
	{	if ((place > -1)&&(adresse.length >2)&&(point > 1)&&(adresse.length > point+2))
		{
		}
		else
		{	str=str+'\n Veuillez entrer une adresse e-mail valide.';
			stop=1;
		}
	}
	
	if (stop==0) document.formulaire.submit();
	else if (str != '' ) alert (str);
}

function FocusText(BoxName) {
	if (BoxName.value == BoxName.defaultValue) { BoxName.value = '';}
}

function BlurText(BoxName) {
	if (BoxName.value == '') { BoxName.value = BoxName.defaultValue;}
}
//désactiver la selection du texte de la page
/*function disableselect(e){ 
return false; 
} 
function reEnable(){ 
return true; 
} 
document.onselectstart=new Function ("return false"); 
if (window.sidebar){ 
document.onmousedown=disableselect; 
document.onclick=reEnable; 
}*/

function PasserAnimation(){
	location.href="societe.php";
}
function Print(){
	self.print();
}
function ValideDomaine(){
	e = frmDomaine.domainname.value;
	if(e==''){
		alert('Entrer un nom de domaine?');
		frmDomaine.domainname.focus();
	}else{
		frmDomaine.submit();
	}
}
function  ValidEmail(email){
	var e=email;
	var valid=false;
	var len=e.length;
	var A = "@";
	var P = ".";
	if(e==''){
		return null;
	}else{
		pos = e.indexOf(A);
		if(pos>-1 && pos+1<len){
			if(e.length>=5){
				S = e.substr(pos+1,len);
				pos_a = S.indexOf(A);
				if(pos_a==-1){
					pos_p = S.indexOf(P);
					len_to_pos_p = pos_p+pos+2;
					real_pos_p = pos+pos_p+1;
					if(pos_p>-1 && len_to_pos_p<len && pos!=real_pos_p-1)valid=true;
				}
			}
		}
		if(valid==true){
			return true;
		}else{
			return false;
		}
	}
}
function LettreInfo(){
	e=document.all.txtemail.value;
	switch(ValidEmail(e)){
		case null:
			alert("Saisie votre email");
			document.all.txtemail.focus();
			break;
		case false:
			alert('Email invalide');
			document.all.txtemail.focus();
			break;
		default:
			loadFrame.location.href = '/includes/info_mailling.php?email='+e;
	}
}
function SubmitContact(){
	valide=true;
	switch(contact.number.value){
		case "0":
			alert('Il faut choisir un département');
			contact.number.selectedIndex=0;
			contact.number.focus();
			valide=false;
			break;
		case "1":
			sService =	"Informations générales";
			break;
		case "2":
			sService =	"Support technique";
			break;
		case "3":
			sService =	"Obtenir un rendez-vous ou consultation";
			break;
		case "4":
			sService =	"Service à la clientèle";
			break;
		case "5":
			sService =	"Partenariats";
			break;
		case "6":
			sService =	"Département de la facturation";
			break;
	}
	sNom = contact.name.value;
	sSujet = contact.subject.value;
	sVille = contact.city.value;
	sPays = contact.country.value;
	sPhone = contact.phone.value;
	sEmail = contact.email.value;
	sQuestion = contact.question.value;
	if(valide){
		if(sNom==''){
			alert('Saisie votre nom');
			parent.contact.name.focus();
		}else{
			switch(ValidEmail(sEmail)){
				case null:
					alert("Saisie votre email");
					parent.contact.email.focus();
					break;
				case false:
					alert('Email invalide');
					parent.contact.email.focus();
					break;
				default:
					if(sQuestion==''){
						alert('Il faut Saisir votre requête');
						contact.question.focus();
					}else{
						sQuery = "service="+sService+"&name="+sNom+"&subject="+sSujet+"&city="+sVille+"&country="+sPays+"&email="+sEmail+"&phone="+sPhone+"&question="+sQuestion;
						loadFrame.location.href = 'includes/contact_confirm.php?'+sQuery;
					}
			}
			
		}
	}
}
var frmElem;
var hdlWin;
function OpenBr(theURL, winName, features, sinput)  { //v2.0
	frmElem = sinput; 
	hdlWin = window.open(theURL, winName, features);
	window.status = hdlWin.name;
}
function InscInfo(){
	e=document.all.txtemail.value;
	if(e==''){
		alert('saisie email');
		document.all.txtemail.focus();
	}else{
		OpenBr('/includes/info_mailling.php?email='+e,'LettreInfo','width:300px;height:350px;top:142px;left:295px','');
		//showModalDialog ('../Pop/' + sNamePop,'','dialogHeight: 350px; dialogWidth: 308px;status: no;resizable: yes;help: no');
		//OpenBr('../Pop/' + sNamePop,'','height=350,width=300,scrollbars=yes,top=142,left=295','');		
	}
}

// pour ouvrir la fenetre d'aide locale 
  function aide_info(url_aide){
	var dest='/help/'+url_aide;
 	window.open (dest, 'AideOffre', 'scrollbars=yes,status=no,width=370,height=240');
}
// pour ouvrir la fenetre d'aide generale
  function aide(url_aide){
	var dest='help/'+url_aide;
 	window.open (dest, 'Aide', 'scrollbars=yes,status=no,width=370,height=240');
}

function aide1(url){
	alert('encours de costructions');
}
function NavUrl(url){
	location.href = url;
}
function MO(e)
{
if (!e)
var e=window.event;
var S=e.srcElement;
while (S.tagName!="TD")
{S=S.parentElement;}
S.className="T";
}
function MU(e)
{
if (!e)
var e=window.event;
var S=e.srcElement;
while (S.tagName!="TD")
{S=S.parentElement;}
S.className="P";
}
function MOD(e)
{
if (!e)
var e=window.event;
var S=e.srcElement;
while (S.tagName!="TD")
{S=S.parentElement;}
S.className="S";
}
function MUD(e)
{
if (!e)
var e=window.event;
var S=e.srcElement;
while (S.tagName!="TD")
{S=S.parentElement;}
S.className="R";
}
function MO_D(e)
{
if (!e)
var e=window.event;
var S=e.srcElement;
while (S.tagName!="TD")
{S=S.parentElement;}
S.className="X";
}
function MU_D(e)
{
if (!e)
var e=window.event;
var S=e.srcElement;
while (S.tagName!="TD")
{S=S.parentElement;}
S.className="W";
}
function MOD_D(e)
{
if (!e)
var e=window.event;
var S=e.srcElement;
while (S.tagName!="TD")
{S=S.parentElement;}
S.className="Y";
}
function MUD_D(e)
{
if (!e)
var e=window.event;
var S=e.srcElement;
while (S.tagName!="TD")
{S=S.parentElement;}
S.className="Y";
}function DoHL()
{
var e=window.event.srcElement;
while (e.tagName!="TR"){e=e.parentElement;}
if (e.className!='SL') e.className='HL';
}
function DoLL()
{
var e=window.event.srcElement;
while (e.tagName!="TR"){e=e.parentElement;}
if (e.className!='SL')	e.className='';
}
function DoSL()
{
var TB=e=window.event.srcElement;
while (TB.tagName!="TABLE")
{TB=TB.parentElement;}
for (var i=0;i<TB.rows.length;i++){TB.rows[i].className='';}
while (e.tagName!="TR"){e=e.parentElement;}
e.className='SL';
}
function isASCII(S){
for (var i=0; i < S.length; i++)
{
if (asCh.indexOf(S.charAt(i)) == -1)
return false;
}
return true;
}
function ValidateEmail(S)
{
var R=false;
if (typeof(S) != "undefined")
{
if (/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test(S))
R=S;
}
return R;
}
function ValidateLooseEmail(S){
var resultS=S.replace(/ /gi, "");
var atIndex  =resultS.indexOf("@");
var dotIndex =resultS.lastIndexOf(".");
if( resultS == "" || !isASCII(resultS) || dotIndex == -1)
return "";
if ( resultS.lastIndexOf("@") != atIndex || resultS.charAt(atIndex+1) == ".")
return "";
if ( atIndex <= 0 || dotIndex < atIndex ||  dotIndex >= resultS.length-1)
return "";
return resultS;
}
function ValidateDomain(S){
var resultS=S.replace(/ /gi, "");
var atIndex  =resultS.indexOf("@");
var dotIndex =resultS.lastIndexOf(".");
if( resultS=="" || !isASCII(resultS) || dotIndex == -1)
return "";
if ( atIndex > 0 || resultS.charAt(atIndex+1) == "." || dotIndex >= resultS.length-1 )
return "";
return resultS.replace(/@/i, "");
}
function isEmail(S) {
var pass=0;
if (window.RegExp) {
var tempS="a";
var tempReg=new RegExp(tempS);
if (tempReg.test(tempS)) pass=1;
}
if (!pass)
return (S.indexOf(".") > 2) && (S.indexOf("@") > 0);
var r1=new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
var r2=new RegExp("^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\}\\~]*[a-zA-Z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\}\\~]\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
return (!r1.test(S) && r2.test(S));
}
function CA(isO,noHL){
var trk=0;
for (var i=0;i<frm.elements.length;i++)
{
var e=frm.elements[i];
if ((e.name != 'allbox') && (e.type=='checkbox'))
{
if (isO != 1)
{
trk++;
e.checked=frm.allbox.checked;
var NotBulkButton=document.all.NotBulkB;
if (frm.allbox.checked)
{
if (!noHL)
hL(e);
if ((folderID == "F000000005") && (trk > 1))
{
NotBulkButton.className='R';
NotBulkButton.children[0].src="http://64.4.22.24/i.p.notjunk.d.gif";
IsNotBulkEnabled=false;
}
}
else
{
if (!noHL)
dL(e);
if (folderID == "F000000005")
{
NotBulkButton.className='P';
NotBulkButton.children[0].src="http://64.4.22.24/i.p.notjunk.gif";
IsNotBulkEnabled=true;
}
}
}
else
{
e.tabIndex=i;
if (folderID != "")
{
var ee=e;
while (ee.tagName!="TR")
{ee=ee.parentElement;}
ee.children[ColspanSize].children[0].tabIndex=i;
}
if (!noHL)
{
if (e.checked)
hL(e);
else
dL(e);
}
}
}
}
}
function doTabIndex(tbleColl)
{
if (tbleColl != null)
{
for (var z=0;z<tbleColl.length;z++)
{
if ((tbleColl.item(z).tagName=='A') || ((tbleColl.item(z).tagName=='INPUT') && (tbleColl.item(z).type!='hidden')) || (tbleColl.item(z).tagName=='SELECT'))
tbleColl.item(z).tabIndex=5;
}
}
}

function DE(D)
{
var R="";
for (var i=0;iD.length;i++)
{
if (D.charCodeAt(i)>=128)
R += "&#"+D.charCodeAt(i)+";";
else
R += D.charAt(i);
}
return R;
}
function OW(strName,iW,iH,TOP,LEFT,R,S,SC,T,TB,URL,TYPE,dArg)
{
if (TYPE=="modal" || TYPE=="modalIframe")
{
var sF=""
var _rv
sF+=T?'unadorned:'+T+';':'';
sF+=TB?'help:'+TB+';':'';
sF+=S?'status:'+S+';':'';
sF+=SC?'scroll:'+SC+';':'';
sF+=R?'resizable:'+R+';':'';
sF+=iW?'dialogWidth:'+iW+'px;':'';
sF+=iH?'dialogHeight:'+iH+'px;':'';
sF+=TOP?'dialogTop:'+TOP+'px;':'';
sF+=LEFT?'dialogLeft:'+LEFT+'px;':'';
if (TYPE=="modal")
_rv=window.showModalDialog(URL+"&r="+Math.round(Math.random()*1000000),dArg?dArg:"",sF);
else
{
var da=new Object()
da.w=iW;
da.h=iH;
da.url=URL;
_rv=window.showModalDialog("/cgi-bin/dasp/ModalIframe.asp?r="+Math.round(Math.random()*1000000),da,sF);
}
if ("undefined" != typeof(_rv) )
return _rv;
}
else
{
var sF=""
sF += iW?'width='+iW+',':'';
sF+=iH?'height='+iH+',':'';
sF+=R?'resizable='+R+',':'';
sF+=S?'status='+S+',':'';
sF+=SC?'scrollbars='+SC+',':'';
sF+=T?'titlebar='+T+',':'';
sF+=TB?'toolbar='+TB+',':'';
sF+=TB?'menubar='+TB+',':'';
sF+=TOP?'top='+TOP+',':'';
sF+=LEFT?'left='+LEFT+',':'';
var HMW=window.open(URL?URL:'about:blank',strName?strName:'',sF);
if ( (document.window != null) && (!HMW.opener) )
HMW.opener=document.window;
HMW.focus();
}
}
function hL(E){
while (E.tagName!="TR")
{E=E.parentElement;}
E.className="H";
}
function dL(E){
while (E.tagName!="TR")
{E=E.parentElement;}
E.className="";
}

function TM()
{
if (!this.showing)
{
var RelObjCords=getXY(this.refTDObj);
if (this.Direction)
{
this.divStyleObj.top = this.frmObj.style.top = RelObjCords.top + -this.divObj.offsetHeight;
this.divStyleObj.left = this.frmObj.style.left = RelObjCords.left;
}
else
{
this.divStyleObj.top = this.frmObj.style.top = RelObjCords.top + 18;
this.divStyleObj.left = this.frmObj.style.left = RelObjCords.left;
}
this.frmObj.style.height=this.divObj.offsetHeight;
this.frmObj.style.width=this.divObj.offsetWidth;
var pCurrMenuObj=ROP(this);
CM(this);
this.SBS('clicked');
this.divStyleObj.visibility = this.frmObj.style.visibility = this.strShow;
this.showing=true;
}
else
{
this.divStyleObj.visibility = this.frmObj.style.visibility = this.strHide;
this.showing=false;
this.SBS();
}
}
function CM(callerObj)
{
for (aIndex=0;aIndex < MOL.length; aIndex++)
{
if ((callerObj) && (callerObj.name != MOL[aIndex].name))
{	
if (MOL[aIndex].showing)
{
MOL[aIndex].TM();
MOL[aIndex].SBS();
}
}
else
{
if (MOL[aIndex].showing)
{
MOL[aIndex].TM();
MOL[aIndex].SBS();
}
}
}
}
function MCH(e, srcObj, srcIsMenuDiv)
{
var srcElem;
if (!e)
var e=window.event;
e.cancelBubble=true;
if (srcObj)
{
var pCurrMenuObj=ROP(srcObj); 
if (!srcIsMenuDiv)
pCurrMenuObj.divObj.onclick="MCH(event,"+srcObj+",true)";
pCurrMenuObj.TM();
}
else
CM();
}

function OMO()
{
if (window.event.srcElement.tagName == "IMG")
event.srcElement.parentElement.className="T";
else
event.srcElement.className="T";
}
function OMOU()
{
if (window.event.srcElement.tagName == "IMG")
event.srcElement.parentElement.className="T";
else
event.srcElement.className="P";
}

var MOL=new Array();
function MenuObj(_A,_B,_C,_D,_E,_F,_G,_H,_I)
{
this.name=_A;
this.bOn=_E;
this.bOf=_F;
this.bA=_G;
this.SBS=SBS;
this.showing=false;
this.TM=TM;
document.onclick=MCH;
this.Direction=_I;
MOL[MOL.length]=this;
this.divObj=eval('document.all.' + _B);
this.divStyleObj=eval('document.all.' + _B + '.style');
this.refTDObj=eval('document.all.' + _C);
if (_D)
this.DdTDObj=eval('document.all.' +  _D);
this.frmObj=eval('document.all.' +  _H);
this.strShow='visible';
this.strHide='hidden';
}

function ROP(ObjRef)
{
var theObj=null;
if (ObjRef)
{
if (typeof ObjRef != 'object')
theObj=eval(ObjRef);
else
theObj=ObjRef;
return theObj;
}
else
return false;
}
function MME(e, srcObj)
{
try
{
if (!e) 
var e=window.event;
var pCurrMenuObj=ROP(srcObj);
if (!pCurrMenuObj.showing)
{
if (e.type == 'mouseover')
pCurrMenuObj.SBS('on');
else if ((e.type == 'mouseout') || (e.type == 'blur'))
pCurrMenuObj.SBS();
}
}
catch(e){}
}

function SBS(wS)
{
if (typeof this.refTDObj != "undefined")
{
if (wS == 'on')
{
if (this.bOn)
{
if (typeof this.DdTDObj != "undefined")
this.DdTDObj.className=this.bOn;
this.refTDObj.className=this.bOn;
}
}
else if (wS == 'clicked')
{
if (this.bA)
{
if (typeof this.DdTDObj != "undefined")
this.DdTDObj.className=this.bA;
this.refTDObj.className=this.bA;
}
}
else
{
if (this.bOf)
{
if (typeof this.DdTDObj != "undefined")
this.DdTDObj.className=this.bOf;
this.refTDObj.className=this.bOf;
}
}
}
}
function getXY(Obj) 
{
for (var sumTop=0,sumLeft=0;Obj!=document.body;sumTop+=Obj.offsetTop,sumLeft+=Obj.offsetLeft, Obj=Obj.offsetParent);
return {left:sumLeft,top:sumTop}
}


function MIT(qaName){
if (frm.elements[qF].value.length == 0 || frm.elements[qF].value.indexOf(qaName) == -1) 
{
if (frm.elements[qF].value.length != 0 && frm.elements[qF].value.charAt(frm.elements[qF].value.length - 1) != ",")
frm.elements[qF].value += ",";
frm.elements[qF].value += qaName;
}
}var aCh="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var dCh="0123456789";
var asCh=aCh + dCh + "!\"#$%&'()*+,-./:;<=>?@[\]^_`{}~";
var folderID="";
ie=document.all?1:0

function G(UR)
{
if (!e)
var e=window.event;
if (e)
e.cancelBubble=true;
if(UR)
location.href=UR+"&"+_UM;
}