1// Funzioni di utilità 2 3function GetBrowserType() { 4var OP,IE4,IE5,NN4,NN6 5OP = (window.opera) ? 1:0; 6IE4 = (document.all && !OP) ? 1:0; 7IE5 = (IE4 && document.getElementById) ? 1:0; 8NN4 = (document.layers) ? 1:0; 9NN6 = (!IE4 && !NN4 && document.getElementById) ? 1:0; 10 if (OP) { 11 return "OPERA" 12 } else if ((IE4) || (IE5)) { 13 return "IE" 14 } else if ((NN4) || (NN6)) { 15 return "NN" 16 } else { 17 // se e' un browser diverso ritorna come se fosse IE 18 return "IE" 19 } 20} 21 22function GetBrowserVersion() { 23var sType = GetBrowserType() 24 if ((sType=="OPERA")||(sType=="NN")) { 25 return parseFloat(navigator.appVersion) 26 } else if (sType=="IE") { 27 if (navigator.appName.indexOf("Microsoft") >= 0) { 28 // IE 29 var iInfo = navigator.appVersion.indexOf("MSIE") + 5 30 var sInfo = navigator.appVersion.substring(iInfo) 31 return parseFloat(sInfo) 32 } else { 33 return parseFloat("0.0") 34 } 35 } 36} 37 38function JSQueryString(par) { 39var sTemp 40var sPar 41var sFin, iStart, iEnd 42 sTemp = new String(window.location) 43 sPar = new String(par + "=") 44 iStart = sTemp.indexOf(sPar) 45 if (iStart>0) { 46 iFin = sTemp.indexOf("&",iStart) 47 if (iFin==-1) { 48 //Se non c'è fine allora è l'ultimo 49 iFin = sTemp.length 50 } 51 sFin = sTemp.substring(iStart + sPar.length,iFin) 52 } else { 53 sFin = "" 54 } 55 return sFin 56} 57 58function setCookie(name, value, expires, path, domain, secure) { 59 var curCookie = name + "=" + escape(value) + 60 ((expires) ? "; expires=" + expires.toGMTString() : "") + 61 ((path) ? "; path=" + path : "") + 62 ((domain) ? "; domain=" + domain : "") + 63 ((secure) ? "; secure" : ""); 64 document.cookie = curCookie; 65} 66 67function getCookie(name) { 68 var dc = document.cookie; 69 var prefix = name + "="; 70 var begin = dc.indexOf("; " + prefix); 71 if (begin == -1) { 72 begin = dc.indexOf(prefix); 73 if (begin != 0) return null; 74 } else 75 begin += 2; 76 var end = document.cookie.indexOf(";", begin); 77 if (end == -1) 78 end = dc.length; 79 return unescape(dc.substring(begin + prefix.length, end)); 80} 81 82function deleteCookie(name, path, domain) { 83 if (getCookie(name)) { 84 document.cookie = name + "=" + 85 ((path) ? "; path=" + path : "") + 86 ((domain) ? "; domain=" + domain : "") + 87 "; expires=Thu, 01-Jan-70 00:00:01 GMT"; 88 } 89} 90 91function fixDate(date) { 92 var base = new Date(0); 93 var skew = base.getTime(); 94 if (skew > 0) 95 date.setTime(date.getTime() - skew); 96} 97 98function Stato(msg) { 99 window.status = msg 100} 101 102function Fix3(valore) { 103 return (Math.floor(valore)).toString() + "." + Math.floor(((valore-Math.floor(valore))*1000)).toString() 104} 105 106function ConvToFloat(valore) { 107 var s1=valore.toString().replace("\,",".") 108 return parseFloat(s1) 109} 110 111function ShowLayer(lname) { 112var ns4 = document.layers; 113var ns6 = document.getElementById && !document.all; 114var ie4 = document.all; 115var lay 116var vis 117 if(ns4) eval("lay=document."+lname) 118 else if(ns6) lay = document.getElementById(lname); 119 else eval("lay=document.all."+lname) 120 if (lay.style) { 121 lay.style.visibility="show" 122 } 123} 124// Example: obj = findObj("image1"); 125function findObj(theObj, theDoc) 126{ 127 var p, i, foundObj; 128 129 if(!theDoc) theDoc = document; 130 if( (p = theObj.indexOf("?")) > 0 && parent.frames.length) 131 { 132 theDoc = parent.frames[theObj.substring(p+1)].document; 133 theObj = theObj.substring(0,p); 134 } 135 if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj]; 136 for (i=0; !foundObj && i < theDoc.forms.length; i++) 137 foundObj = theDoc.forms[i][theObj]; 138 for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 139 foundObj = findObj(theObj,theDoc.layers[i].document); 140 if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj); 141 142 return foundObj; 143} 144// * Dependencies * 145// this function requires the following snippets: 146// JavaScript/readable_MM_functions/findObj 147// 148// Accepts a variable number of arguments, in triplets as follows:
149// arg 1: simple name of a layer object, such as "Layer1" 150// arg 2: ignored (for backward compatibility) 151// arg 3: 'hide' or 'show' 152// repeat... 153// 154// Example: showHideLayers(Layer1,'','show',Layer2,'','hide'); 155function showHideLayers() 156{ 157 var i, visStr, obj, args = showHideLayers.arguments; 158 for (i=0; i<(args.length-2); i+=3) 159 { 160 if ((obj = findObj(args[i])) != null) 161 { 162 visStr = args[i+2]; 163 if (obj.style) 164 { 165 obj = obj.style; 166 if(visStr == 'show') visStr = 'visible'; 167 else if(visStr == 'hide') visStr = 'hidden'; 168 } 169 obj.visibility = visStr; 170 } 171 } 172} 173 174function invertiLayer(liv) { 175 if ((obj = findObj(liv)) != null) { 176 if(obj.style) obj=obj.style 177 obj.visibility=='visible'?obj.visibility='hidden':obj.visibility='visible' 178 } 179} 180 181function invertiDisplayLayer(liv) { 182 if ((obj = findObj(liv)) != null) { 183 if(obj.style) obj=obj.style 184 obj.display==''?obj.display='none':obj.display='' 185 } 186} 187 188
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.