// Javascript to generate iframe, check user key is valid var f = check_valid_oanda_link(); var iframe_source = document.location.protocol + "//www.oanda.com/embedded/converter/show/a2Vlc2tpc3QvL2RlZmF1bHQ=/" + f + "/de/"; var iframe_style = "width: 300px; height: 250px; border:0px solid #ffffff; display:block;"; var ifrm = document.createElement('iframe'); ifrm.setAttribute('src', iframe_source); ifrm.setAttribute('style', iframe_style); ifrm.setAttribute('scrolling', 'no'); ifrm.setAttribute('width', '300'); ifrm.setAttribute('height', '250'); ifrm.setAttribute('frameBorder', '0'); var cc_link = document.getElementById('oanda_cc_link'); var ecc_div = document.getElementById('oanda_ecc'); if (cc_link){ ecc_div.insertBefore(ifrm, ecc_div.firstChild); } else { document.getElementById('oanda_ecc').appendChild(ifrm); } function check_valid_oanda_link(){ var link2 = document.getElementById('oanda_cc_link'); if ((typeof link2 === "undefined") || (link2 == null) || (/https?\:\/\/www\.oanda\.com(\/lang\/[A-Za-z]{2})?\/currency\/converter|https?:\/\/fxtrade\.oanda\.com/.exec(link2.href) == null)) { return 1; } else { return 0; } }