// BROWSER DETECTION function BrowserCheck() { var b = navigator.appName if (b=="Netscape") this.b = "ns" else if (b=="Microsoft Internet Explorer") this.b = "ie" else this.b = b this.version = navigator.appVersion this.v = parseInt(this.version) this.ns = (this.b=="ns" && this.v>=4) this.ns4 = (this.b=="ns" && this.v==4) this.ns5 = (this.b=="ns" && this.v==5) this.ns6 = (this.b=="ns" && this.v==6) this.ie = (this.b=="ie" && this.v>=4) this.ie4 = (this.version.indexOf('MSIE 4')>0) this.ie5 = (this.version.indexOf('MSIE 5')>0) this.min = (this.ns||this.ie) } is = new BrowserCheck(); // INPUT ACTIONS function enterInput(obj,text) { if (obj.value == text) { obj.value = ""; } } function leaveInput(obj,text) { if (obj.value == "") { obj.value = text; } } function over_tool(obj, classe) { //alert(obj.parentNode.className); obj.parentNode.className = classe + "_over"; } function out_tool(obj, classe) { obj.parentNode.className = classe + "_out"; } // SETFONT FUNCTION var font_size = 1; //base font-size var font_size_MAX = 1.4; var font_size_MIN = 0.8; function setFontLarger() { font_size = font_size + 0.2; if (font_size > font_size_MAX) { font_size = font_size_MAX; } SetFontSize(); } function setFontSmaller() { font_size = font_size - 0.2; if (font_size < font_size_MIN) { font_size = font_size_MIN; } SetFontSize(); } function SetFontSize() { var oDoc = document.getElementById("pagecontent"); if (oDoc) oDoc.style.fontSize = font_size + "em"; } // POPUP FUNCTION var zoomwindow; function deplace(window,width,height) { var scr_x = screen.width; var scr_y = screen.height; if (is.v >= 4) { if (is.ns) { window.moveTo((scr_x/2)-(width/2), (scr_y/2)-(height/2)); } else { window.moveTo(parent.window.screenLeft+300, parent.window.screenTop+50); } } } var movePopup = true; var scrollPopup = 1; function popup(url, width, height) { if (url != "") { var features; var windowName = "ZOOMWINDOW"; movePopup = true; scrollPopup = 1; if (popup.arguments.length >= 4) { if (popup.arguments[3]) { movePopup = true; } else { movePopup = false; } } if (popup.arguments.length >= 5) { if (popup.arguments[4] == 0 || popup.arguments[4] == 1) { scrollPopup = popup.arguments[4]; } } if (popup.arguments.length >= 6) { zoomwindow = popup.arguments[5]; windowName = zoomwindow; } else { if (zoomwindow != null) { if (!zoomwindow.closed) zoomwindow.close(); } } features = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scrollPopup + ",resizable=0,width=" + width + ",height=" + height + "'"; zoomwindow = window.open(url,windowName,features); if (zoomwindow != null) { if (is.v >= 3) { zoomwindow.focus(); } if (movePopup) { deplace(zoomwindow,width,height); } } } } var i = 0; var s = 0; function resizePopup() { if (navigator.appName == 'Netscape') i = 40; if (window.navigator.userAgent.indexOf("SV1") != -1) s = 20; //This browser is Internet Explorer in SP2. if (document.images[0]) window.resizeTo(document.images[0].width + 30, document.images[0].height + 60 - i + s); self.focus(); if (document.images[0]) { imgHeight = document.images[0].height + 120 - i; imgWidth = document.images[0].width + 30; var height = screen.height; var width = screen.width; var leftpos = width / 2 - imgWidth / 2; var toppos = height / 2 - imgHeight / 2; window.moveTo(leftpos, toppos); window.resizeTo(imgWidth, imgHeight); } } function envoyer_ami(id_sitra, latitude, longitude, type_fiche) { if(id_sitra){ url = "http://apicil-som.apicil.com/site/popup_envoyer.php?id_sitra="+id_sitra+"&latitude="+latitude+"&longitude="+longitude+"&type_fiche="+type_fiche; }else{ url = "http://apicil-som.apicil.com/site/popup_envoyer.php?id_version="; } window.open (url,"", "width=630,height=340,status=no,toolbar=no,menubar=no,resizable=yes"); } function newsletter_validation(formulaire) { if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formulaire.email.value)){ url = "http://apicil-som.apicil.com/site/popup_newsletter_reponse.php?id_version="; window.open ("", "newsletter", "width=630,height=340,status=no,toolbar=no,menubar=no,resizable=yes"); formulaire.target = "newsletter"; formulaire.action = url; return void(0); } alert("Adresse email invalide") return void(0); } /* * Permet d'envoyer des données en GET ou POST en utilisant les XmlHttpRequest */ function sendData(page, method, id_them) { var xhr_object = null; if(window.XMLHttpRequest) // Firefox xhr_object = new XMLHttpRequest(); else if(window.ActiveXObject) // Internet Explorer xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); else { // XMLHttpRequest non supporté par le navigateur alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); return; } var filename = page; var s1 = escape(id_them); var data = null; if(s1 != "") data = "id_them="+s1; if(method == "GET" && data != null) { filename += "?"+data; data = null; } xhr_object.open(method, filename, true); xhr_object.onreadystatechange = function() { if(xhr_object.readyState == 4) { eval(xhr_object.responseText); } } if(method == "POST") xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr_object.send(data); } //Changement d'onglet dans la page contact var currentOnglet; function changeOnglet(obj, idx) { currentOnglet = idx; //alert(obj.parentNode.parentNode.className); var rootObj = obj.parentNode.parentNode.parentNode; var arr = new Array(); for (i = 0; i < rootObj.childNodes.length; i++) { if (rootObj.childNodes[i].nodeType == 1) { arr.push(rootObj.childNodes[i]); } } //alert(rootObj.childNodes.length); for (i = 0; i < arr.length; i++) { //alert(arr[i]); if ((idx - 1) == i) { arr[i].className = "onglet onglet_on"; document.getElementById('panel_' + (i + 1)).style.display = "block"; } else { arr[i].className = "onglet onglet_off"; document.getElementById('panel_' + (i + 1)).style.display = "none"; } } //obj.parentNode.parentNode.className = "onglet onglet_" + state; }