function unloadPopupBox() { // TO Unload the Popupbox $('#popup_trans').fadeOut("slow"); $("#ContainerIntro").css({ // this is just for style "opacity": "1" }); } function loadPopupBox() { // To Load the Popupbox $('#popup_trans').fadeIn("slow"); $("#ContainerIntro").css({ // this is just for style "opacity": "1" }); } //Bouton pour la popup journal transaction function submitTrans(form, action){ $('#formaction_trans').val(action); $('#'+form).submit(); //alreadySubmitted = true; return false; } // accès à la servlet de deconnexion function logout() { document.location="Logout"; return false; } //Acces au menu function gotoMenu() { document.location="Home"; return false; } //Acces au journal detail function gotoJournalDetail() { document.location="Journal?type=1"; return false; } //Acces au journal cumul function gotoJournalCumul() { document.location="Journal?type=2"; return false; } //Consultation function consultAction(id, action, fromAction){ $("#"+id).val(fromAction); disablButton(consult1); onFormAction(action, -1); return false; } //impression function print(titre, obj) { // Définie la zone à imprimer var zi = document.getElementById(obj).innerHTML; // Ouvre une nouvelle fenêtre var f = window.open("", "FACTURE", "height=500, width=600,toolbar=0, menubar=0, scrollbars=1, resizable=1,status=0, location=0, left=10, top=10"); // Définit le style de la page f.document.body.style.color = '#000000'; f.document.body.style.backgroundColor = '#FFFFFF'; f.document.body.style.padding = "10px"; // Ajoute les Données f.document.title = titre; f.document.body.innerHTML += " " + zi + " "; // Imprime et ferme la fenêtre f.window.print(); f.window.close(); return false; } function addStreet(name, stid) { var obj=document.getElementById(name+'_clkstreet'+(stid-1)); if (obj != null) { obj.style.display='none'; } var obj=document.getElementById(name+'_divstreet'+stid); if (obj != null) { obj.style.display='block'; } return false; } function menu(id){ if(document.getElementById(id)==null){ return false; } if (document.getElementById(id).style.display=='none'){ document.getElementById(id).style.display='block'; }else { document.getElementById(id).style.display='none'; } } function cacheDiv(id){ if (document.getElementById(id)==null){ return false; } document.getElementById(id).style.display='none'; } function afficheDiv(id){ document.getElementById(id).style.display='block'; } //Cree par ODU le 12/05. Permet d'afficher les elements necessaires en fonction du type de groupe //Utilise dans l'ecran des groupes accepteurs. function AfficheTypeGroupe(){ //Declaration des variables var valeur; //On cache l'ensemble des zones for(i=1;i<4;i++){ document.getElementById('Type'+i).style.display='none'; } //On recupere la bonne valeur if (document.getElementById('groupTypeList')!=null){ //Utiliser pour les autres actions valeur=document.getElementById('groupTypeList').selectedIndex; valeur = parseInt(valeur) +1; }else { //Utilise en consultation valeur=document.getElementById('vhcgroupTypeList').value; valeur = parseInt(valeur); } //Affichage de la zone souhaitee document.getElementById('Type'+ valeur).style.display='block'; } //Creee par ODU le 07/05 dans l'ecran des distributeur function AfficheCaracTypeDistrib(){ //Declaration des variables var valeur; if (document.getElementById('ListeTypeReseau')!=null){ //Utiliser pour les autres actions valeur=document.getElementById('ListeTypeReseau').selectedIndex; valeur = parseInt(valeur) +1; }else { //Utilise en consultation valeur=document.getElementById('vhcListeTypeReseau').value; valeur = parseInt(valeur); } //En fonction de la valeur, on cache ou pas la zone. switch (valeur) { //Cas de banque case 1: document.getElementById('CodeBanque').style.display='block'; document.getElementById('Siret').style.display='none'; break; //Cas de entreprise case 2: document.getElementById('CodeBanque').style.display='none'; document.getElementById('Siret').style.display='block'; break; default: document.getElementById('CodeBanque').style.display='none'; document.getElementById('Siret').style.display='none'; break; } } //Creee par ODU le 06/05 dans l'ecran des offres pour afficher les banques function RestrictionBanque(){ //Declaration des variables var valeur; if (document.getElementById('withdrawalRestriction')==null){ return false; } if (document.getElementById('withdrawalRestriction')!=null){ //Utiliser pour les autres actions valeur=withdrawalRestriction.selectedIndex; }else { if (document.getElementById('vhcwithdrawalRestriction')!=null){ //Utilise en consultation valeur=document.getElementById('vhcwithdrawalRestriction').value; }else { valeur=0; } } if (document.getElementById('RestrictionBanque')!=null){ //En fonction de la valeur, on cache ou pas la zone. if (valeur==0 ){ document.getElementById('RestrictionBanque').style.display='none'; }else { document.getElementById('RestrictionBanque').style.display='inline'; } } } //Creee par ODU le 29/04 dans l'ecran des produits pour afficher les commissions function AfficheTableauCommission(){ //On cache l'ensemble des zones for(i=1;i<9;i++){ document.getElementById('Com'+i).style.display='none'; } //Affichage de paiement if (document.getElementById('chkUsagePaiement').checked) { document.getElementById('Com1').style.display='block'; } //Affichage de paiement a l'etranger if (document.getElementById('chkUsagePaiement').checked ) { document.getElementById('Com5').style.display='block'; } //Affichage des retraits if (document.getElementById('chkUsageRetrait').checked ) { document.getElementById('Com2').style.display='block'; document.getElementById('Com3').style.display='block'; document.getElementById('Com4').style.display='block'; } //Affichage des retraits a l'international if (document.getElementById('chkUsageRetrait').checked ) { document.getElementById('Com6').style.display='block'; document.getElementById('Com7').style.display='block'; document.getElementById('Com8').style.display='block'; } } //Creee par ODU le 21/04 dans l'ecran des utilisateurs pour afficher ou non les zones function AfficheTableauTypeRattachement(){ //Permet d'eviter les erreurs en CONSULTATION if (document.getElementById('ListeTypeRattachement')==null){ return false; } if (document.getElementById('ListeTypeRattachement').value==1){ for(i=2;i<5;i++){ document.getElementById('Typ'+i).style.display='none'; } } else{ for(i=2;i<5;i++){ if (document.getElementById('ListeTypeRattachement').value == i){ document.getElementById('Typ'+i).style.display='block'; }else { document.getElementById('Typ'+i).style.display='none'; } } } } function onFormActionWithURL(url, action) { return onFormActionWithURL(url,action,'',''); } function onFormActionWithURL(url, action, element) { return onFormActionWithURLAndConfirm(url, action, element, ''); } function onFormActionWithURLAndConfirm(url, action, element, msgConf) { document.form1.action=url; return onFormActionWithConfirm(action, element, msgConf); } function onFormAction(action, element) { return onFormAction(action, element, ''); } var alreadySubmitted = false; function onFormAction(action, element,element2) { if (alreadySubmitted) { alert('Votre demande a bien été prise en compte.\nMerci de patienter pendant le rafraichissement de la page.'); return false; } document.form1.formaction.value = action; document.form1.formelement.value = element; document.form1.formelement2.value = element2; // avant de submit selectionne toute les select qui s'appellent *_selected for (var i =0 ; i=limit) { var obj2=document.getElementById(to); obj2.focus(); } } // ajoute une nouvelle ligne de code bin pour l'ecran des interface function addBin(name, stid) { var obj=document.getElementById(name+'_clkbin'+(stid-1)); if (obj != null) { obj.style.display='none'; } var obj=document.getElementById(name+'_divbin'+stid); if (obj != null) { obj.style.display='block'; } return false; } //ouverture d'une (vraie) popup function popMe(url, height, width) { height = (height) ? height : 500; width = (width) ? width : 700; var otop = (screen.height-height)/2.0; var oleft = (screen.width-width)/2.0; window.open(url,'_blank','title=no, width='+width+', height='+height+', top='+otop+', left='+oleft+',status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes'); return false; } //ouverture d'une (fausse) popup function popDiv(url, height, width) { height = (height) ? height : 500; width = (width) ? width : 700; var scrollT = window.pageYOffset; scrollT = (scrollT) ? scrollT : document.body.scrollTop; scrollT = (scrollT) ? scrollT : document.documentElement.scrollTop; var pageWidth = window.innerWidth; pageWidth = (pageWidth) ? pageWidth : document.documentElement.clientWidth; pageWidth = (pageWidth) ? pageWidth : document.body.clientWidth; var pageHeight = window.innerHeight; pageHeight = (pageHeight) ? pageHeight : document.documentElement.clientHeight; pageHeight = (pageHeight) ? pageHeight : document.body.clientHeight; var docHeight = document.body.scrollHeight + (document.body.offsetHeight - document.body.clientHeight); docHeight = (docHeight) ? docHeight : document.height; docHeight = (docHeight) ? docHeight : document.body.height; docHeight = (docHeight) ? docHeight : document.documentElement.height; if (docHeight < pageHeight) docHeight = pageHeight; var otop = (pageHeight-height)/2.0; var oleft = (pageWidth-width)/2.0; var fond = document.getElementById('fondmodal'); var fondfrm = document.getElementById('fondfrm'); var popdiv = document.getElementById('popupdiv'); var popfrm = document.getElementById('popupfrm'); $('#fond').css('width', pageWidth); $('#fond').css('height', docHeight); $('#fondfrm').css('width', pageWidth); $('#fondfrm').css('height', docHeight); $('#popupdiv').css('top', scrollT+otop); $('#popupdiv').css('left', oleft); $('#popupdiv').css('width', width); $('#popupdiv').css('height', height); $('#popupfrm').css('width', width); $('#popupfrm').css('height', height); popfrm.src=url; fond.style.visibility='visible'; popdiv.style.visibility='visible'; return false; } //recherche le type de la derniere popup ouverte function getLastPopType() { var popdiv = document.getElementById('popupdiv'); popdiv = (popdiv) ? popdiv : parent.document.getElementById('popupdiv'); if (popdiv && popdiv.style.visibility=='visible') return 2; else return 1; } //fermeture d'une popup avec action sur le parent function closePopWithAction(action) { var lastPopType = getLastPopType(); if (lastPopType==2) { parent.document.form1.formaction.value=action; parent.document.form1.submit(); } else if (lastPopType==1) { window.opener.parent.document.form1.formaction.value=action; window.opener.parent.document.form1.submit(); } closePop(false); } //fermeture de la popup function closePop(refreshParent) { var lastPopType = getLastPopType(); refreshParent = (refreshParent) ? refreshParent : false; if (lastPopType==2) { var fond = parent.document.getElementById('fondmodal'); var popdiv = parent.document.getElementById('popupdiv'); var popfrm = parent.document.getElementById('popupfrm'); fond.style.visibility='hidden'; popdiv.style.visibility='hidden'; popfrm.src=''; if (refreshParent) { parent.location.reload(true); } } else if (lastPopType==1) { if (refreshParent) { window.opener.location.reload(true); } window.close(); } return false; } //recherche de la valuer d'un ensemble de boutons radio function getRadioValue(objname) { var objRadio = document.getElementsByName(objname); for (i=0;i < objRadio.length;i++) { if (objRadio[i].checked) return objRadio[i].value; } return -1; } //******************************* // Gestion des checkbox //******************************* function toggleHilight(c) { if (c.checked) { hilight(c); } else { unHilight(c); } } function hilight(c) { var tbody = c.parentNode.parentNode.parentNode; /* skip if already hilighted */ if (!(tbody.className.match(/-select/))) { tbody.className = tbody.className + "-select"; } } function unHilight(c) { var tbody = c.parentNode.parentNode.parentNode; if (tbody.className.match(/-select/)) { tbody.className = tbody.className.replace(/^(\S+)-select/, "$1"); } } function checkAll(name) { var arr = document.getElementsByName(name); var l = arr.length; for (var i = 0; i < l ; i++) { if (arr[i].disabled == false && arr[i].type == "checkbox") { arr[i].checked = true; hilight(arr[i]); } } return false; } function uncheckAll(name) { var arr = document.getElementsByName(name); var l = arr.length; for (i = 0; i < l; i++) { if (arr[i].type == "checkbox") { arr[i].checked = false; unHilight(arr[i]); } } return false; } function invert(name) { var arr = document.getElementsByName(name); var l = arr.length; for (var i = 0; i < l ; i++) { fldObj = arr[i]; if (fldObj.disabled == false && fldObj.type == 'checkbox') { if (fldObj.checked) { fldObj.checked = false; unHilight(fldObj); } else { fldObj.checked = true; hilight(fldObj); } } } }