/* function getUrlParameters(parameter, staticURL, decode) function sxRoundNumber(rnum, rlength) function sxDateDiff(date1, date2) function FormatNumberBy3(num) function CurrencyFormatted(amount) function ReplaceAll(Source, stringToFind, stringToReplace) function ReplaceAll2(Source, stringToFind, stringToReplace) usa regexp per la ricerca function numerico(num) function numericov(num) function esiste(str) function isset () function PostUrl(URLtarget, valoreParametro) function PostUrlEx(URLtarget, valoreParametro) function parseQuery(qstr) function ApriFinestra(mydiv,larghezza,altezza) function togliFinestra() function datefromYYYYMMAA(s) function HideTooltip() depregate function DateAAAAMMGGtostr(dataIn) function DatetostrAAAAMMGG(dataIn) function strToDate(dataIn) function Datetostr(dataIn) function strAAAAMMGGToDate(dataIn) function sxDateDiff2(date1, date2) function searchStringInArray (str, strArray) { function N2S(num,dim) function Mydate() function isDate (x) function isChecked(id) // combobox selezionato function setChecked(id,valore) // combobox selezionato valore true/false function setSelected(id,valore) // select set opzion value selezionato valore function isVisible(id) function setVisible(id,valore) function myHide(str) function N2S(num,dim) function Arr_Remove(arr, item) function dateFromISO(s) function nvl(oggetto,valoreDefault){ function isEmpty(s) function dataUguale(data1, data2) function inObjArray(oggetto, arrayOggetti) function cloneDR(o) function goToByScroll(id) function myTime() function showError(campo,err) function sortByKey(array, key,key2) // sort di un array con una o due campi function sortByKeyNum(array, key) { function DataFromCF(cf) { function MFFromCF(cf) { function newDate() function deleteAllRow(tableID) //cancella tutte le riche della tabella */ function getUrlParameters(parameter, staticURL, decode){ /* Function: getUrlParameters Description: Get the value of URL parameters either from current URL or static URL Author: Tirumal URL: www.code-tricks.com uso Argument Description parameter Name of the parameter to get. staticURL Provide Static URL as string to get the parameters decode Provide boolean true or false to decode URL component, for example provide true for converting �Hello%20World� to �Hello World� */ var currLocation = (staticURL.length)? staticURL : window.location.search, parArr = currLocation.split("?")[1].split("&"), returnBool = true; for(var i = 0; i < parArr.length; i++){ parr = parArr[i].split("="); if(parr[0] == parameter){ return (decode) ? decodeURIComponent(parr[1]) : parr[1]; returnBool = true; }else{ returnBool = false; } } if(!returnBool) return ""; } ////////////////////////////////////////////////////////////// function sxRoundNumber(rnum, rlength) { // Arguments: numero da arrotondare , numero di decimali var newnumber = Math.round(rnum*Math.pow(10,rlength)+(1/Math.pow(10,rlength+3)))/Math.pow(10,rlength); return newnumber; } function sxDateDiff(date1, date2) { dat1 = Date.UTC(date1.getFullYear(),date1.getMonth(), date1.getDate()) ; //_saldo_2 dat2 = Date.UTC(date2.getFullYear(),date2.getMonth(), date2.getDate()) ;//_saldo_2 //_saldo_2 var giorni=parseInt((date1.getTime() - date2.getTime()) /(24*60*60*1000)); var giorni=parseInt((dat1 - dat2) /(24*60*60*1000)); //_saldo_2 if (giorni <= 0) {giorni = 0;} return giorni; } function FormatNumberBy3(num) { sep = ","; decpoint = "."; num = num.toString(); a = num.split(decpoint); x = a[0]; // decimal y = a[1]; // fraction z = ""; if (typeof(x) != "undefined") { // reverse the digits. regexp works from left to right. for (i = x.length - 1; i >= 0; i--) z += x.charAt(i); // add seperators. but undo the trailing one, if there z = z.replace(/(\d{3})/g, "$1" + sep); if (z.slice(-sep.length) == sep) z = z.slice(0, -sep.length); x = ""; // reverse again to get back the number for (i = z.length - 1; i >= 0; i--) x += z.charAt(i); // add the fraction back in, if it was there if (typeof(y) != "undefined" && y.length > 0) x += decpoint + y; } return x; } function CurrencyFormatted(amount) { var i = parseFloat(amount); if (isNaN(i)) { i = 0.00; } var minus = ''; if (i < 0) { minus = '-'; } i = Math.abs(i); i = parseInt((i + .00501) * 100); // _new 18/01/2014 i = i / 100; s = new String(i); if (s.indexOf('.') < 0) { s += '.00'; } if (s.indexOf('.') == (s.length - 2)) { s += '0'; } s = minus + s; s = FormatNumberBy3(s); s = ReplaceAll(s, ".", "#"); s = ReplaceAll(s, ",", "."); s = ReplaceAll(s, "#", ","); return s; } function ReplaceAll(Source, stringToFind, stringToReplace) { var temp = ''; if (Source !=undefined) var temp = Source; var index = temp.indexOf(stringToFind); while (index != -1) { temp = temp.replace(stringToFind, stringToReplace); index = temp.indexOf(stringToFind); } return temp; } function ReplaceAll2(Source, stringToFind, stringToReplace) { var temp = ''; if (Source !=undefined) var temp = Source; temp = temp.replace(new RegExp(stringToFind, 'g'), stringToReplace); return temp; } function numerico(num){ // console.log(num); var nnum = num +""; nnum = nnum.replace(".", ""); nnum = nnum.replace(",", "."); return eval(nnum); } function numericov(num){ // console.log(num); var nnum = num +""; nnum = nnum.replace(".", "#"); nnum = nnum.replace(",", "."); nnum = nnum.replace("#", ","); return nnum; } /* function esiste(str){ return $('#'+str).length > 0; } var isset = function(obj, props) { if ((typeof (obj) === 'undefined') || (obj === null)) return false; else if (props && props.length > 0) return isset(obj[props.shift()], props); else if (obj.length > 0) return true; else return false; }; */ function isset () { // http://kevin.vanzonneveld.net // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: FremyCompany // + improved by: Onno Marsman // + improved by: Rafal Kukawski // * example 1: isset( undefined, true); // * returns 1: false // * example 2: isset( 'Kevin van Zonneveld' ); // * returns 2: true var a = arguments, l = a.length, i = 0, undef; if (l === 0) { throw new Error('Empty isset'); } while (i !== l) { if (a[i] === undef || a[i] === null) { return false; } i++; } return true; } function PostUrl(URLtarget, valoreParametro) { if (window.DOMParser) { var TipoBrowser = 'FF'; } else { var TipoBrowser = 'IE'; } if (document.getElementById('formPostUrl')){ var removeForm=document.getElementById('formPostUrl'); document.body.removeChild(removeForm); } if (TipoBrowser == 'IE') { // var txtform = "