/* ****************************************************************************************** ****************************************************************************************** LIBRERIA FUNZIONI JS ****************************************************************************************** ****************************************************************************************** */ // Utility function for converting degrees to radians Math.deg2rad = function ( x ) { return x * (Math.PI / 180.0); } var EARTH_RADIUS = 6367; // Calculates the distance (in km's) between 2 points. function distance_between_points ( p1, p2 ) { var a = Math.deg2rad( 90 - p1.y); var b = Math.deg2rad( 90 - p2.y); var theta = Math.deg2rad( p2.x - p1.x); var c = Math.acos( Math.cos(a) * Math.cos(b) + Math.sin(a) * Math.sin(b) * Math .cos(theta)); return c * EARTH_RADIUS; } var txtCodice; var txtDescrizione; var oldValue; var nAnno; var totale; var objLabel; /***** FUNZIONE PER CERCARE IL CODICE NEGOZIO ***/ function setCodiceNegozio(codice, textBox) { objFire = document.getElementById(textBox); objFire.value = codice; fireHTMLEvent(objFire,"onchange"); } function changeText(obj, obj2) { txtCodice = obj.id; txtDescrizione = obj2; PageMethods.getStore(obj.value, onComplete); } function onComplete(args) { document.getElementById(txtCodice).value = args[0]; document.getElementById(txtDescrizione).value = args[1]; } /***** FUNZIONE PER CERCARE IL CODICE ZONA ***/ function setCodiceZona(codice, textBox) { objFire = document.getElementById(textBox); objFire.value = codice; fireHTMLEvent(objFire,"onchange"); } function changeTextZona(obj, obj2) { txtCodice = obj.id; txtDescrizione = obj2; PageMethods.getZone(obj.value, onCompleteZone); } function onCompleteZone(args) { document.getElementById(txtCodice).value = args[0]; document.getElementById(txtDescrizione).value = args[1]; } function focusTextBox(obj, className) { oldValue = obj.value; obj.value =''; obj.className =className; } function blurTextBox(obj, className) { if(obj.value=="0" || obj.value=="") { obj.value = oldValue; } obj.className =className; } function fireHTMLEvent(obj,eventType) { if(typeof obj.fireEvent != "undefined") obj.fireEvent(/^on/.test(eventType) ? eventType : "on" + eventType) else { var evt = document.createEvent("HTMLEvents"); evt.initEvent(eventType.replace(/^on/,""),true,true) obj.dispatchEvent(evt); } } /*** SELEZIONA DESELEZIONA TUTTI I CHECKBOX DI UNA TABELLA ***/ function chkUnchkAllElements( objTabella, sElementCheckAll ) { var oForm = document.getElementById(objTabella); var sElementCheckAll = sElementCheckAll; if (oForm.getElementsByTagName("input").length != undefined) { for(i=0; iZoom image\n'); wWin.document.write('\n'); wWin.document.write('\n'); wWin.document.write('\n'); wWin.document.write('
\n'); wWin.document.write('\n'); wWin.document.write('
\n'); wWin.document.write('\n'); //script = scri+pt per non avere problemi di visualizzazione codice in DW wWin.document.write('\n'); wWin.document.close(); } var undefined; // ************************************************************* // ************************************************************* // ****************** BROWSER SNIFFER ************************* // ************************************************************* // ************************************************************* var exclude=1; var agt=navigator.userAgent.toLowerCase(); var win=0;var mac=0;var lin=1; if(agt.indexOf('win')!=-1){win=1;lin=0;} if(agt.indexOf('mac')!=-1){mac=1;lin=0;} var lnx=0;if(lin){lnx=1;} var ice=0; var ie=0;var ie4=0;var ie5=0;var ie6=0;var com=0;var dcm; var op5=0;var op6=0;var op7=0; var ns4=0;var ns6=0;var ns7=0;var mz7=0;var kde=0;var saf=0; if(typeof navigator.vendor!="undefined" && navigator.vendor=="KDE"){ var thisKDE=agt; var splitKDE=thisKDE.split("konqueror/"); var aKDE=splitKDE[1].split("; "); var KDEn=parseFloat(aKDE[0]); if(KDEn>=2.2){ kde=1; ns6=1; exclude=0; } } else if(agt.indexOf('webtv')!=-1){exclude=1;} else if(typeof window.opera!="undefined"){ exclude=0; if(/opera[\/ ][5]/.test(agt)){op5=1;} if(/opera[\/ ][6]/.test(agt)){op6=1;} if(/opera[\/ ][7-9]/.test(agt)){op7=1;} } else if(typeof document.all!="undefined"&&!kde){ exclude=0; ie=1; if(typeof document.getElementById!="undefined"){ ie5=1; if(agt.indexOf("msie 6")!=-1){ ie6=1; dcm=document.compatMode; if(dcm!="BackCompat"){com=1;} } } else{ie4=1;} } else if(typeof document.getElementById!="undefined"){ exclude=0; if(agt.indexOf("netscape/6")!=-1||agt.indexOf("netscape6")!=-1){ns6=1;} else if(agt.indexOf("netscape/7")!=-1||agt.indexOf("netscape7")!=-1){ns6=1;ns7=1;} else if(agt.indexOf("gecko")!=-1){ns6=1;mz7=1;} if(agt.indexOf("safari")!=-1 || (typeof document.childNodes!="undefined" && typeof document.all=="undefined" && typeof navigator.taintEnabled=="undefined")){mz7=0;ns6=1;saf=1;} } else if((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)){ exclude=0; ns4=1; if(typeof navigator.mimeTypes['*']=="undefined"){ exclude=1; ns4=0; } } if(agt.indexOf('escape')!=-1){exclude=1;ns4=0;} if(typeof navigator.__ice_version!="undefined"){exclude=1;ie4=0;} // ************************************************************* // ************************************************************* // ****************** BROWSER SNIFFER ************************* // ************************************************************* // ************************************************************* ///Tooltip text function toolTipText(sStore, sAddress) { var text = ''+sStore+'
'; text +=sAddress.split("[-]").join("
"); return text; } function genericToolTipText(sText) { var text =sText; return text; } function PDIToolTipText(sText) { var text = ''; /*''; text +='
'; text +='
'+sText+'
';*/ text = sText; return text; } function elementsShowHideObject(objSender, objShowHide) { var oObj = document.getElementById(objShowHide); if(objSender.src.indexOf("images/ico/ico_plus.gif")>0) { objSender.src ="images/ico/ico_minus.gif"; } else { objSender.src ="images/ico/ico_plus.gif"; } if( oObj.style.display=="none") { oObj.style.display=""; } else { oObj.style.display="none"; } }