// **** // FORM // **** function bddPostbackForm(id) { var objForm = document.getElementById("bddForm" + id); if (objForm) { var elements = objForm.getElementsByTagName("input"); for (var i = 0, l = elements.length; i < l; i++) { if (elements[i].id == "frmpostback") { elements[i].value = "false"; objForm.submit(); } } } } function bddSwitchForm(display) { var divForm = document.getElementById("divForm"); var divRecord = document.getElementById("divRecord"); if(divForm && divRecord){ if(display){ divForm.className = "displayOn"; divRecord.className = "displayOff"; } else{ divForm.className = "displayOff"; divRecord.className = "displayOn"; } } } // ******* // DETAILS // ******* function strToHex(id) { var hexreturn = ""; for (i = 1; i <= id.toString().length; i++) { hexreturn = hexreturn + (99 - id.toString().charCodeAt(i - 1)); hexreturn = hexreturn + (id.toString().charCodeAt(i - 1)); } return hexreturn; } function bddThrowDetails(base,id,mode,espace,name) { if(base=='cpcr'){ bddThrowCPCR(id) }; if(base=='coupe'){ bddThrowCup(id) }; if(base=='contacts'){ bddThrowContact(id) }; if(base=='calendrier'){ bddThrowCompet(id) }; if(base=='etalonnage'){ bddThrowEtalonnage(id) }; if(id && (base=='biographies' || base=='selections' || base=='cclubs')){ FFAbases = window.open('/asp.net/athletes.aspx?base=' + base + '&id=' + id + '&espace=' + espace, "FFAthle", 'width=715,height=600,scrollbars'); FFAbases.focus(); } if(id && (base=='resultats' || base=='bilans' || base=='podiums' || base=='records' || base=='vitessekm')){ FFAbases = window.open('/asp.net/athletes.aspx?base=' + base + '&seq=' + id + '&espace=' + espace, "FFAthle", 'width=715,height=600,scrollbars'); FFAbases.focus(); } } function bddThrowAthlete(base,seq,espace,structure) { var urlEspace = (espace)?'&espace='+espace:''; var urlStructure = (structure)?'&structure=' + structure:''; var url = '/asp.net/athletes.aspx?base=' + base + '&seq=' + strToHex(seq) + urlEspace + urlStructure; FFAbases = window.open(url, 'FFAthle', 'width=715,height=600,scrollbars'); FFAbases.focus(); } function bddThrowCPCR(id) { if(id){ FFAbases = window.open('/asp.net/cpcr.aspx?base=cpcr&id=' + id, 'FFAthle', 'width=700,height=600,scrollbars'); FFAbases.focus(); } } function bddThrowCup(challenge, annee, id, equipe) { if(id){ FFAbases = window.open('/asp.net/coupe.aspx?base=coupe&challenge=' + challenge + '&annee=' + annee + '&id=' + id + '&equ=' + equipe, 'FFAthle', 'width=715,height=600,scrollbars'); FFAbases.focus(); } } function bddThrowContact(id, type) { if (id) { FFAbases = window.open('/asp.net/contacts.aspx?base=contacts&id=' + strToHex(id) + '&type=' + type, 'FFAthle', 'width=715,height=600,scrollbars'); FFAbases.focus(); } } function bddThrowCompet(id) { if(id){ FFAbases = window.open('/asp.net/competitions.aspx?base=calendrier&id=' + id, 'FFAthle', 'width=715,height=600,scrollbars'); FFAbases.focus(); } } function bddThrowEtalonnage(bid,cid) { if(bid || cid){ FFAbases = window.open('/asp.net/etalonnage.aspx?base=etalonnage&bid=' + bid + '&cid=' + cid, 'FFAthle', 'width=715,height=600,scrollbars'); FFAbases.focus(); } } function newwindow(url) {window.open(url,'Prono','width=930,height=800,scrollbars=Yes'); } function openmessage(url) {mes=window.open(url,'Rec','width=480,height=300,scrollbars=Yes'); mes.focus(); } function goTV(url) {window.open(url, 'TV', 'width=620,height=620,scrollbars=Yes');} // ******** // BDD TABS // ******** function bddRollOnTab(tab) { if(!mainGetActiveStatus(tab.className)){tab.className="on"}; } function bddRollOutTab(tab) { if(!mainGetActiveStatus(tab.className)){tab.className="off"}; } function bddClickTab(tab) { var objRegExp; var arrRegExp; objRegExp = new RegExp("(.*?)\#([0-9]+)"); arrRegExp = objRegExp.exec(tab.id); if(arrRegExp && !mainGetActiveStatus(tab.className)){ var prefix = (arrRegExp)?arrRegExp[arrRegExp.length - 2]:""; var index = (arrRegExp)?arrRegExp[arrRegExp.length - 1]:""; if(prefix && index){ for(i=1;i<=7;++i){ var objDiv = document.getElementById(prefix.replace(/tab/gi, "Div") + "#" + i) ; var objTab = document.getElementById(prefix + "#" + i) ; if(objTab && objDiv){ if(i == mainGetNumber(index)){ objTab.className = "active"; objDiv.className = "displayOn"; } else{ objTab.className = "off"; objDiv.className = "displayOff"; } } } } } } function bddGetTabClass(mode) { if(typeof(mode)=="string"){ return mode } else { return "" }; } // ***** // INFOS // ***** function bddWeightInfos(required) { if(required){ alert("La requête ne peut aboutir que si ce critère est renseigné, il s'agit d'un champ imposé..."); } else{ alert("Une requête ne peut aboutir que si le poids total des critères de recherche renseignés est supérieur ou égal à dix, les chiffres placés à coté des champs indiquent le poids du critère en question..."); } } // ***** // JQUERY // ***** function SlideDiv(name, speed, img) { if (img == 1) { var num = mainGetNumber(name.substring(name.indexOf("_") + 1, name.length)) } if ($("#" + name + ":visible").length != 0) { $("#" + name).slideUp(speed); if (num) { $("#imgelement_" + num).css("background-image", "url(/images/v3/plus.gif)"); } } else { $("#" + name).slideDown(speed); if (num) { $("#imgelement_" + num).css("background-image", "url(/images/v3/moins.gif)"); } } }