function num2pounds(field){ var tmp1 = cents = dollars = ""; var dec = -1; var num,i; num = "" + (Math.round(field * 100)/100); dec = num.indexOf("."); cents = ((dec > 0) ? num.substring(dec,num.length) : ".00"); if (cents.length == 2) cents += "0"; dollars = "" + parseInt(num); tmp1 = insComma(dollars); num = String.fromCharCode("163"); for (i = tmp1.length-1; i >= 0; i--) num += tmp1.charAt(i);; num += cents + ""; return num; } function num2euro(field){ var tmp1 = cents = dollars = ""; var dec = -1; var num,i; num = "" + (Math.round(field * 100)/100); dec = num.indexOf("."); cents = ((dec > 0) ? num.substring(dec,num.length) : ".00"); if (cents.length == 2) cents += "0"; dollars = "" + parseInt(num); tmp1 = insComma(dollars); num = ""; for (i = tmp1.length-1; i >= 0; i--) num += tmp1.charAt(i);; num += cents + ""; /* THE EURO CHARACTER IS PART OF THE UNICODE CHARACTER SET THE FIX FOR THE CHARACTER APPEARING AS A SQUARE OR A "?" SYMBOLS IS TO CODE THE JAVASCRIPT STRING WITH THE UNICODE VALUE FOR THE CHARACTER: Therefore: € is U+20AC... and would be set in Javascript as "\u" and followed by the unicode num += " \u20ac"; */ num += " \u20ac"; return num; } function num2euroF(field){ var tmp1 = cents = dollars = ""; var dec = -1; var num,i; num = "" + (Math.round(field * 100)/100); dec = num.indexOf("."); cents = ((dec > 0) ? num.substring(dec,num.length) : ".00"); if (cents.length == 2) cents += "0"; dollars = "" + parseInt(num); tmp1 = insComma(dollars); num = ""; for (i = tmp1.length-1; i >= 0; i--) num += tmp1.charAt(i);; num += cents + ""; /* THE EURO CHARACTER IS PART OF THE UNICODE CHARACTER SET THE FIX FOR THE CHARACTER APPEARING AS A SQUARE OR A "?" SYMBOLS IS TO CODE THE JAVASCRIPT STRING WITH THE UNICODE VALUE FOR THE CHARACTER: Therefore: € is U+20AC... and would be set in Javascript as "\u" and followed by the unicode num += " \u20ac"; */ return num; } function num2dollar(field){ var tmp1 = cents = dollars = ""; var dec = -1; var num,i; num = "" + (Math.round(field * 100)/100); dec = num.indexOf("."); cents = ((dec > 0) ? num.substring(dec,num.length) : ".00"); if (cents.length == 2) cents += "0"; dollars = "" + parseInt(num); tmp1 = insComma(dollars); num = String.fromCharCode("36"); for (i = tmp1.length-1; i >= 0; i--) num += tmp1.charAt(i);; num += cents + ""; return num; } function ScrollProgressiveTotalsD(prId){ var objstr = "document.jpform"+prId+".progressive"+prId; var obj = eval(objstr); var itotal = 0; for(i=1;i<=11;i++){ JP[i] += (Inc[i]); itotal += JP[i]; } obj.value = num2dollar(itotal/100); window.setTimeout("ScrollProgressiveTotalsD("+prId+")",400); } function ScrollProgressiveTotalsP(prId){ var objstr = "document.jpform"+prId+".progressive"+prId; var obj = eval(objstr); var itotal = 0; for(i=1;i<=11;i++){ JP[i] += (Inc[i]); itotal += JP[i]; } itotal = itotal; obj.value = num2pounds(itotal/100); window.setTimeout("ScrollProgressiveTotalsP("+prId+")",400); } function ScrollProgressiveTotalsE(prId){ var objstr = "document.jpform"+prId+".progressive"+prId; var obj = eval(objstr); var itotal = 0; for(i=1;i<=11;i++){ JP[i] += (Inc[i]); itotal += JP[i]; } itotal = itotal; obj.value = num2euro(itotal/100); window.setTimeout("ScrollProgressiveTotalsE("+prId+")",400); } function ScrollProgressiveTotalsF(prId){ var objstr = "document.jpform"+prId+".progressive"+prId; var obj = eval(objstr); var itotal = 0; for(i=1;i<=11;i++){ JP[i] += (Inc[i]); itotal += JP[i]; } itotal = itotal; obj.value = num2euroF(itotal/100); window.setTimeout("ScrollProgressiveTotalsF("+prId+")",400); } function ScrollProgressiveCountersD(prId){ var objstr = "document.forms['jpform"+prId+"'].elements['progressive"+prId+"']"; var obj = eval(objstr); if (obj) { JP[prId] += (Inc[prId]); obj.value = num2dollar(JP[prId]/100); } window.setTimeout( "ScrollProgressiveCountersD("+prId+")",1000); } function ScrollProgressiveCountersE(prId){ var objstr = "document.forms['jpform"+prId+"'].elements['progressive"+prId+"']"; var obj = eval(objstr); var itotal = 0; if (obj) { JP[prId] += (Inc[prId]); itotal += (JP[prId]); obj.value = num2euro(JP[prId]/100); } window.setTimeout( "ScrollProgressiveCountersE("+prId+")",1000); } function ScrollProgressiveCountersP(prId){ var objstr = "document.forms['jpform"+prId+"'].elements['progressive"+prId+"']"; var obj = eval(objstr); var itotal = 0; if (obj) { JP[prId] += (Inc[prId]); itotal += (JP[prId]); obj.value = num2pounds(itotal/100); } window.setTimeout( "ScrollProgressiveCountersP("+prId+")",1000); }