window.onload = theStartFunction;

function lien_faq1(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/prive/assistance/faq1.html";
}

function lien_faq2(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/prive/assistance/faq2.html";
}

function lien_faq3(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/prive/assistance/faq3.html";
}

function lien_faq5(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/prive/assistance/faq5.html";
}

function lien_faq6(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/prive/assistance/faq6.html";
}

function lien_ie(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/prive/assistance/config_explorer.html";
}

function lien_bell(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/prive/assistance/config_bellAvantage.html";
}

function lien_telechargement(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/public/inforoute/telechargement.html";
}

function lien_communique(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/prive/inforoute/communiques.html";
}

function lien_telechargement(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/public/inforoute/telechargement.html";
}

function lien_infoconnexion(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/prive/inforoute/info_connexion.html";
}

function lien_ProduitsSelectionne(){
	alert("Cette section est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/prive/conseilsAchats/produits.html";
}

function lien_Ententes(){
	alert("Cette section est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/prive/conseilsAchats/ententes.html";
}

function lien_avi(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="https://inforoute.notarius.net/chambre/formation/conti/conti.htm";
}

function lien_politique(){
	alert("Cette page est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/prive/signature_num/politique.html";
}

function lien_oubliMp(){
	alert("Veuillez contacter un AVI de SNC Lavalin inc.");
}

function lien_conseilsAchats(){
	alert("Cette section est réservée exclusivement à l'usage des notaires abonnés à l'Inforoute notariale.");
	window.location.href="/public/conseilsAchats/index.html";
}
function lien_globetrotter(){
	alert("Mise en garde :  Tous changements de plan à GlobeTrotter, doivent se faire obligatoirement par l'intermédiaire de Notarius.");
	window.open("https://pournosabonnes.globetrotter.net/icmf/run/ICMW380a","","toolbar=yes,menubar=yes");
}

function cent(amount) {
// returns the amount in the .99 format 
    amount -= 0;
    amount = (Math.round(amount*100))/100;
    return (amount == Math.floor(amount)) ? amount + '.00' : (  (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
}

function setStringToNumber(num)
{
	num=num.replace("$","");
	num=num.replace(",",".");
	num=num.replace(" ","");
	return  new Number(num);
}
function setNumberToString(number)
{
	var checkModulo= number.length%3;
	var newNumber = Array();
	var count=0;
	for(i=number.length-1;i>=0;i--)
	{
		lettre = number.charAt(i);
		if(!(count%3) && i!=number.length-1)
		{
			newNumber.push(" ");
		}
		newNumber.push(lettre);
		count++;
	}
	total = newNumber.reverse();
	stringTotal="";
	for(i=0;i<total.length;i++)
	{
		stringTotal+=total[i];
	}
	return stringTotal;
}

function calculate(itm, id)
{
	var td = itm.parentNode;//prend le td du checkbox
	theTr = td.parentNode;//prend le tr
	trTds=theTr.getElementsByTagName("td");//prendre les tds pour trouver celui du text avec le total le dernier
	thePrice=trTds[trTds.length-1].innerHTML;// prend le contenue du td ( le derniex td )
	prixString = setStringToNumber(thePrice);// mets le string en number
	currentId=id+"Total";//ajouter le total
	theTotal = document.getElementById(currentId).innerHTML; // prendre le total dans le tableau
	currentTotal = setStringToNumber(theTotal); // le mettre en number
	num=new Number(prixString); // set number
	// validation au niveau des options button
	if( itm.type == 'radio' && id == 'installation' ){
		routerItem = document.getElementById('installationRouter');
		if(routerItem.checked){currentTotal = new Number(routerItem.value);currentTotal += num;}
		else{currentTotal = num;}
	}
	else{(itm.checked==1)?(currentTotal += num):(currentTotal -= num);}
	// fin de la validation
	totalString = new String(cent(currentTotal));// separe en centieme
	totalTemporaire = totalString.split(".");// separe en deux pour avoir a gauche des centieme
	var number = setNumberToString(totalTemporaire[0]);// traite en number
	currentTotal = number+","+totalTemporaire[1]+" $"; // reformer la string
	document.getElementById(id+"Total").innerHTML=currentTotal; //  affiche le total dans le tableau.
}

function go(form){
   if (!(form.type[0].checked || form.type[1].checked))
      alert("Information manquante : Veuillez remplir tous les champs obligatoires indiqués par un astérix(*).");
   else{
      form.submit();
   } 
}

function setLinkOnIconTop(objectId)
{
	var li =document.getElementById(objectId);
	var theA = li.getElementsByTagName("a")[0];
	theA.onclick=function(){window.open(theA.href,'w1','scrollbars=no,width=250,height=375,left=0,top=0');return false;}
}
function getNoCoordLink(id)
{
	theA=document.getElementById(id);
	theA.onclick=function(){window.open(theA.href,'w1','scrollbars=no,width=250,height=375,left=0,top=0');return false;}
}


function runIntro()
{
	var contentDiv = document.getElementById('intro').innerHTML =
	'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="383" height="182">\n' +
	'<param name=movie value="/media/intro8.swf">\n' +
	'<param name=quality value=high>\n' +
	'<embed src="/media/intro8.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="383" height="182"></embed>\n' +
	'</object>\n';
}

function isSslHeader()
{
	// Detecter ladress dans le url;
	_url = document.URL;
	_isSSL =  _url.substr(0,5);
	if(_isSSL=="https") /// si _isSSl detect le https
	{
		document.getElementById('header').className = 'sslheader';
	}
}

function tableruler()
{
	if (document.getElementById && document.createTextNode)
	{
		var tables=document.getElementsByTagName('table');
		for (var i=0;i<tables.length;i++)
		{
			if(tables[i].className=='ruler')
			{
				var trs=tables[i].getElementsByTagName('tr');
				for(var j=0;j<trs.length;j++)
				{
					if(trs[j].parentNode.nodeName=='TBODY')
					{
						trs[j].onmouseover=function(){this.className='ruled';return false}
						trs[j].onmouseout=function(){this.className='';return false}
					}
				}
			}
		}
	}
}

function startSnAuth()
{
	/*
	
	classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
	codebase="MSJavWU_8073687b82d41db93f4c2a04af2b34d.exe#Version=5,0,3805"


	*/
	
	var strJourp = document.getElementById('snAuth').className;
	var jourp = strJourp.split('jourp');
	_url = document.URL;
	splittedURL = _url.split("\/");
	
	var contentDiv = document.getElementById('snAuth').innerHTML =
	
	   '<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" codebase="MSJavWU_8073687b82d41db93f4c2a04af2b34d.exe#Version=5,0,3805" width="430" height="120">'+
		'<param name="cabbase" value="/sa/AutsigNot.cab">\n' +
		'<param name="type"   value="application/x-java-applet;">\n' +

		'<param name="dirIPp" value="x500a.notarius.net">\n' +
		'<param name="dirportp" value="389">\n' +
		'<param name="manIPp" value="entrust.notarius.net">\n' +
		'<param name="manportp" value="829">\n' +
		'<param name="monurlp" value="http://'+ splittedURL[2] +'/cgi-bin/snAuth/snAuth.php">\n' +
		'<param name="urlservletp" value="http://'+ splittedURL[2] +'/ss/Servletrec">\n' +
		'<param name="empdepservp" value="D:/Web/notarius.com/www">\n' +
		//'<param name="repdepservp" value="insw_in">\n' +
		'<param name="repfichierlog" value="logs">\n' +
		'<param name="fichierlog" value="auth">\n' +
		//'<param name="fichiersign" value="sign">\n' +
		'<param name="reptrvclientp" value="c:/">\n' +
		'<param NAME="appel" VALUE="0">\n' +
		'<param NAME="nbfichiercrypter" VALUE="1">\n' +
		'<param NAME="InscriptioOuAutre" VALUE="0">\n' +
		'<param name="searchBasep" value="ou=ADMINISTRATION,ou=CHAMBRE DES NOTAIRES,o=CENTRE DE CERTIFICATION DU QUEBEC,c=CA">\n' +
		'<param name="commonNamep" value="cn=Gestion des certificats GCC du CCQ">\n' +
		'<param NAME="codenotautp" VALUE="">\n' +
		'<param NAME="jourp" VALUE="'+jourp[1]+'">\n' +
	'</object>\n' +
    '<p><strong>AVIS :</strong> <em>Après avoir saisi vos informations, cliquez OK et patientez quelques minutes.</em></p>\n';
}

function startBadSnAuth()
{
	var strJourp = document.getElementById('snAuth').className;
	var jourp = strJourp.split('jourp');
	_url = document.URL;
	splittedURL = _url.split("\/");
	
	var contentDiv = document.getElementById('snAuth').innerHTML =
	'<applet code="AutsigNot.class" width=330 height=120>\n' +
		'<param name="cabbase" value="/sa/AutsigNot.cab">\n' +
		'<param name="dirIPp" value="x500a.notarius.net">\n' +
		'<param name="dirportp" value="389">\n' +
		'<param name="manIPp" value="entrust.notarius.net">\n' +
		'<param name="manportp" value="829">\n' +
		'<param name="monurlp" value="http://'+ splittedURL[2] +'/cgi-bin/snAuth/snAuth.php">\n' +
		'<param name="urlservletp" value="http://'+ splittedURL[2] +'/ss/Servletrec">\n' +
		'<param name="empdepservp" value="D:/Web/notarius.com/www">\n' +
		//'<param name="repdepservp" value="insw_in">\n' +
		'<param name="repfichierlog" value="logs">\n' +
		'<param name="fichierlog" value="auth">\n' +
		//'<param name="fichiersign" value="sign">\n' +
		'<param name="reptrvclientp" value="c:/">\n' +
		'<param NAME="appel" VALUE="0">\n' +
		'<param NAME="nbfichiercrypter" VALUE="1">\n' +
		'<param NAME="InscriptioOuAutre" VALUE="0">\n' +
		'<param name="searchBasep" value="ou=ADMINISTRATION,ou=CHAMBRE DES NOTAIRES,o=CENTRE DE CERTIFICATION DU QUEBEC,c=CA">\n' +
		'<param name="commonNamep" value="cn=Gestion des certificats GCC du CCQ">\n' +
		'<param NAME="codenotautp" VALUE="">\n' +
		'<param NAME="jourp" VALUE="'+jourp[1]+'">\n' +
	'</applet>\n' +
    '<p><strong>AVIS :</strong> <em>Après avoir saisi vos informations, cliquez OK et patientez quelques minutes.</em></p>\n';
}

/* All the onload functions */
function schedule(objectID, functionCall)
{
	if (document.getElementById(objectID))
	{
		eval(functionCall);
	}
	else
	{
		setTimeout("schedule('" + objectID + "', '" + functionCall + "')", 1);
	}
	return true;
}
function goDemandeLigne(){
     var check = false;
	 var check2 = false;
	 var check3 = false;
     identProd=document.getElementById("identificationProduit").getElementsByTagName("input");
	 itemsProb=document.getElementById("natureProb").getElementsByTagName("input");
   // valider informations client.
      for(i=0;i<identProd.length;i++)
	  {
		if(identProd[i].checked!=0)
		 {
			check=true;
		 }
	  }
	  for(i=0;i<itemsProb.length;i++)
	  {
		if(itemsProb[i].checked!=0)
		 {
			check2=true;
		 }
	  }

   arrayId=Array ('nom','prenom','phone','email');
   for(i=0;i<arrayId.length;i++)
   {
	   if (document.getElementById(arrayId[i]).value.length>0)
	   {
		  check3=true;
	   }
	   else
	   {
		   check3=false;
		   break;
	   }
   }
   
   if (check==false || check2==false || check3==false)
   {
      alert("Information manquante : Veuillez remplir tous les champs obligatoires indiqués par un astérix(*).");
   }
   else
   {
	 document.getElementById("formDemande").submit();
   } 
}

function checkEmail(email) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
	{
		return (true);
	}
	return (false);
}

function goDemandeDownld(){
	var check = false;

	if (document.getElementById("nom").value.length>0 && document.getElementById("courriel").value.length>0 && document.getElementById("code").value.length>0)
	{
		check=true;
	}
   
   	if (check==false)
   	{
      	alert("Information manquante : Veuillez remplir tous les champs obligatoires indiqués par un astérix(*).");
   	}
   	else if (!checkEmail(document.getElementById("courriel").value))
   	{
	   	alert("Courriel invalide : Veuillez entrer de nouveau votre courriel.")
	}
   	else
   	{ 	
	 	document.getElementById("formDownld").submit();
   	} 
}

function theStartFunction()
{
	tableruler();
}
function MirrorServer(adr,poids,srvDldPath)
{
	this.adr=adr;
	this.poids=poids;
	//Le server path doit finir par / 
	this.srvDldPath=srvDldPath;

}
function randomDownload(filePath)
{
	randomArray = new Array();
	arrayServer = new Array(
					new MirrorServer("http://download1.notarius.org/",3,null),
					new MirrorServer("ftp://tnm76jiop:0tBhDJPj@207.253.43.99/",1,null),
					new MirrorServer("ftp://tnm76jiop:0tBhDJPj@www.notarius.com/",1,null),
					new MirrorServer("http://www.notarius1.com/",3,null),
					new MirrorServer("http://www.notarius3.com/",3,null),				
					new MirrorServer("http://www.notarius2.com/",3,null)
					);
	//--------- create random array.
	//alert('ArrayServer length = '+arrayServer.length);
	
	for(i=0;i<arrayServer.length;i++)
	{
		for(ii=0;ii<arrayServer[i].poids;ii++)
		{
			randomArray.push(arrayServer[i]);
		}
	}
	indiceSrv = Math.ceil(Math.random()*randomArray.length-1);
    if(randomArray[indiceSrv].srvDldPath)
	{
		window.open(randomArray[indiceSrv].adr+randomArray[indiceSrv].srvDldPath+filePath);
	}
	else
	{
		window.open(randomArray[indiceSrv].adr+filePath);
	}
}
function startWMV(id)
{
	var arrayVideos = Array("Ouvrir_session.wmv","Fermer_session.wmv","Chiffrer_pour_soi.wmv","Chiffrer_pour_membres.wmv","Signer_pour_soi.wmv","Chiffrer_et_signer.wmv","Dechiffer_et_ouvrir.wmv","Consulter_son_certificat.wmv","Modifier_mot_passe.wmv","Demo_Signer_Consigno.wmv","Demo_Sign_Consigno.wmv");
	var temp="";
	temp +=" <html><head></head><body>";
	temp +=" <object id=\"mediaPlayer\" classid=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" codebase=\"https://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'standby='Loading Microsoft Windows Media Player components...\" type=\"application/x-oleobject\">";
	temp +=" <param name=\"fileName\" value=\"/media/formationEnLigne/"+ arrayVideos[id] +"\" />";
	temp +=" <param name=\"animationatStart\" value=\"true\" />";
	temp +=" <param name=\"transparentatStart\" value='true' />";
	temp +=" <param name=\"autoStart\" value=\"true\" />";
	temp +="<param name=\"autoSize\" value=\"false\" />";
	temp +=" <param name=\"ShowAudioControls\" value=\"true\" />";
	temp +=" <param name=\"showControls\" value=\"true\" />";
	temp +=" <param name=\"ShowStatusBar\" value=\"false\" />";
	temp +=" <param name=\"width\" value=\"320\" />";
	temp +=" <param name=\"height\" value=\"240\" />";
	temp +=" <param name=\"loop\" value=\"false\" />";
	temp +=" <embed type=\"application/x-mplayer2\" pluginspage=\"https://microsoft.com/windows/mediaplayer/en/download/\" id=\"mediaPlayer\" displaysize=\"4\" autosize=\"0\" bgcolor=\"gray\" showcontrols=\"true\" showtracker=\"1\" showdisplay=\"1\" showstatusbar=\"0\" videoborder3d=\"1\" showaudiocontrols=\"1\" src=\"/media/formationEnLigne/"+ arrayVideos[id] +".wmv\" autostart=\"1\" designtimesp=\"5311\" loop=\"0\">";
	temp +="  </embed>";
	temp +="  </object>";
	temp +=" </body></html>";
	
	video=window.open('','Formation','width=740, height=605');
	video.document.write(temp);
}
function validAccept(id)
{
	if(document.getElementById(id).checked)
	{
		return true;
	}
	else
	{
		alert('Vous devez accepter les conditions');
		return false;
	}
	
}
function validAccept_En(id)
{
	if(document.getElementById(id).checked)
	{
		return true;
	}
	else
	{
		alert('You have to agree with these terms');
		return false;
	}
}

function startWMV(id)
{
	var arrayVideos = Array("Ouvrir_session.wmv","Fermer_session.wmv","Chiffrer_pour_soi.wmv","Chiffrer_pour_membres.wmv","Signer_pour_soi.wmv","Chiffrer_et_signer.wmv","Dechiffer_et_ouvrir.wmv","Consulter_son_certificat.wmv","Modifier_mot_passe.wmv","Demo_ing_Signer_Consigno.wmv","Demo_ing_Signer_PDF_Adobe.wmv","Demo_Sign_Consigno.wmv");
	var temp="";
	temp +=" <html><head></head><body>";
	temp +=" <object id=\"mediaPlayer\" classid=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" codebase=\"https://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'standby='Loading Microsoft Windows Media Player components...\" type=\"application/x-oleobject\">";
	temp +=" <param name=\"fileName\" value=\"/media/formationEnLigne/"+ arrayVideos[id] +"\" />";
	temp +=" <param name=\"animationatStart\" value=\"true\" />";
	temp +=" <param name=\"transparentatStart\" value='true' />";
	temp +=" <param name=\"autoStart\" value=\"true\" />";
	temp +="<param name=\"autoSize\" value=\"false\" />";
	temp +=" <param name=\"ShowAudioControls\" value=\"true\" />";
	temp +=" <param name=\"showControls\" value=\"true\" />";
	temp +=" <param name=\"ShowStatusBar\" value=\"false\" />";
	temp +=" <param name=\"width\" value=\"320\" />";
	temp +=" <param name=\"height\" value=\"240\" />";
	temp +=" <param name=\"loop\" value=\"false\" />";
	temp +=" <embed type=\"application/x-mplayer2\" pluginspage=\"https://microsoft.com/windows/mediaplayer/en/download/\" id=\"mediaPlayer\" displaysize=\"4\" autosize=\"0\" bgcolor=\"gray\" showcontrols=\"true\" showtracker=\"1\" showdisplay=\"1\" showstatusbar=\"0\" videoborder3d=\"1\" showaudiocontrols=\"1\" src=\"/media/messagesTV/"+ id +".wmv\" autostart=\"1\" designtimesp=\"5311\" loop=\"0\">";
	temp +="  </embed>";
	temp +="  </object>";
	temp +=" </body></html>";
	
	video=window.open('','Formation','width=740, height=605');
	video.document.write(temp);
}

function getGpPage(page,word)
{
	document.getElementById("searchWord").value=word;
	document.getElementById("nextPage").value=page;
	document.getElementById("gpForm").submit();
	
	//alert('voir la page '+page+'pour le mot '+word);
	//document.getelementById("").value="";
}

function getSelectedItem1(id)
{
	// valid if we can do the dom things ! 
	if (document.getElementById && document.createTextNode && document.createElement)
	{
		var item = document.getElementById(id);
		var allAs = item.getElementsByTagName("a");
		var myUrl = document.location.href;
		var splitedUrl=document.URL.split("/");
		var menuPath = splitedUrl[0]+"/"+splitedUrl[1]+"/"+splitedUrl[2]+"/"+splitedUrl[3]+"/"+splitedUrl[4]+"/";
		for(var i = 0 ; i<allAs.length;i++)
		{		
			if (menuPath == allAs[i].href || myUrl == allAs[i].href)
			{
				// set the menu as selected
				allAs[i].parentNode.className="selected";
			}
			
			if (myUrl == allAs[i].href && splitedUrl[5])
			{
				// highlight the submenu
				allAs[i].parentNode.className="highlight";
			}
		}
	}
}

/*function getSelectedItem(id)
{
	// valid if we can do the dom things ! 
	if (document.getElementById && document.createTextNode && document.createElement)
	{
		var item = document.getElementById(id);
		var allAs = item.getElementsByTagName("a");
		var myUrl = document.location.href;
		var splitedUrl=myUrl.split("/");
		var domainUrl = splitedUrl[0]+"/"+splitedUrl[1]+"/"+splitedUrl[2]+"/";
		for(var i = 0 ; i<allAs.length;i++)
		{
			var check = ("^"+allAs[i].href+".*");
			if(myUrl.match(check))
			{
				if (allAs[i].href == domainUrl && myUrl != allAs[i].href){ continue;}
				if (allAs[i].parentNode.parentNode.parentNode.id == "menu")
				{
					allAs[i].parentNode.className="selected";
				}				
				else
				{
					allAs[i].parentNode.className="highlight";
					allAs[i].parentNode.parentNode.parentNode.className="selected";
					//allAs[i].parentNode.parentNode.parentNode.lastChild.style.display="block";
				}
			}
		}
	}
}
*/

function getSelectedItem(id)
{
	// valid if we can do the dom things ! 
	if (document.getElementById && document.createTextNode && document.createElement)
	{
		var item = document.getElementById(id);
		var allAs = item.getElementsByTagName("a");
		var myUrl = document.location.href;
		var splitedUrl=myUrl.split("/");
		var domainUrl = splitedUrl[0]+"/"+splitedUrl[1]+"/"+splitedUrl[2]+"/";
		var myUrlPartial = splitedUrl.slice(4).join("/"); // Enlever domain et public ou prive

		//Pour les pages qui sont dans cgi-bin
		if (myUrlPartial == "assistance/distance.php"){myUrlPartial = "assistance/distance/";}
		else if (myUrlPartial.match("^avisAccept.php.*")){myUrlPartial = "telechargement/";}
		else if (myUrlPartial == "snAuth/telechargement.php?id=formationEnLigne"){myUrlPartial = "formation/";}
		else if (myUrlPartial.match("^snAuth/telechargement.php.*")){myUrlPartial = "telechargement/";}
		
		for(var i = 0 ; i<allAs.length;i++)
		{
			var splitedLink = allAs[i].href.split("/");
			var partialLink = splitedLink.slice(4).join("/"); // Enlever domain et public ou prive
		
			var check = ("^"+partialLink+".*");

			if(myUrlPartial.match(check))
			{
				if ((allAs[i].href == domainUrl || allAs[i].href == domainUrl+"en/") && (myUrlPartial != partialLink)){ continue;}
				if (allAs[i].parentNode.parentNode.parentNode.id == "menu")
				{
					allAs[i].parentNode.className="selected";
				}				
				else
				{
					allAs[i].parentNode.className="highlight";
					allAs[i].parentNode.parentNode.parentNode.className="selected";
				}
			}
		}
	}
}

function getGpPage(page,word)
{
	document.getElementById("word").value=word;
	document.getElementById("nextPage").value=page;
	document.getElementById("gpForm").submit();
}

function downloadConsignoButton(){
	location.href = '/public/consigno2/consigno.jnlp';
	return false;
}

function toOpenInNewWindow(id){
	if(document.getElementById && document.getElementById(id)){
		var element = document.getElementById(id);
		var allAs = element.getElementsByTagName('a');
		for(var i=0;i<allAs.length;i++){
			allAs[i].onclick = function(){
				window.open(this.href);
				return false;
			}
		}
	}
}

window.onload = function(){
	if(document.getElementById('btnGotoAssist')){
		var btn = document.getElementById('btnGotoAssist');
		btn.onclick = function(){
			if(validAccept('chkAccept')){
				document.getElementById("frmValidate").action ="/cgi-bin/assistance/distance.php?outil=GotoAssist"
				document.getElementById("frmValidate").submit();		
				//window.location = window.location.href;
			}
		}
	}
	if(document.getElementById('btnWebEx')){
		var btn = document.getElementById('btnWebEx');
		btn.onclick = function(){
			if(validAccept('chkAccept')){
				document.getElementById("frmValidate").action ="/cgi-bin/assistance/distance.php?outil=WebEx"
				document.getElementById("frmValidate").submit();		
				//window.location = window.location.href;
			}
		}
	}	
}

schedule('menu',"getSelectedItem(\"menu\")");
//schedule("intro", "runIntro()");
schedule("header", "isSslHeader()");
//schedule("iconCoord", "setLinkOnIconTop(\"iconCoord\")");
schedule("footerCoordA", "getNoCoordLink(\"footerCoordA\")");
schedule("snAuth", "startSnAuth()");
schedule("authenticate", "callApplet(\"authenticate\")");
schedule("iconsApps", "toOpenInNewWindow(\"iconsApps\")");
//schedule("menuInformation", "setInfoOnClick()