document.write("
JavaScript required
 
"); var inv = {to: 'from', from: 'to'}; var lv = 0; function SetLast(x) { if (isFinite(x)) lv = x; } function s_val(s) { if (eval(s.selectedIndex)) { return s[s.selectedIndex].value; } else { return s.value; } } function CalculateFee(currency, sum, direction, is_inverse) { var fees = Fees[currency]; var offset = direction*3; var fee = 0; var is_negative = 0; if (is_inverse) { fee = sum - sum / (1 - fees[1+offset]/100); } else { fee = sum * (fees[1+offset]/100); } if (fee < 0) { is_negative = 1; fee = 0 - fee; } if (fee < fees[0+offset]) { fee = fees[0+offset]; } else if (fee > fees[2+offset]) { fee = fees[2+offset]; } if (is_negative) { fee = 0 - fee; } return fee; } function ToUE(currency, sum, direction, calc_fees, is_inv_fee) { if (calc_fees) sum -= CalculateFee(currency, sum, direction, is_inv_fee); if (Rates[currency][1] == 0) { sum *= Rates[currency][0]; } else { sum /= Rates[currency][0]; } if (sum < 0 ) sum = 0; return sum; } function FromUE(currency, sum, direction, calc_fees, is_inv_fee) { if (Rates[currency][1] == 0) { sum /= Rates[currency][0]; } else { sum *= Rates[currency][0]; } if (calc_fees) sum -= CalculateFee(currency, sum, direction, is_inv_fee); if (sum < 0 ) sum = 0; return sum; } function GetMargin(c_from, c_to) { if (typeof eval("Margins[c_from]") != 'undefined' && typeof eval("Margins[c_from][c_to]") != 'undefined') return Math.round(Margins[c_from][c_to]*100)/100 return 100; } function DirectCalc(f, sum, margin) { if (!margin) margin = GetMargin(s_val(f.PS_from), s_val(f.PS_to)); return FromUE(s_val(f.PS_to), ToUE(s_val(f.PS_from), sum, 0, 1, 0)*(100 - margin)/100, 1, 1, 0); } function InverseCalc(f, sum, margin) { if (!margin) margin = GetMargin(s_val(f.PS_from), s_val(f.PS_to)); return FromUE(s_val(f.PS_from), ToUE(s_val(f.PS_to), sum, 1, 1, 1)/(100 - margin)*100, 0, 1, 1); } function SetRate(f) { var margin = GetMargin(s_val(f.PS_from), s_val(f.PS_to)); if (margin > 99) { document.getElementById('rate1').childNodes[0].nodeValue = "Sorry, we don't currently convert " + CNames[s_val(f.PS_from)] + ' to ' + CNames[s_val(f.PS_to)]; } else { var sum = f.amount_from.value; var t = DirectCalc(f, sum, margin); if (t <= 0) { if (s_val(f.PS_from) == 1) { sum = 100; } else { sum = 1000; } t = ToUE(s_val(f.PS_from), DirectCalc(f, (FromUE(s_val(f.PS_from), sum, 0, 0, 0)), margin), 0, 0, 0); } var from = 1; var to = 1; t /= sum; if (t > 0.5) { to = Math.round(t*10000)/10000; } else { from = Math.round(10000/t)/10000; } document.getElementById('rate1').childNodes[0].nodeValue = from + ' ' + CNames[s_val(f.PS_from)] + ' = ' + to + ' ' + CNames[s_val(f.PS_to)]; } } function Recalculate(f) { if (f.dir.value == 'manual') return 0; var margin = GetMargin(s_val(f.PS_from), s_val(f.PS_to)); SetRate(f); if (margin > 99) { var t = eval("f.amount_"+inv[f.dir.value]); t.value = 0; } else { if (f.dir.value == 'from') { f.amount_to.value = DirectCalc(f, f.amount_from.value, margin); } else { f.amount_from.value = InverseCalc(f, f.amount_to.value, margin); } if (f.amount_from.value < 10) f.amount_from.value = Math.ceil(f.amount_from.value*100)/100; else f.amount_from.value = Math.round(f.amount_from.value*100)/100; if (f.amount_to.value < 10) f.amount_to.value = Math.floor(f.amount_to.value*100)/100; else f.amount_to.value = Math.round(f.amount_to.value*100)/100; if(f.amount_from.value < 0) f.amount_from.value = 0; if(f.amount_to.value < 0) f.amount_to.value = 0; } } function SetAmount(f, wh, e) { if ((e.keyCode < 32 && e.keyCode != 8) || e.keyCode == 44 || e.keyCode == 46) return false; var o = eval("f.amount_"+wh); var lch = o.value.charAt(o.value.length-1); if (lch == ',') { o.value = o.value.substr(0, o.value.length-1)+'.'; lch = '.'; } if (isFinite(o.value) && o.value < 9999999) { if (lch == '.') return false; } else { o.value = lv; } f.dir.value=wh; ResetPS(f, wh); if (o.value == lv) return false; FilterPS(f, wh) Recalculate(f); if (o.value < 0) o.value = 0; if (e.keyCode == 8 && o.value == '0') o.value = ''; return 1; } function clear_calc(f, dir) { if (f.dir.value == 'from') { f.amount_to.value = ''; } else { f.amount_from.value = ''; } } function repopulate_select(target, data, names, sel_value) { for (i = target.length; i >= 0; --i) { target[i] = null; } for(i=0; i < data.length; i++) { target[i] = new Option(names[data[i]], data[i]); if (data[i] == sel_value) target.selectedIndex = i; } if (!target.selectedIndex) target.selectedIndex = 0; } function FilterPS(f, src) { var dst = inv[src]; var ss = eval("f.PS_"+src); var ds = eval("f.PS_"+dst); var sv = s_val(ss); var dv = s_val(ds); if (sv == dv) { ds.selectedIndex = (ds.selectedIndex == 0) ? 1 : 0; } Recalculate(f); } function ResetPS(f, wh) { var the_sel = eval("f.PS_"+wh); var cur_val = s_val(the_sel); var the_data = eval("all_"+wh); repopulate_select(the_sel, the_data, CNames, cur_val); } function trim(o) { while (o.value.charCodeAt(0) < 33) o.value = o.value.substring(1, o.value.length) while (o.value.charCodeAt(o.value.length-1) < 33) o.value = o.value.substring(0, o.value.length - 1) } function Submit(f) { if (f.account_to) { trim(f.account_to); } var msg = ''; if (f.account_to && !f.account_to.value && (!f.acct_to_id || s_val(f.acct_to_id) == 0)) { msg += 'Destination account\n' } if (f.email && !f.email.value) { msg += 'Your E-mail\n' } if (f.amount_from.value == 0 && f.amount_to.value == 0) { msg += 'Amount to spend or to receive\n' } if (msg != '') { alert('Please fill out the following mandatory fields:\n\n' + msg) return false } if (f.email && !f.email.value.match("^[a-zA-Z][-_.a-zA-Z0-9]*@[a-zA-Z0-9][-.a-zA-Z0-9]+\.[a-zA-Z]{2,5}$")) { msg += 'Invalid email address\n' } if (f.account_to && f.account_to.value && f.acct_to_id && s_val(f.acct_to_id) > 0) { msg += 'Either select an account, or key it in. Not both.\n'; } if (f.account_to && f.account_to.value && !f.account_to.value.match(ValidRegex[s_val(f.PS_to)])) { msg += 'Invalid destination account\n'; } if (f.amount_from && f.amount_from.value > 9999999.99 || f.amount_to && f.amount_to.value > 9999999.99) { msg += 'Neither amount can exceed 9999999.99\n'; } if (f.PS_from && f.PS_to && s_val(f.PS_from) == s_val(f.PS_to)) { msg += 'We do not know how you did it - but we do not allow money laundry. Exchange currencies should differ.\n'; } if (msg != '') { alert('Cannot accept submitted data. Please correct errors and re-submit the form.\n\n'+msg); return false; } return true; } function SetRate(f) { var margin = GetMargin(s_val(f.PS_from), s_val(f.PS_to)); if (margin > 99) { document.getElementById('rate1').childNodes[0].nodeValue = "Sorry, we don't currently convert " + CNames[s_val(f.PS_from)] + ' to ' + CNames[s_val(f.PS_to)]; } else { var sum = f.amount_from.value; var t = DirectCalc(f, sum, margin); if (t <= 0) { if (s_val(f.PS_from) == 1) { sum = 100; } else { sum = 1000; } t = ToUE(s_val(f.PS_from), DirectCalc(f, (FromUE(s_val(f.PS_from), sum, 0, 0, 0)), margin), 0, 0, 0); } var from = 1; var to = 1; t /= sum; if (t > 0.5) { to = Math.round(t*10000)/10000; } else { from = Math.round(10000/t)/10000; } document.getElementById('rate1').childNodes[0].nodeValue = from + ' ' + CNames[s_val(f.PS_from)] + ' = ' + to + ' ' + CNames[s_val(f.PS_to)]; } } var CNames = {5: 'E-Gold', 7: 'YM not supported more', 2: 'WMZ', 3: 'WMR', 4: 'WME', 11: 'WMU', 27: 'WMY', 30: 'WMB', 8: 'Pecunix (USD)', 23: 'CapitalCollect', 9: 'E-bullion (Gold)', 12: 'E-bullion (e-Currency)', 10: '1mdc (USD)', 19: 'MoneyMail RUR', 20: 'MoneyMail USD', 21: 'MoneyMail EUR', 6: 'Goldmoney', 29: 'Rapida RUR', 13: 'Exchengine', 35: 'Yandex.Money', 32: 'EDram', 34: 'Fethard'}; var ValidRegex = {5: '^[0-9]{4,7}$', 7: '^[0-9]{12,14}$', 2: '^[Zz][0-9]{12}$', 3: '^[Rr][0-9]{12}$', 4: '^[Ee][0-9]{12}$', 11: '^[Uu][0-9]{12}$', 27: '^[Yy][0-9]{12}$', 30: '^[Bb][0-9]{12}$', 8: '^[a-zA-Z][-_.a-zA-Z0-9]*@[a-zA-Z0-9][-.a-zA-Z0-9]+.[a-zA-Z]{2,5}$', 23: '^[0-9]{1,19}$', 9: '^[A-Za-z][0-9]{5}$', 12: '^[A-Za-z][0-9]{5}$', 10: '^[0-9]+ [a-z]+$', 19: '^[0-9a-zA-Z][-_.a-zA-Z0-9]*@[a-zA-Z0-9][-.a-zA-Z0-9]+\.[a-zA-Z]{2,5}$', 20: '^[0-9a-zA-Z][-_.a-zA-Z0-9]*@[a-zA-Z0-9][-.a-zA-Z0-9]+\.[a-zA-Z]{2,5}$', 21: '^[0-9a-zA-Z][-_.a-zA-Z0-9]*@[a-zA-Z0-9][-.a-zA-Z0-9]+\.[a-zA-Z]{2,5}$', 6: '^[0-9]{2}-[0-9]{2}-[0-9]{2}-[A-Z]$', 29: '^[0-9]{1,10}$', 13: '^[a-zA-Z][-_.a-zA-Z0-9]*\@[a-zA-Z0-9][-.a-zA-Z0-9]+\.[a-zA-Z]{2,5}$', 35: '^[0-9]{10,16}$', 32: '^[0-9]{9}$', 34: '^[a-zA-Z]0[0-9]{5}$'}; var AccExamples = {5: '', 7: '4100160369057', 2: '', 3: '', 4: '', 11: '', 27: 'Y232289208368', 30: 'B189695509215', 8: '', 23: '7557879', 9: '', 12: '', 10: '123456 john', 19: '', 20: '', 21: '', 6: '', 29: '855102', 13: 'support@exchengine.com', 35: '41001116339950', 32: '', 34: ''}; var IncomingLimit = {5: '47007455', 7: '738681277', 2: '791127450', 3: '1405083869', 4: '52471731', 11: '7048604', 27: '1304810312', 30: '338073834', 8: '96948643', 23: '-1', 9: '-43411', 12: '-180911', 10: '-9958528', 19: '32143482', 20: '105687', 21: '99998', 6: '100000', 29: '0', 13: '-1003758', 35: '5555544', 32: '29056715', 34: '999102'}; var Balance = {5: '542', 7: '210', 2: '13296', 3: '5111', 4: '331', 11: '2295', 27: '46854', 30: '134456', 8: '2', 23: '23', 9: '-1000000', 12: '-2000000', 10: '-2000000', 19: '12140', 20: '0', 21: '0', 6: '0', 29: '0', 13: '220', 35: '12', 32: '24235', 34: '93'}; var Rates = {5: [1.0000, 0], 7: [25.7760, 1], 2: [1.0000, 0], 3: [25.7760, 1], 4: [1.3565, 0], 11: [5.0619, 1], 27: [1248.3800, 1], 30: [2148.5000, 1], 8: [1.0000, 0], 23: [0.0000, 0], 9: [0.0000, 0], 12: [0.0000, 0], 10: [0.0000, 0], 19: [25.7760, 1], 20: [1.0000, 0], 21: [1.3565, 0], 6: [0.0000, 0], 29: [25.7760, 1], 13: [1.0000, 0], 35: [25.7760, 1], 32: [355.0000, 1], 34: [1.0000, 0]}; var Fees = {5: [0.20, 1.00, 1.25, 0.00, 0.01, 0.00], 7: [0.00, 2.00, 999999.00, 0.00, 0.50, 0.00], 2: [0.00, 0.00, 0.00, 0.01, 0.80, 50.00], 3: [0.00, 0.00, 0.00, 0.01, 0.80, 1500.00], 4: [0.00, 0.00, 0.00, 0.01, 0.80, 50.00], 11: [0.00, 0.00, 0.00, 0.01, 0.80, 250.00], 27: [0.00, 0.00, 0.00, 1.00, 0.80, 4500.00], 30: [0.00, 0.00, 0.00, 0.00, 0.80, 0.00], 8: [0.00, 0.00, 0.00, 0.01, 0.50, 50.00], 23: [0.00, 0.01, 0.00, 0.00, 0.01, 0.00], 9: [0.00, 0.00, 0.00, 0.00, 0.00, 0.00], 12: [0.00, 0.00, 0.00, 0.00, 0.00, 0.00], 10: [0.00, 0.00, 0.00, 0.00, 0.00, 0.00], 19: [1.00, 2.00, 10000.00, 0.00, 0.01, 0.00], 20: [0.05, 2.00, 10000.00, 0.00, 0.01, 0.00], 21: [0.05, 2.00, 10000.00, 0.00, 0.01, 0.00], 6: [0.00, 0.00, 0.00, 0.00, 0.00, 0.00], 29: [0.00, 0.00, 0.00, 5.00, 0.01, 5.00], 13: [0.00, 0.00, 0.00, 0.00, 0.00, 0.00], 35: [0.01, 0.50, 0.00, 0.00, 0.00, 0.00], 32: [1.00, 2.00, 999999.00, 0.00, 0.01, 0.00], 34: [0.50, 0.01, 99999.00, 0.50, 0.01, 99999.00]}; var Down = {7: 1, 23: 1, 9: 1, 12: 1, 10: 1, 6: 1, 35: 1}; var Margins = {35: {35: 0.00, 11: 6.00, 32: 5.00, 21: 6.00, 7: 100.00, 2: 6.00, 30: 3.00, 23: 0.00, 13: 100.00, 29: 5.00, 6: 0.00, 27: 2.00, 3: 4.50, 9: 0.00, 12: 0.00, 20: 6.00, 8: 5.00, 4: 6.50, 34: 5.00, 10: 0.00, 19: 5.00, 5: 5.00}, 11: {35: 2.00, 11: 0.00, 32: 7.00, 21: 8.00, 7: 2.80, 2: 6.00, 30: 6.00, 23: 0.00, 13: 100.00, 29: 6.00, 6: 0.00, 27: 4.00, 3: 3.72, 9: 0.00, 12: 0.00, 20: 7.95, 8: 8.00, 4: 3.50, 34: 3.00, 10: 0.00, 19: 11.00, 5: 3.00}, 32: {35: 5.00, 11: 10.00, 32: 0.00, 21: 10.00, 7: 5.50, 2: 5.50, 30: 10.00, 23: 0.00, 13: 100.00, 29: 10.00, 6: 0.00, 27: 10.00, 3: 6.00, 9: 0.00, 12: 0.00, 20: 10.00, 8: 10.00, 4: 8.50, 34: 0.00, 10: 0.00, 19: 10.00, 5: 3.00}, 21: {35: 4.00, 11: 6.50, 32: 5.00, 21: 0.00, 7: 2.00, 2: 8.50, 30: 0.00, 23: 0.00, 13: 100.00, 29: 5.00, 6: 0.00, 27: 0.00, 3: 4.00, 9: 0.00, 12: 0.00, 20: 2.00, 8: 7.00, 4: 10.00, 34: 5.00, 10: 0.00, 19: 2.00, 5: 13.00}, 7: {35: 100.00, 11: 100.00, 32: 100.00, 21: 100.00, 7: 0.00, 2: 100.00, 30: 100.00, 23: 0.00, 13: 100.00, 29: 100.00, 6: 0.00, 27: 100.00, 3: 100.00, 9: 0.00, 12: 0.00, 20: 100.00, 8: 100.00, 4: 100.00, 34: 100.00, 10: 0.00, 19: 100.00, 5: 100.00}, 2: {35: 0.00, 11: 2.00, 32: 3.50, 21: 7.00, 7: 0.00, 2: 0.00, 30: 2.00, 23: 0.00, 13: 100.00, 29: 2.00, 6: 0.00, 27: 0.00, 3: 0.50, 9: 0.00, 12: 0.00, 20: 3.00, 8: 6.50, 4: 1.05, 34: 0.00, 10: 0.00, 19: 5.65, 5: 0.50}, 30: {35: 3.00, 11: 4.50, 32: 4.00, 21: 8.00, 7: 5.00, 2: 4.00, 30: 0.00, 13: 100.00, 23: 0.00, 29: 8.00, 6: 0.00, 27: 0.00, 3: 3.00, 9: 0.00, 12: 0.00, 20: 6.00, 8: 6.00, 4: 6.00, 34: 10.00, 19: 8.00, 10: 0.00, 5: 4.00}, 23: {35: 0.00, 11: 0.00, 32: 0.00, 21: 0.00, 7: 0.00, 2: 0.00, 30: 0.00, 23: 0.00, 13: 0.00, 29: 0.00, 6: 0.00, 27: 0.00, 3: 0.00, 9: 0.00, 12: 0.00, 20: 0.00, 8: 0.00, 4: 0.00, 34: 0.00, 10: 0.00, 19: 0.00, 5: 0.00}, 13: {35: 0.00, 11: 0.00, 32: 0.00, 21: 0.00, 7: 0.00, 2: 0.00, 30: 0.00, 23: 0.00, 13: 0.00, 29: 0.00, 6: 0.00, 27: 0.00, 3: 0.00, 9: 0.00, 12: 0.00, 20: 0.00, 8: 0.00, 4: 0.00, 34: 0.00, 10: 0.00, 19: 0.00, 5: 0.00}, 29: {35: 100.00, 11: 100.00, 32: 100.00, 21: 100.00, 7: 100.00, 2: 100.00, 30: 100.00, 13: 100.00, 23: 0.00, 29: 0.00, 6: 0.00, 27: 100.00, 3: 100.00, 9: 0.00, 12: 0.00, 20: 100.00, 8: 100.00, 4: 100.00, 34: 100.00, 19: 100.00, 10: 0.00, 5: 100.00}, 27: {35: 10.00, 11: 10.00, 32: 7.00, 21: 20.00, 7: 12.00, 2: 15.00, 30: 15.00, 23: 0.00, 13: 100.00, 29: 20.00, 6: 0.00, 27: 0.00, 3: 10.00, 9: 0.00, 12: 0.00, 20: 20.00, 8: 25.00, 4: 15.00, 34: 10.00, 10: 0.00, 19: 20.00, 5: 15.00}, 6: {35: 0.00, 11: 0.00, 32: 0.00, 21: 0.00, 7: 0.00, 2: 0.00, 30: 0.00, 23: 0.00, 13: 0.00, 29: 0.00, 6: 0.00, 27: 0.00, 3: 0.00, 9: 0.00, 12: 0.00, 20: 0.00, 8: 0.00, 4: 0.00, 34: 0.00, 10: 0.00, 19: 0.00, 5: 0.00}, 3: {35: 1.00, 11: 3.60, 32: 5.00, 21: 7.00, 7: 0.00, 2: 2.50, 30: 2.50, 23: 0.00, 13: 100.00, 29: 4.00, 6: 0.00, 27: 0.50, 3: 0.00, 9: 0.00, 12: 0.00, 20: 3.50, 8: 8.40, 4: 4.55, 34: 2.00, 10: 0.00, 19: 8.85, 5: 2.50}, 9: {35: 0.00, 11: 0.00, 32: 0.00, 21: 0.00, 7: 0.00, 2: 0.00, 30: 0.00, 23: 0.00, 13: 0.00, 29: 0.00, 6: 0.00, 27: 0.00, 3: 0.00, 9: 0.00, 12: 0.00, 20: 0.00, 8: 0.00, 4: 0.00, 34: 0.00, 10: 0.00, 19: 0.00, 5: 0.00}, 12: {35: 0.00, 11: 0.00, 32: 0.00, 21: 0.00, 7: 0.00, 2: 0.00, 30: 0.00, 23: 0.00, 13: 0.00, 29: 0.00, 6: 0.00, 27: 0.00, 3: 0.00, 9: 0.00, 12: 0.00, 20: 0.00, 8: 0.00, 4: 0.00, 34: 0.00, 10: 0.00, 19: 0.00, 5: 0.00}, 20: {35: 3.00, 11: 3.40, 32: 5.00, 21: 2.00, 7: 1.15, 2: 6.85, 30: 2.00, 23: 0.00, 13: 100.00, 29: 6.00, 27: 0.00, 6: 0.00, 3: 0.65, 9: 0.00, 12: 0.00, 20: 0.00, 8: 7.00, 4: 6.50, 34: 5.00, 19: 2.00, 10: 0.00, 5: 4.10}, 8: {35: 2.00, 11: 5.80, 32: 5.00, 21: 9.00, 7: 1.50, 2: 8.50, 30: 4.00, 13: 100.00, 23: 0.00, 29: 8.00, 6: 0.00, 27: 5.00, 3: 4.00, 9: 0.00, 12: 0.00, 20: 8.00, 8: 0.00, 4: 5.30, 34: 4.00, 19: 6.75, 10: 0.00, 5: 2.00}, 4: {35: 1.00, 11: 2.55, 32: 4.00, 21: 7.00, 7: 0.50, 2: 6.75, 30: 2.50, 13: 100.00, 23: 0.00, 29: 4.00, 6: 0.00, 27: 2.00, 3: 3.00, 9: 0.00, 12: 0.00, 20: 3.50, 8: 4.00, 4: 0.00, 34: 3.00, 19: 4.98, 10: 0.00, 5: 3.00}, 34: {35: 5.00, 11: 4.00, 32: 5.00, 21: 5.00, 7: 2.00, 2: 3.00, 30: 5.00, 23: 0.00, 13: 100.00, 29: 3.00, 6: 0.00, 27: 1.00, 3: 2.50, 9: 0.00, 12: 0.00, 20: 5.00, 8: 3.00, 4: 6.00, 34: 0.00, 10: 0.00, 19: 4.00, 5: 2.00}, 10: {35: 0.00, 11: 0.00, 32: 0.00, 21: 0.00, 7: 0.00, 2: 0.00, 30: 0.00, 23: 0.00, 13: 0.00, 29: 0.00, 6: 0.00, 27: 0.00, 3: 0.00, 9: 0.00, 12: 0.00, 20: 0.00, 8: 0.00, 4: 0.00, 34: 0.00, 10: 0.00, 19: 0.00, 5: 0.00}, 19: {35: 2.00, 11: 6.29, 32: 5.00, 21: 2.00, 7: 0.00, 2: 4.65, 30: 2.00, 13: 100.00, 23: 0.00, 29: 6.00, 6: 0.00, 27: 0.00, 3: 1.30, 9: 0.00, 12: 0.00, 20: 2.00, 8: 7.91, 4: 5.70, 34: 5.00, 19: 0.00, 10: 0.00, 5: 1.65}, 5: {35: 2.00, 11: 7.10, 32: 6.00, 21: 8.00, 7: 4.00, 2: 1.50, 30: 4.00, 13: 100.00, 23: 0.00, 29: 7.00, 6: 0.00, 27: 2.00, 3: 3.00, 9: 0.00, 12: 0.00, 20: 8.00, 8: 4.50, 4: 8.00, 34: 2.00, 19: 7.40, 10: 0.00, 5: 0.00}}; var all_from = new Array(32, 11, 21, 2, 30, 27, 3, 20, 8, 4, 19, 5); var all_to = new Array(32, 11, 2, 30, 27, 3, 8, 4, 19, 5); function get_currency_lists() { var FromElement = document.getElementById('FromSelect'); FromElement.innerHTML = ""; var ToElement = document.getElementById('ToSelect'); ToElement.innerHTML = ""; } function FormInit(f, mode, is_pristine) { if (s_val(f.PS_to) > 0 || s_val(f.PS_from) > 0) { is_pristine = 0; } if(f.acct_to_id && f.acct_to_id.value.length > 0) { f.acct_to_id.selectedIndex = f.acct_to_id.length-1; } f.dir.value = 'from'; FilterPS(f, 'from') f.dir.value = 'to'; FilterPS(f, 'to'); f.amount_from.value = 0; f.amount_to.value = 0; ResetPS(f, 'from'); ResetPS(f, 'to'); if (s_val(f.PS_from) == s_val(f.PS_to)) f.PS_to.selectedIndex = (f.PS_to.selectedIndex) ? 0 : 1; Recalculate(f); } get_currency_lists(); FormInit(document.getElementById('xchg'), 'exchange', 1);