function save_cours_choice(){var h=document.getElementsByName("cours_montreal[]");var g=document.getElementsByName("cours_quebec[]");var c="";for(x=0;x<h.length;x++){if(h[x].checked==true){c+=h[x].id+"+"}}for(x=0;x<g.length;x++){if(g[x].checked==true){c+=g[x].id+"+"}}setCookie("cours",c,365);var f=document.getElementsByName("book_montreal[]");var a=document.getElementsByName("book_name_montreal[]");var e=document.getElementsByName("book_quebec[]");var i=document.getElementsByName("book_name_quebec[]");var d="";var b="";for(x=0;x<f.length;x++){if(f[x].checked==true){d+=f[x].id+"-"+f[x].value+"-"+a[x].value+"+"}}for(x=0;x<e.length;x++){if(e[x].checked==true){b+=e[x].id+"-"+e[x].value+"-"+i[x].value+"+"}}setCookie("livres_montreal",d,365);setCookie("livres_quebec",b,365)}function calcule(e){var c=document.getElementsByName("prix_"+e+"[]");var d=0;for(x=0;x<c.length;x++){if(c[x].value!=""){d+=parseInt(c[x].value)}}if(e=="montreal"){document.frm1.txtlaSommeMontreal.value=d;setCookie("totalMontreal",d,365)}else{if(e=="quebec"){document.frm1.txtlaSommeQuebec.value=d;setCookie("totalQuebec",d,365)}}var b=document.getElementsByName("book_prix_"+e+"[]");var a=document.getElementsByName("book_"+e+"[]");var d=0;for(x=0;x<b.length;x++){if(b[x].value!=""){prixLivresAjout=a[x].value*1;d+=prixLivresAjout}}if(e=="montreal"){setCookie("totalLivresMontreal",d,365)}else{if(e=="quebec"){setCookie("totalLivresQuebec",d,365)}}save_cours_choice();ShowOrderTotals()}function initialiseLivres(c){var b=document.getElementsByName("cours_"+c+"[]");var e=document.getElementsByName("cours_hasbook_"+c+"[]");var d=document.getElementsByName("cours_catid_"+c+"[]");for(x=0;x<b.length;x++){if(e[x]){if(b[x].checked==true&&e[x].value==1){var a="";a="book_content_"+c+"_"+d[x].value;document.getElementById(a).style.display=""}}}}function afficheA(e,b){if(e.checked){var d=0;var a=(e.value).split("-");var c=getCookie("membre");if(c==1){d=a[2]}else{if(c==2){d=a[1]}else{d=a[0]}}b.value=d}else{b.value="";e.checked=false}}function afficheB(b,a){if(b.checked){var c=0;var c=b.value;c=RoundAmountToText(c);a.value=c}else{a.value="";b.checked=false}}function afficheBook(c,e,a,b,f,d){cours=document.getElementsByName("cours_"+d+"[]");catids=document.getElementsByName("cours_catid_"+d+"[]");nb_cours_checked=0;for(x=0;x<cours.length;x++){if(cours[x].checked&&catids[x].value==e){nb_cours_checked=nb_cours_checked+1}}if(c.checked){if(document.getElementById(a)){document.getElementById(a).style.display=""}}else{if(document.getElementById(a)){if(nb_cours_checked==0){document.getElementById(a).style.display="none";b.checked=false;f.value=""}}c.checked=false}}function update_cours_prix(d){if(document.getElementById("FSPQTITLECONTENT")){document.getElementById("FSPQTITLECONTENT").style.display="none"}if(document.getElementById("FSPQVALUESCONTENT")){document.getElementById("FSPQVALUESCONTENT").style.display="none"}if(getCookie("membre").length>0){var c=getCookie("membre");if(d==1){if(c==1){setCookie("membre",0,365)}else{setCookie("membre",1,365);if(document.frm1.membreFSPQ.checked==true){document.frm1.non_membreFSPQ.checked=true;document.frm1.inconnu_membreFSPQ.checked=false;document.frm1.membreFSPQ.checked=false}}}else{if(d==2){if(c==2){setCookie("membre",0,365)}else{setCookie("membre",2,365);if(document.frm1.membre.checked==true){document.frm1.non_membre.checked=true;document.frm1.inconnu_membre.checked=false;document.frm1.membre.checked=false}}}else{if(d==3){if(c==1){setCookie("membre",0,365)}}else{if(d==4){if(c==2){setCookie("membre",0,365)}}}}}}else{if(d==1){setCookie("membre",1,365);document.frm1.membreFSPQ.checked=false}else{if(d==2){setCookie("membre",2,365);document.frm1.membre.checked=false}else{setCookie("membre",0,365)}}}if(document.frm1.inconnu_membre.checked||document.frm1.non_membre.checked){if(document.getElementById("FSPQTITLECONTENT")){document.getElementById("FSPQTITLECONTENT").style.display=""}if(document.getElementById("FSPQVALUESCONTENT")){document.getElementById("FSPQVALUESCONTENT").style.display=""}}if(document.frm1.membreFSPQ.checked){ShowFSPQNumberContent("FSPQNUMBERINPUTCONTENT","numeroMembreFSPQ",2)}else{ShowFSPQNumberContent("FSPQNUMBERINPUTCONTENT","numeroMembreFSPQ",0)}var f=document.getElementsByName("cours_montreal[]");var e=document.getElementsByName("cours_quebec[]");var b=document.getElementsByName("prix_montreal[]");var a=document.getElementsByName("prix_quebec[]");for(x=0;x<f.length;x++){afficheA(f[x],b[x])}for(x=0;x<e.length;x++){afficheA(e[x],a[x])}calcule("montreal");calcule("quebec")}function uncheckOtherOptions(c,b,a){if(document.getElementById(b)){document.getElementById(b).checked=false}if(document.getElementById(a)){document.getElementById(a).checked=false}}function update_taxes_prix(d){if(getCookie("taxesExemption").length>0){var b=getCookie("taxesExemption");if(d==1){if(b==1){setCookie("taxesExemption",0,365)}else{setCookie("taxesExemption",1,365);if(document.frm1.exempteeTVQ.checked==true){document.frm1.non_exempteeTVQ.checked=true;document.frm1.inconnu_exempteeTVQ.checked=false;document.frm1.exempteeTVQ.checked=false}}}else{if(d==2){if(b==2){setCookie("taxesExemption",0,365)}else{setCookie("taxesExemption",2,365);if(document.frm1.exempteeTPSetTVQ.checked==true){document.frm1.non_exempteeTPSetTVQ.checked=true;document.frm1.inconnu_exempteeTPSetTVQ.checked=false;document.frm1.exempteeTPSetTVQ.checked=false}}}else{if(d==3){if(b==1){setCookie("taxesExemption",0,365)}}else{if(d==4){if(b==2){setCookie("taxesExemption",0,365)}}}}}}else{if(d==1){setCookie("taxesExemption",1,365);document.frm1.exempteeTVQ.checked=false}else{if(d==2){setCookie("taxesExemption",2,365);document.frm1.exempteeTPSetTVQ.checked=false}else{setCookie("taxesExemption",0,365)}}}var f=document.getElementsByName("cours_montreal[]");var e=document.getElementsByName("cours_quebec[]");var c=document.getElementsByName("prix_montreal[]");var a=document.getElementsByName("prix_quebec[]");for(x=0;x<f.length;x++){afficheA(f[x],c[x])}for(x=0;x<e.length;x++){afficheA(e[x],a[x])}calcule("montreal");calcule("quebec")}function init(){var a=document.frm1;a.txtNom.value="";a.txtTitre.value="";a.txtService.value="";a.txtAdresse.value="";a.txtBureau.value="";a.txtMunicipalite.value="";a.txtCodePostal.value="";a.txtTelephone.value="";a.txtTelecopie.value="";a.txtCourriel.value="";a.txtOrganisation.value="";a.txtPersonneResp.value="";a.txtAdresseResp.value="";a.txtBureauResp.value="";a.txtMunicipaliteResp.value="";a.txtCodePostalResp.value="";a.txtTelephoneResp.value="";a.txtTelecopieResp.value="";a.txtCourrielResp.value="";a.txtRemarques.value=""}function copieChk(a){var b=document.frm1;if(a.checked==true){b.txtAdresseResp.value=b.txtAdresse.value;b.txtBureauResp.value=b.txtBureau.value;b.txtMunicipaliteResp.value=b.txtMunicipalite.value;b.txtCodePostalResp.value=b.txtCodePostal.value;b.txtTelecopieResp.value=b.txtTelecopie.value}else{b.txtAdresseResp.value="";b.txtBureauResp.value="";b.txtMunicipaliteResp.value="";b.txtCodePostalResp.value="";b.txtTelecopieResp.value=""}}function saveform(b){var c="";c+=b.txtNom.value+"+";c+=b.txtTitre.value+"+";c+=b.txtOrganisation.value+"+";c+=b.txtAdresse.value+"+";c+=b.txtBureau.value+"+";c+=b.txtMunicipalite.value+"+";c+=b.txtCodePostal.value+"+";c+=b.txtTelephone.value+"+";c+=b.txtTelecopie.value+"+";c+=b.txtCourriel.value;setCookie("participante",c,365);var a="";a+=b.txtPersonneResp.value+"+";a+=b.txtAdresseResp.value+"+";a+=b.txtBureauResp.value+"+";a+=b.txtMunicipaliteResp.value+"+";a+=b.txtCodePostalResp.value+"+";a+=b.txtTelephoneResp.value+"+";a+=b.txtTelecopieResp.value+"+";a+=b.txtCourrielResp.value;setCookie("facturation",a,365)}var prixMontreal=0;var prixQuebec=0;var soustotal=0;var typeTaxes=0;var grandTotal=0;var prixLivresMontreal=0;var prixLivresQuebec=0;var soustotalLivres=0;var grandTotalLivres=0;var grandTotalCoursEtLivres=0;var TPS=0.05;var TVQ=0.075;var mTPS=0;var mTVQ=0;var mLivresTPS=0;function ShowOrderTotals(){prixMontreal=0;prixQuebec=0;soustotal=0;typeTaxes=0;grandTotal=0;prixLivresMontreal=0;prixLivresQuebec=0;soustotalLivres=0;grandTotalLivres=0;grandTotalCoursEtLivres=0;TPS=0.05;TVQ=0.075;mTPS=0;mTVQ=0;mLivresTPS=0;var a="";if(getCookie("totalMontreal").length>0){prixMontreal=getCookie("totalMontreal")-0}if(getCookie("totalQuebec").length>0){prixQuebec=getCookie("totalQuebec")-0}if(prixMontreal>0||prixQuebec>0){a="<h2>Tarif</h2>";a=a+'<table class="OrderReceiptElemsTable" cellpadding="0" cellspacing="0">';if(prixMontreal>0){a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptPriceText">Total pour le ou les cours &agrave; Montr&eacute;al</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptPriceValue">'+RoundAmountToText(prixMontreal)+" $</div></div></td></tr>"}if(prixQuebec>0){a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptPriceText">Total pour le ou les cours &agrave; Qu&eacute;bec</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptPriceValue">'+RoundAmountToText(prixQuebec)+" $</div></td></tr>"}soustotal=prixMontreal+prixQuebec;a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptPriceText">Total partiel</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptPriceValue">'+RoundAmountToText(soustotal)+" $</div></td></tr>";if(getCookie("taxesExemption").length>0){typeTaxes=getCookie("taxesExemption")}else{typeTaxes=0}if(typeTaxes==2){mTPS=soustotal*TPS;grandTotal=soustotal+mTPS;a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptPriceText">TPS</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptPriceValue">'+RoundAmountToText(mTPS)+" $</div></td></tr>"}else{if(typeTaxes==0){mTPS=soustotal*TPS;mTVQ=(soustotal+mTPS)*TVQ;grandTotal=(soustotal+mTPS+mTVQ);a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptPriceText">TPS</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptPriceValue">'+RoundAmountToText(mTPS)+" $</div></td></tr>";a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptPriceText">TVQ</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptPriceValue">'+RoundAmountToText(mTVQ)+" $</div></td></tr>"}else{grandTotal=soustotal}}var b="alt";a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptTotalPriceText">Total</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptTotalPriceValue">'+RoundAmountToText(grandTotal)+" $</div></td></tr></table>";if(getCookie("totalLivresMontreal").length>0){prixLivresMontreal=getCookie("totalLivresMontreal")-0}if(getCookie("totalLivresQuebec").length>0){prixLivresQuebec=getCookie("totalLivresQuebec")-0}if(prixLivresMontreal>0||prixLivresQuebec>0){a=a+'<table class="OrderReceiptElemsTable topSpacer" cellpadding="0" cellspacing="0">';if(prixLivresMontreal>0){booksListe=getCookie("livres_montreal");booksListeSplitted=booksListe.split("+");for(x=0;x<booksListeSplitted.length;x++){if(booksListeSplitted[x]!=""){booksContent=booksListeSplitted[x];booksContentSplitted=booksContent.split("-");a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptPriceText">Total pour le livre '+booksContentSplitted[4]+'</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptPriceValue">'+RoundAmountToText(booksContentSplitted[3])+" $</div></div></td></tr>"}}}if(prixLivresQuebec>0){booksListe=getCookie("livres_quebec");booksListeSplitted=booksListe.split("+");for(x=0;x<booksListeSplitted.length;x++){if(booksListeSplitted[x]!=""){booksContent=booksListeSplitted[x];booksContentSplitted=booksContent.split("-");a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptPriceText">Total pour le livre '+booksContentSplitted[4]+'</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptPriceValue">'+RoundAmountToText(booksContentSplitted[3])+" $</div></div></td></tr>"}}}soustotalLivres=prixLivresQuebec+prixLivresMontreal;a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptPriceText">Total partiel</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptPriceValue">'+RoundAmountToText(soustotalLivres)+" $</div></td></tr>";if(typeTaxes==2){mLivresTPS=soustotalLivres*TPS;grandTotalLivres=soustotalLivres+mLivresTPS;a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptPriceText">TPS</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptPriceValue">'+RoundAmountToText(mLivresTPS)+" $</div></td></tr>"}else{if(typeTaxes==0){mLivresTPS=soustotalLivres*TPS;grandTotalLivres=soustotalLivres+mLivresTPS;a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptPriceText">TPS</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptPriceValue">'+RoundAmountToText(mLivresTPS)+" $</div></td></tr>"}else{grandTotalLivres=soustotalLivres}}a=a+'<tr><td class="orderReceiptPriceTextTD"><div class="orderReceiptTotalPriceText">Total</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptTotalPriceValue">'+RoundAmountToText(grandTotalLivres)+" $</div></td></tr></table>";grandTotalCoursEtLivres=grandTotal+grandTotalLivres;a=a+'<table class="OrderGrandTotalTable topSpacer" cellpadding="0" cellspacing="0"><tr class="alt"><td class="orderReceiptPriceTextTD"><div class="orderReceiptTotalPriceText">Grand total</div></td><td class="orderReceiptPriceValueTD"><div class="orderReceiptTotalPriceValue">'+RoundAmountToText(grandTotalCoursEtLivres)+" $</div></td></tr></table>"}a=a+'<div class="orderReceiptBottomText">Une facture sera &eacute;mise quelques jours apr&egrave;s chacune des formations choisies.</div>';if(document.getElementById("ORDERSTEP1TOTALSCONTENT")){document.getElementById("ORDERSTEP1TOTALSCONTENT").style.display="block";document.getElementById("ORDERSTEP1TOTALSCONTENT").innerHTML=a}if(document.getElementById("ORDERSTEP2TOTALSCONTENT")){document.getElementById("ORDERSTEP2TOTALSCONTENT").style.display="block";document.getElementById("ORDERSTEP2TOTALSCONTENT").innerHTML=a}}else{if(document.getElementById("ORDERSTEP1TOTALSCONTENT")){document.getElementById("ORDERSTEP1TOTALSCONTENT").style.display="none";document.getElementById("ORDERSTEP1TOTALSCONTENT").innerHTML=""}}$(".OrderReceiptElemsTable tr:even").addClass("alt")}var step2Timer="";function ShowAjaxLoaderThenStep2(){if(document.getElementById("SUBSCRIPTIONSTEP1CONTENT")){document.getElementById("SUBSCRIPTIONSTEP1CONTENT").style.display="none"}if(document.getElementById("AJAXLOADER")){document.getElementById("AJAXLOADER").style.display="block"}step2Timer=window.setTimeout("ShowStep2Content();",1500)}function ShowStep2Content(){if(document.getElementById("AJAXLOADER")){document.getElementById("AJAXLOADER").style.display="none"}if(document.getElementById("SUBSCRIPTIONSTEP2CONTENT")){document.getElementById("SUBSCRIPTIONSTEP2CONTENT").style.display="block"}window.clearInterval(step2Timer)}function ValidateStep1AndShowStep2(){var a="";a=ValidateStep1Fields();if(a=="true"){ShowAjaxLoaderThenStep2()}}function ValidateStep1Fields(){errorMessages="";if(document.frm1.membre.checked==false&&document.frm1.non_membre.checked==false&&document.frm1.inconnu_membre.checked==false){errorMessages=errorMessages+"Veuillez indiquer si l'organisation qui vous emploie est membre du Regroupement des achats en perfectionnement (RAP).<br />"}if(document.frm1.membreFSPQ.checked==1){if(validate_required(document.frm1.numeroMembreFSPQ)==false){errorMessages=errorMessages+"Veuillez indiquer votre num&eacute;ro de membre de la F&eacute;d&eacute;ration des secr&eacute;taires professionnelles du Qu&eacute;bec (FSPQ).<br />";if(document.getElementById("numeroMembreFSPQ")){document.getElementById("numeroMembreFSPQ").className="errorTxtBox"}}else{if(document.getElementById("numeroMembreFSPQ")){document.getElementById("numeroMembreFSPQ").className=""}}}else{if(document.getElementById("numeroMembreFSPQ")){document.getElementById("numeroMembreFSPQ").className=""}}if(errorMessages!=""){if(document.getElementById("STEP1ERRORSCONTENT")){document.getElementById("STEP1ERRORSCONTENT").innerHTML=errorMessages;document.getElementById("STEP1ERRORSCONTENT").className="inscriptionErrorsContent"}return"false"}else{if(document.getElementById("STEP1ERRORSCONTENT")){document.getElementById("STEP1ERRORSCONTENT").innerHTML="";document.getElementById("STEP1ERRORSCONTENT").className=""}return"true"}}var step2Timer="";function ShowAjaxLoaderThenStep2(){if(document.getElementById("SUBSCRIPTIONSTEP1CONTENT")){document.getElementById("SUBSCRIPTIONSTEP1CONTENT").style.display="none"}if(document.getElementById("AJAXLOADER")){document.getElementById("AJAXLOADER").style.display="block"}step2Timer=window.setTimeout("ShowStep2Content();",1500)}function ShowStep2Content(){if(document.getElementById("AJAXLOADER")){document.getElementById("AJAXLOADER").style.display="none"}if(document.getElementById("SUBSCRIPTIONSTEP2CONTENT")){document.getElementById("SUBSCRIPTIONSTEP2CONTENT").style.display="block"}window.clearInterval(step2Timer)}function ValidateStep2AndShowStep2A(){var a="";a=ValidateStep2Fields();if(a=="true"){ShowAjaxLoaderThenStep2A()}}function ValidateStep2Fields(){var a="";if(getCookie("cours").length==0){a=a+"Veuillez indiquer votre choix de cours.<br />"}if(a!=""){if(document.getElementById("STEP2ERRORSCONTENT")){document.getElementById("STEP2ERRORSCONTENT").innerHTML=a;document.getElementById("STEP2ERRORSCONTENT").className="inscriptionErrorsContent"}return"false"}else{if(document.getElementById("STEP2ERRORSCONTENT")){document.getElementById("STEP2ERRORSCONTENT").innerHTML="";document.getElementById("STEP2ERRORSCONTENT").className=""}return"true"}}var step2ATimer="";function ShowAjaxLoaderThenStep2A(){if(document.getElementById("SUBSCRIPTIONSTEP2CONTENT")){document.getElementById("SUBSCRIPTIONSTEP2CONTENT").style.display="none"}if(document.getElementById("AJAXLOADER")){document.getElementById("AJAXLOADER").style.display="block"}step2Timer=window.setTimeout("ShowStep2AContent();",1500)}function ShowStep2AContent(){if(document.getElementById("AJAXLOADER")){document.getElementById("AJAXLOADER").style.display="none"}if(document.getElementById("SUBSCRIPTIONSTEP2ACONTENT")){document.getElementById("SUBSCRIPTIONSTEP2ACONTENT").style.display="block"}window.clearInterval(step2ATimer)}function ValidateStep2AAndShowStep3(){var a="";a=ValidateStep2AFields();if(a=="true"){ShowAjaxLoaderThenStep3()}}function ValidateStep2AFields(){var a="";if(document.frm1.exempteeTPSetTVQ.checked==false&&document.frm1.non_exempteeTPSetTVQ.checked==false&&document.frm1.inconnu_exempteeTPSetTVQ.checked==false){if(document.frm1.exempteeTVQ.checked==false&&document.frm1.non_exempteeTVQ.checked==false&&document.frm1.inconnu_exempteeTVQ.checked==false){a=a+"Veuillez indiquer si votre organisation est exempt&eacute;e de la TPS ou de la TVQ ou les deux.<br />"}}if(a!=""){if(document.getElementById("STEP2AERRORSCONTENT")){document.getElementById("STEP2AERRORSCONTENT").innerHTML=a;document.getElementById("STEP2AERRORSCONTENT").className="inscriptionErrorsContent"}return"false"}else{if(document.getElementById("STEP2AERRORSCONTENT")){document.getElementById("STEP2AERRORSCONTENT").innerHTML="";document.getElementById("STEP2AERRORSCONTENT").className=""}return"true"}}var step3Timer="";function ShowAjaxLoaderThenStep3(){if(document.getElementById("SUBSCRIPTIONSTEP2ACONTENT")){document.getElementById("SUBSCRIPTIONSTEP2ACONTENT").style.display="none"}if(document.getElementById("AJAXLOADER")){document.getElementById("AJAXLOADER").style.display="block"}step2ATimer=window.setTimeout("ShowStep3Content();",1500)}function ShowStep3Content(){if(document.getElementById("AJAXLOADER")){document.getElementById("AJAXLOADER").style.display="none"}if(document.getElementById("SUBSCRIPTIONSTEP3CONTENT")){document.getElementById("SUBSCRIPTIONSTEP3CONTENT").style.display="block"}window.clearInterval(step3Timer)}function ValidateStep3AndShowStep4(){saveform(document.frm1);var e="";e=ValidateStep3Fields();if(e=="true"){if(getCookie("cours").length>0){coursListe=getCookie("cours");coursListeSplitted=coursListe.split("+");var d="";var c="";var f="";for(x=0;x<coursListeSplitted.length;x++){if(coursListeSplitted[x]!=""){courseID=coursListeSplitted[x];if(courseID.indexOf("montreal")==-1){coursContent=document.getElementById(courseID+"-categorie-nom").value+" - "+document.getElementById(courseID+"-cours-nom").value;f=f+coursContent+"<br />"}else{coursContent=document.getElementById(courseID+"-categorie-nom").value+" - "+document.getElementById(courseID+"-cours-nom").value;c=c+coursContent+"<br />"}}}if(c!=""){d=d+"<strong>Montr&eacute;al</strong><br /><br />";d=d+c;if(f!=""){d=d+"<br /><br />"}}if(f!=""){d=d+"<strong>Qu&eacute;bec</strong><br /><br />";d=d+f}if(document.getElementById("ORDERSTEP2COURSESCONTENT")){document.getElementById("ORDERSTEP2COURSESCONTENT").innerHTML=d}}if(getCookie("participante").length>0){infosParticipanteListe=getCookie("participante");infosParticipanteListeSplitted=infosParticipanteListe.split("+");var b="";for(x=0;x<infosParticipanteListeSplitted.length;x++){if(infosParticipanteListeSplitted[x]!=""){b=b+infosParticipanteListeSplitted[x]+"<br />"}}if(document.getElementById("ORDERSTEP2PARTICIPANTCONTENT")){document.getElementById("ORDERSTEP2PARTICIPANTCONTENT").innerHTML=b}}if(getCookie("facturation").length>0){infosFacturationListe=getCookie("facturation");infosFacturationListeSplitted=infosFacturationListe.split("+");var a="";for(x=0;x<infosFacturationListeSplitted.length;x++){if(infosFacturationListeSplitted[x]!=""){a=a+infosFacturationListeSplitted[x]+"<br />"}}if(document.getElementById("ORDERSTEP2RECEIPTPERSONCONTENT")){document.getElementById("ORDERSTEP2RECEIPTPERSONCONTENT").innerHTML=a}}ShowAjaxLoaderThenStep4()}}function ValidateStep3Fields(){var b="";if(validate_required(document.frm1.txtNom)==false){b=b+"Veuillez indiquer votre nom.<br />";if(document.getElementById("txtNom")){document.getElementById("txtNom").className="errorTxtBox"}}else{if(document.getElementById("txtNom")){document.getElementById("txtNom").className=""}}if(validate_required(document.frm1.txtOrganisation)==false){b=b+"Veuillez indiquer le nom de l'organisation.<br />";if(document.getElementById("txtOrganisation")){document.getElementById("txtOrganisation").className="errorTxtBox"}}else{if(document.getElementById("txtOrganisation")){document.getElementById("txtOrganisation").className=""}}if(validate_required(document.frm1.txtAdresse)==false){b=b+"Veuillez indiquer votre adresse au bureau.<br />";if(document.getElementById("txtAdresse")){document.getElementById("txtAdresse").className="errorTxtBox"}}else{if(document.getElementById("txtAdresse")){document.getElementById("txtAdresse").className=""}}if(validate_required(document.frm1.txtMunicipalite)==false){b=b+"Veuillez indiquer le nom de la municipalit&eacute;.<br />";if(document.getElementById("txtMunicipalite")){document.getElementById("txtMunicipalite").className="errorTxtBox"}}else{if(document.getElementById("txtMunicipalite")){document.getElementById("txtMunicipalite").className=""}}if(validate_required(document.frm1.txtCodePostal)==false){b=b+"Veuillez indiquer le code postal.<br />";if(document.getElementById("txtCodePostal")){document.getElementById("txtCodePostal").className="errorTxtBox"}}else{if(document.getElementById("txtCodePostal")){document.getElementById("txtCodePostal").className=""}}if(validate_required(document.frm1.txtTelephone)==false){b=b+"Veuillez indiquer votre num&eacute;ro de t&eacute;l&eacute;phone au bureau.<br />";if(document.getElementById("txtTelephone")){document.getElementById("txtTelephone").className="errorTxtBox"}}else{if(document.getElementById("txtTelephone")){document.getElementById("txtTelephone").className=""}}if(validate_required(document.frm1.txtCourriel)==false){b=b+"Veuillez indiquer votre adresse de courriel au bureau.<br />";if(document.getElementById("txtCourriel")){document.getElementById("txtCourriel").className="errorTxtBox"}}else{if(validate_email(document.frm1.txtCourriel)==false){b=b+"Veuillez indiquer une adresse de courriel au bureau valide.<br />";if(document.getElementById("txtCourriel")){document.getElementById("txtCourriel").className="errorTxtBox"}}else{if(document.getElementById("txtCourriel")){document.getElementById("txtCourriel").className=""}}}if(validate_required(document.frm1.txtPersonneResp)==false){b=b+"Veuillez indiquer le nom de la personne responsable de la facturation.<br />";if(document.getElementById("txtPersonneResp")){document.getElementById("txtPersonneResp").className="errorTxtBox"}}else{if(document.getElementById("txtPersonneResp")){document.getElementById("txtPersonneResp").className=""}}if(validate_required(document.frm1.txtAdresseResp)==false){b=b+"Veuillez indiquer l'adresse de la personne responsable de la facturation.<br />";if(document.getElementById("txtAdresseResp")){document.getElementById("txtAdresseResp").className="errorTxtBox"}}else{if(document.getElementById("txtAdresseResp")){document.getElementById("txtAdresseResp").className=""}}if(validate_required(document.frm1.txtMunicipaliteResp)==false){b=b+"Veuillez indiquer le nom de la municipalit&eacute; o&ugrave; travaille la personne responsable de la facturation.<br />";if(document.getElementById("txtMunicipaliteResp")){document.getElementById("txtMunicipaliteResp").className="errorTxtBox"}}else{if(document.getElementById("txtMunicipaliteResp")){document.getElementById("txtMunicipaliteResp").className=""}}if(validate_required(document.frm1.txtCodePostalResp)==false){b=b+"Veuillez indiquer le code postal de la personne responsable de la facturation.<br />";if(document.getElementById("txtCodePostalResp")){document.getElementById("txtCodePostalResp").className="errorTxtBox"}}else{if(document.getElementById("txtCodePostalResp")){document.getElementById("txtCodePostalResp").className=""}}if(validate_required(document.frm1.txtTelephoneResp)==false){b=b+"Veuillez indiquer le num&eacute;ro de t&eacute;l&eacute;phone de la personne responsable de la facturation.<br />";if(document.getElementById("txtTelephoneResp")){document.getElementById("txtTelephoneResp").className="errorTxtBox"}}else{if(document.getElementById("txtTelephoneResp")){document.getElementById("txtTelephoneResp").className=""}}if(validate_required(document.frm1.txtCourrielResp)==false){b=b+"Veuillez indiquer l'adresse de courriel de la personne responsable de la facturation.<br />";if(document.getElementById("txtCourrielResp")){document.getElementById("txtCourrielResp").className="errorTxtBox"}}else{if(validate_email(document.frm1.txtCourrielResp)==false){b=b+"Veuillez indiquer une adresse de courriel valide pour la personne responsable de la facturation.<br />";if(document.getElementById("txtCourrielResp")){document.getElementById("txtCourrielResp").className="errorTxtBox"}}else{if(document.getElementById("txtCourrielResp")){document.getElementById("txtCourrielResp").className=""}}}var a="";a=$("#txtRemarques").val();if(a.length>240){b=b+"Le champ remarques ne peut contenir plus de 240 caract&egrave;res.<br />";if(document.getElementById("txtRemarques")){document.getElementById("txtRemarques").className="errorTxtBox"}else{if(document.getElementById("txtRemarques")){document.getElementById("txtRemarques").className=""}}}if(b!=""){if(document.getElementById("STEP3ERRORSCONTENT")){document.getElementById("STEP3ERRORSCONTENT").innerHTML=b;document.getElementById("STEP3ERRORSCONTENT").className="inscriptionErrorsContent"}return"false"}else{if(document.getElementById("STEP3ERRORSCONTENT")){document.getElementById("STEP3ERRORSCONTENT").innerHTML="";document.getElementById("STEP3ERRORSCONTENT").className=""}return"true"}}var step4Timer="";function ShowAjaxLoaderThenStep4(){if(document.getElementById("SUBSCRIPTIONSTEP3CONTENT")){document.getElementById("SUBSCRIPTIONSTEP3CONTENT").style.display="none"}if(document.getElementById("AJAXLOADER")){document.getElementById("AJAXLOADER").style.display="block"}step2Timer=window.setTimeout("ShowStep4Content();",1500)}function ShowStep4Content(){if(document.getElementById("AJAXLOADER")){document.getElementById("AJAXLOADER").style.display="none"}if(document.getElementById("SUBSCRIPTIONSTEP4CONTENT")){document.getElementById("SUBSCRIPTIONSTEP4CONTENT").style.display="block"}window.clearInterval(step4Timer)}function ReValidateStep3(){if(document.getElementById("STEP3ERRORSCONTENT").className=="inscriptionErrorsContent"){step3IsValid=ValidateStep3Fields()}}function ValidateStep4AndShowStep5(){if(getCookie("cours").length>0){var a="";a=ValidateStep4Fields();if(a=="true"){SendOrderEmail()}}else{if(document.getElementById("SUBSCRIPTIONSESSIONKILLEDCONTENT")){document.getElementById("SUBSCRIPTIONSESSIONKILLEDCONTENT").style.display="block"}if(document.getElementById("SUBSCRIPTIONSTEP4CONTENT")){document.getElementById("SUBSCRIPTIONSTEP4CONTENT").style.display="none"}}}function ValidateStep4Fields(){errorMessages="";if(validate_required(document.frm2.txtOtherCourriel)==false){}else{if(validate_email(document.frm2.txtOtherCourriel)==false){errorMessages=errorMessages+"Veuillez indiquer une adresse de courriel valide pour la personne &agrave; qui envoyer une copie.<br />";if(document.getElementById("txtOtherCourriel")){document.getElementById("txtOtherCourriel").className="errorTxtBox"}}else{if(document.getElementById("txtOtherCourriel")){document.getElementById("txtOtherCourriel").className=""}}}if(errorMessages!=""){if(document.getElementById("STEP4ERRORSCONTENT")){document.getElementById("STEP4ERRORSCONTENT").innerHTML=errorMessages;document.getElementById("STEP4ERRORSCONTENT").className="inscriptionErrorsContent"}return"false"}else{if(document.getElementById("STEP4ERRORSCONTENT")){document.getElementById("STEP4ERRORSCONTENT").innerHTML="";document.getElementById("STEP4ERRORSCONTENT").className=""}return"true"}}function ReValidateStep4(){if(document.getElementById("STEP4ERRORSCONTENT").className=="inscriptionErrorsContent"){step4IsValid=ValidateStep4Fields()}}function GoBackToStep(a,b){if(document.getElementById(a)){document.getElementById(a).style.display="none"}if(document.getElementById(b)){document.getElementById(b).style.display="block"}}function SendOrderEmail(){if(document.getElementById("SUBSCRIPTIONSTEP4CONTENT")){document.getElementById("SUBSCRIPTIONSTEP4CONTENT").style.display="none"}if(document.getElementById("AJAXLOADER")){document.getElementById("AJAXLOADER").style.display="block"}if(getCookie("cours").length>0){coursListe=getCookie("cours");coursListeSplitted=coursListe.split("+");var f="";var o="";var a="";for(x=0;x<coursListeSplitted.length;x++){if(coursListeSplitted[x]!=""){courseID=coursListeSplitted[x];courseIDSplitted=courseID.split("-");courseIDValue=courseIDSplitted[1];courseNameValue=document.getElementById(courseID+"-cours-nom").value;courseCatIDValue=document.getElementById(courseID+"-categorie-id").value;coursePriceValue=document.getElementById(courseID+"-prix").value;if(courseID.indexOf("montreal")==-1){a=a+courseIDValue+"-"+courseNameValue+"-"+courseCatIDValue+"-"+coursePriceValue+"##"}else{o=o+courseIDValue+"-"+courseNameValue+"-"+courseCatIDValue+"-"+coursePriceValue+"##"}}}}var j="";if(getCookie("livres_montreal").length>0){booksListe=getCookie("livres_montreal");booksListeSplitted=booksListe.split("+");for(x=0;x<booksListeSplitted.length;x++){if(booksListeSplitted[x]!=""){bookID=booksListeSplitted[x];bookIDSplitted=bookID.split("-");bookIDValue=bookIDSplitted[1];bookNameValue=document.getElementById("book-"+bookIDValue+"-montreal-book-nom").value;bookPriceValue=document.getElementById("book-"+bookIDValue+"-montreal-prix").value;j=j+bookIDValue+"-"+bookNameValue+"-"+bookPriceValue+"##"}}}var m="";if(getCookie("livres_quebec").length>0){booksListe=getCookie("livres_quebec");booksListeSplitted=booksListe.split("+");for(x=0;x<booksListeSplitted.length;x++){if(booksListeSplitted[x]!=""){bookID=booksListeSplitted[x];bookIDSplitted=bookID.split("-");bookIDValue=bookIDSplitted[1];bookNameValue=document.getElementById("book-"+bookIDValue+"-quebec-book-nom").value;bookPriceValue=document.getElementById("book-"+bookIDValue+"-quebec-prix").value;m=m+bookIDValue+"-"+bookNameValue+"-"+bookPriceValue+"##"}}}var l="";if(getCookie("participante").length>0){infosParticipanteListe=getCookie("participante");infosParticipanteListeSplitted=infosParticipanteListe.split("+");for(x=0;x<infosParticipanteListeSplitted.length;x++){if(infosParticipanteListeSplitted[x]!=""){l=l+infosParticipanteListeSplitted[x]+"##"}else{l=l+"empty##"}}}var c="";if(getCookie("facturation").length>0){infosFacturationListe=getCookie("facturation");infosFacturationListeSplitted=infosFacturationListe.split("+");var c="";for(x=0;x<infosFacturationListeSplitted.length;x++){if(infosFacturationListeSplitted[x]!=""){c=c+infosFacturationListeSplitted[x]+"##"}else{c=c+"empty##"}}}var n="";n=$("input#txtOtherCourriel").val();var i="";i=$("input#txtCourriel").val();var p="";p=$("input#numeroMembreFSPQ").val();if(p==""){p="empty"}var q="";q=$("#txtRemarques").val();if(q==""){q="empty"}var h=0;var k=getCookie("membre");if(k==1){h=1}var e=0;var b=0;var d=getCookie("taxesExemption");if(d==1){e=1}if(d==2){b=1}if(o==""){o="empty"}if(a==""){a="empty"}if(j==""){j="empty"}if(m==""){m="empty"}if(n==""){n="empty"}var g="";g=g+"coursMontreal="+escape(o);g=g+"&coursQuebec="+escape(a);g=g+"&booksMontreal="+escape(j);g=g+"&booksQuebec="+escape(m);g=g+"&infosParticipante="+escape(l);g=g+"&infosFacturation="+escape(c);g=g+"&otherCourriel="+escape(n);g=g+"&courriel="+escape(i);g=g+"&numeroMembreFSPQ="+escape(p);g=g+"&remarques="+escape(q);g=g+"&is_rap="+escape(h);g=g+"&is_tps_tvq_exempt="+escape(e);g=g+"&is_tvq_exempt="+escape(b);g=g+"&prixMontreal="+escape(RoundAmountToText(prixMontreal));g=g+"&prixQuebec="+escape(RoundAmountToText(prixQuebec));g=g+"&soustotal="+escape(RoundAmountToText(soustotal));g=g+"&mTPS="+escape(RoundAmountToText(mTPS));g=g+"&mTVQ="+escape(RoundAmountToText(mTVQ));g=g+"&grandTotal="+escape(RoundAmountToText(grandTotal));g=g+"&soustotalLivres="+escape(RoundAmountToText(soustotalLivres));g=g+"&mLivresTPS="+escape(RoundAmountToText(mLivresTPS));g=g+"&grandTotalLivres="+escape(RoundAmountToText(grandTotalLivres));g=g+"&grandTotalCoursEtLivres="+escape(RoundAmountToText(grandTotalCoursEtLivres));$.ajax({type:"POST",url:"includes/inscription/process-new.php",data:g,success:function(){if(document.getElementById("AJAXLOADER")){document.getElementById("AJAXLOADER").style.display="none"}if(document.getElementById("SUBSCRIPTIONSTEP5CONTENT")){document.getElementById("SUBSCRIPTIONSTEP5CONTENT").style.display="block"}}});EraseCookies()}function clearErrorClass(a){a.className=""}function RoundAmount(a){a=Math.round(a*100)/100;return a}function RoundAmountToText(a){a=a+"";if(a.indexOf(".")==-1){a=a+",00"}else{amountToSplit=a;amountSplitted=amountToSplit.split(".");if(amountSplitted[1].length==1){a=amountSplitted[0]+","+amountSplitted[1]+"0"}else{amountTemp=amountSplitted[1];a=amountSplitted[0]+","+amountTemp.substring(0,2)}}return a}function ShowFSPQNumberContent(c,a,b){if(document.getElementById(c)){if(b==2){document.getElementById(c).style.display=""}else{document.getElementById(c).style.display="none";document.getElementById(a).value=""}}}function validate_required(field){with(field){if(value==null||value==""){return false}else{return true}}}function validate_email(field){with(field){apos=value.indexOf("@");dotpos=value.lastIndexOf(".");if(apos<1||dotpos-apos<2){return false}else{return true}}}function EraseCookies(){var b=document.getElementsByName("cours_quebec[]");var a=document.getElementsByName("prix_quebec[]");for(x=0;x<b.length;x++){b[x].checked=false;a[x].value=""}var b=document.getElementsByName("cours_montreal[]");var a=document.getElementsByName("prix_montreal[]");for(x=0;x<b.length;x++){b[x].checked=false;a[x].value=""}var c=document.getElementsByName("book_quebec[]");var a=document.getElementsByName("book_prix_quebec[]");for(x=0;x<c.length;x++){c[x].checked=false;a[x].value=""}var c=document.getElementsByName("book_montreal[]");var a=document.getElementsByName("book_prix_montreal[]");for(x=0;x<c.length;x++){c[x].checked=false;a[x].value=""}calcule("quebec");calcule("montreal");Delete_Cookie("cours");Delete_Cookie("livres_montreal");Delete_Cookie("livres_quebec");Delete_Cookie("totalLivresMontreal");Delete_Cookie("totalLivresQuebec");Delete_Cookie("totalMontreal");Delete_Cookie("totalQuebec");if(document.frm1.txtNom){document.frm1.txtNom.value=""}if(document.frm1.txtTelephone){document.frm1.txtTelephone.value=""}if(document.frm1.txtCourriel){document.frm1.txtCourriel.value=""}if(document.frm1.txtRemarques){document.frm1.txtRemarques.value=""}Delete_Cookie("facturation");Delete_Cookie("participante")};