User:KmamK/Templates & Graphic Tests

Tests of different Templates & Graphics

Resources
Source for the Resources List

International Trains
Source for the InternationalTrainCalculator International Train Calculator .FloatLeft { float: left; width: 215px; }  Cargo

Cargo each Recipient is to receive:



Number of Recipients



Cargo necessary to send:

  Passengers

Money each Recipient is to receive:



Number of Recipients:



Passengers necessary to send:

  Mail

Money each Recipient is to receive:



Number of Recipients:



Mail necessary to send:



 (       function{                "use strict";                function comma(n){                        /*from http://stackoverflow.com/a/10899795 */                        var parts=n.toString.split(".");                        return parts[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")+(parts[1]?"."+parts[1]:"");                }                function clean(i){                        return parseFloat(i.value.replace(/,/g,""));                }                function cleanup(e){                        e=e||window.event;                        var t=e.target||e.srcElement;                        t.value=comma(clean(t));                }                function l(id){                        return document.getElementById(id);                }                var cReceive=l("cReceive"),                cNumber=l("cNumber"),                cSend=l("cSend"),                pReceive=l("pReceive"), pNumber=l("pNumber"), pSend=l("pSend"), mReceive=l("mReceive"), mNumber=l("mNumber"), mSend=l("mSend"); function cCalc{ var receive=clean(cReceive), reset=clean(cNumber), cargo=Math.floor((receive-1)*reset/0.9); cSend.value=comma(cargo+1); }               function pCalc{ var receive=clean(pReceive), reset=clean(pNumber), passengers=Math.floor((receive-1)*reset/10.125); pSend.value=comma(passengers+1); }               function mCalc{ var receive=clean(mReceive), reset=clean(mNumber), mail=Math.floor((receive-1)*reset/0.675); mSend.value=comma(mail+1); }               var input=[cReceive,cNumber,pReceive,pNumber,mReceive,mNumber], proc=[cCalc,cCalc,pCalc,pCalc,mCalc,mCalc],i; if(cReceive.attachEvent) for(i=0;i<input.length;i++){ input[i].attachEvent("onpropertychange",proc[i]); input[i].attachEvent("onchange",cleanup); }else for(i=0;i<input.length;i++){ input[i].addEventListener("input",proc[i],false); input[i].addEventListener("change",cleanup,true); }               cReceive.value=pReceive.value=mReceive.value=comma(100); cNumber.value=pNumber.value=mNumber.value=1; cCalc; pCalc; mCalc; }       ); ignore this ;): InternationalTrainCalculator