var lastTQId;
var TQTimer;
var TQCurrencies;
if (TQCurrencies == null) {TQCurrencies = new Array();}
function SendAjaxTQ()
{
  if (lastTQId != null)
  {
    try
    {
      document.getElementsByTagName("head").item(0).removeChild(document.getElementById(lastTQId));
    }
    catch(e)
    {
      document.body.removeChild(document.getElementById(lastTQId));
    }
  }
  var str = new Array();
  for(l=0;l<TQCurrencies.length;l++)
  {
    str.push(TQCurrencies[l][0])
  }
  var dt = new Date();
  lastTQId = "JSONTQ"+Math.floor(dt.getTime()/1000);
  var JSONscript = document.createElement("script");
  JSONscript.setAttribute("type","text/javascript");
  JSONscript.setAttribute("src","http://www.tradingtoolsonline.com/Ajax.aspx?dat="+lastTQId+"&cmd=!TABLEQUOT!&currency="+str.join(',')+"&lang=en");
  JSONscript.setAttribute("id",lastTQId);
  try
  {
    document.getElementsByTagName("head").item(0).appendChild(JSONscript);
  }
  catch(e)
  {
    document.body.appendChild(JSONscript);
  }
}
function RegisterCurrency(currency, toolId)
{
  var done = false;
  for(k = 0; k < TQCurrencies.length;k++)
  {
    if(TQCurrencies[k][0] == currency)
    {
      TQCurrencies[k][1].push(toolId);
      var done = true;
    }
  }
  if(!done)
  {
    var row = new Array();
    row[0] = currency;
    row[1] = new Array();
    row[1].push(toolId);
    TQCurrencies.push(row)
  }
}
function ACMExecuteTQCallback(currency, bid, ask, bidF, askF, trend, high, low, change, changeF, rate, spread, spreadF, date)
{
  for(k = 0; k < TQCurrencies.length;k++)
  {
    if(TQCurrencies[k][0] == currency)
    {
      for(m = 0; m < TQCurrencies.length;m++)
      {
        var bobj = document.getElementById('b'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(bobj != null) { bobj.innerHTML = bid };
        var aobj = document.getElementById('a'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(aobj != null) { aobj.innerHTML = ask };
        var bfobj = document.getElementById('bf'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(bfobj != null) { bfobj.innerHTML = bidF };
        var afobj = document.getElementById('af'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(afobj != null) { afobj.innerHTML = askF };
        var tobj = document.getElementById('t'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(tobj != null) { tobj.innerHTML = trend };
        var hobj = document.getElementById('h'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(hobj != null) { hobj.innerHTML = high };
        var lobj = document.getElementById('l'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(lobj != null) { lobj.innerHTML = low };
        var chobj = document.getElementById('ch'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(chobj != null) { chobj.innerHTML = change };
        var chfobj = document.getElementById('chf'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(chfobj != null) { chfobj.innerHTML = changeF };
        var robj = document.getElementById('r'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(robj != null) { robj.innerHTML = rate };
        var sobj = document.getElementById('s'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(sobj != null) { sobj.innerHTML = spread };
        var sfobj = document.getElementById('sf'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(sfobj != null) { sfobj.innerHTML = spreadF };
        var dobj = document.getElementById('d'+TQCurrencies[k][0]+TQCurrencies[k][1][m]);
        if(dobj != null) { dobj.innerHTML = date };
      }
    }
  }
}
var ACMToolLink = document.getElementById("ACMLink");
if (ACMToolLink != null && ( ACMToolLink.innerHTML == "Forex" || ACMToolLink.innerHTML == "Forex Trading" || ACMToolLink.innerHTML == "Currency Trading" ) && ACMToolLink.href.match(/^http:\/\/((www)|(ar)|(cn)|(de)|(es)|(fa)|(fr)|(gr)|(it)|(jp)|(pt)|(ru)|(tr)).(ac-markets|acmusa).com/) && ACMToolLink.tagName=='A'){
var linksTab = new Array();
for(s=0;s<document.getElementsByTagName("A").length;s++){
  var myLink = document.getElementsByTagName("A")[s];
  if(myLink.id == "ACMLink") {
    myLink.style.display = 'none';
  }
}
function ACMShowCode(toolId)
{
  document.getElementById('ACMToolBodyRow'+toolId).style.display = 'none';
  document.getElementById('ACMToolOptRow'+toolId).style.display = '';
}
function ACMHideCode(toolId)
{
  document.getElementById('ACMToolBodyRow'+toolId).style.display = '';
  document.getElementById('ACMToolOptRow'+toolId).style.display = 'none';
}
function ACMCopyCode(textID)
{
  Copied = document.getElementById(textID).createTextRange();
  Copied.execCommand('Copy');
}
function ACMExecuteJSONinnerHTML(JSONRef, ElementID, innerHTML)
{
  var obj = document.getElementById(ElementID+JSONRef);
  if (obj != null)
  {
    obj.innerHTML = innerHTML;
  }
}
  var wtoolCSS = document.createElement("link");
  wtoolCSS.setAttribute("type","text/css");
  wtoolCSS.setAttribute("href","http://www.tradingtoolsonline.com/themes/blank.css");
  wtoolCSS.setAttribute("rel","stylesheet");
    document.getElementsByTagName("head").item(0).appendChild(wtoolCSS);
document.write("<div class='wtool_blank'>    <table class='webtoolMainTable' cellspacing='0' cellpadding='0' style='width:180px;'>        <tr class='webToolHeadRow'>            <td class='webToolLeftHead'></td>            <td class='webToolMidHead'></td>            <td class='webToolRightHead'></td>        </tr>        <tr class='webToolBodyRow' id='ACMToolBodyRow87d6f5c0'>            <td class='webToolLeftBody'></td>            <td class='webToolMidBody'><table cellspacing=0 cellpadding=1 class='webToolTQTable'>  <tr class='webToolHeaderRow'>    <td>Currency</td>    <td>Bid</td>    <td>Ask</td>  </tr>  <tr>    <th id='cAUDJPY87d6f5c0'>AUDJPY</th>    <td id='bAUDJPY87d6f5c0'>       --- </td>    <td id='aAUDJPY87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cAUDUSD87d6f5c0'>AUDUSD</th>    <td id='bAUDUSD87d6f5c0'>       --- </td>    <td id='aAUDUSD87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cCADJPY87d6f5c0'>CADJPY</th>    <td id='bCADJPY87d6f5c0'>       --- </td>    <td id='aCADJPY87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cCHFDKK87d6f5c0'>CHFDKK</th>    <td id='bCHFDKK87d6f5c0'>       --- </td>    <td id='aCHFDKK87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cCHFNOK87d6f5c0'>CHFNOK</th>    <td id='bCHFNOK87d6f5c0'>       --- </td>    <td id='aCHFNOK87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cCHFSEK87d6f5c0'>CHFSEK</th>    <td id='bCHFSEK87d6f5c0'>       --- </td>    <td id='aCHFSEK87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cDKKSEK87d6f5c0'>DKKSEK</th>    <td id='bDKKSEK87d6f5c0'>       --- </td>    <td id='aDKKSEK87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cEURCAD87d6f5c0'>EURCAD</th>    <td id='bEURCAD87d6f5c0'>       --- </td>    <td id='aEURCAD87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cEURCHF87d6f5c0'>EURCHF</th>    <td id='bEURCHF87d6f5c0'>       --- </td>    <td id='aEURCHF87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cEURDKK87d6f5c0'>EURDKK</th>    <td id='bEURDKK87d6f5c0'>       --- </td>    <td id='aEURDKK87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cEURGBP87d6f5c0'>EURGBP</th>    <td id='bEURGBP87d6f5c0'>       --- </td>    <td id='aEURGBP87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cEURJPY87d6f5c0'>EURJPY</th>    <td id='bEURJPY87d6f5c0'>       --- </td>    <td id='aEURJPY87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cEURNOK87d6f5c0'>EURNOK</th>    <td id='bEURNOK87d6f5c0'>       --- </td>    <td id='aEURNOK87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cEURPLN87d6f5c0'>EURPLN</th>    <td id='bEURPLN87d6f5c0'>       --- </td>    <td id='aEURPLN87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cEURSEK87d6f5c0'>EURSEK</th>    <td id='bEURSEK87d6f5c0'>       --- </td>    <td id='aEURSEK87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cEURTRY87d6f5c0'>EURTRY</th>    <td id='bEURTRY87d6f5c0'>       --- </td>    <td id='aEURTRY87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cEURUSD87d6f5c0'>EURUSD</th>    <td id='bEURUSD87d6f5c0'>       --- </td>    <td id='aEURUSD87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cGBPCAD87d6f5c0'>GBPCAD</th>    <td id='bGBPCAD87d6f5c0'>       --- </td>    <td id='aGBPCAD87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cGBPCHF87d6f5c0'>GBPCHF</th>    <td id='bGBPCHF87d6f5c0'>       --- </td>    <td id='aGBPCHF87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cGBPDKK87d6f5c0'>GBPDKK</th>    <td id='bGBPDKK87d6f5c0'>       --- </td>    <td id='aGBPDKK87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cGBPJPY87d6f5c0'>GBPJPY</th>    <td id='bGBPJPY87d6f5c0'>       --- </td>    <td id='aGBPJPY87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cGBPNOK87d6f5c0'>GBPNOK</th>    <td id='bGBPNOK87d6f5c0'>       --- </td>    <td id='aGBPNOK87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cGBPSEK87d6f5c0'>GBPSEK</th>    <td id='bGBPSEK87d6f5c0'>       --- </td>    <td id='aGBPSEK87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cGBPUSD87d6f5c0'>GBPUSD</th>    <td id='bGBPUSD87d6f5c0'>       --- </td>    <td id='aGBPUSD87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cNOKSEK87d6f5c0'>NOKSEK</th>    <td id='bNOKSEK87d6f5c0'>       --- </td>    <td id='aNOKSEK87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cNZDJPY87d6f5c0'>NZDJPY</th>    <td id='bNZDJPY87d6f5c0'>       --- </td>    <td id='aNZDJPY87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cNZDUSD87d6f5c0'>NZDUSD</th>    <td id='bNZDUSD87d6f5c0'>       --- </td>    <td id='aNZDUSD87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cUSDCAD87d6f5c0'>USDCAD</th>    <td id='bUSDCAD87d6f5c0'>       --- </td>    <td id='aUSDCAD87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cUSDCHF87d6f5c0'>USDCHF</th>    <td id='bUSDCHF87d6f5c0'>       --- </td>    <td id='aUSDCHF87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cUSDDKK87d6f5c0'>USDDKK</th>    <td id='bUSDDKK87d6f5c0'>       --- </td>    <td id='aUSDDKK87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cUSDHKD87d6f5c0'>USDHKD</th>    <td id='bUSDHKD87d6f5c0'>       --- </td>    <td id='aUSDHKD87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cUSDJPY87d6f5c0'>USDJPY</th>    <td id='bUSDJPY87d6f5c0'>       --- </td>    <td id='aUSDJPY87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cUSDMXN87d6f5c0'>USDMXN</th>    <td id='bUSDMXN87d6f5c0'>       --- </td>    <td id='aUSDMXN87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cUSDNOK87d6f5c0'>USDNOK</th>    <td id='bUSDNOK87d6f5c0'>       --- </td>    <td id='aUSDNOK87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cUSDPLN87d6f5c0'>USDPLN</th>    <td id='bUSDPLN87d6f5c0'>       --- </td>    <td id='aUSDPLN87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cUSDSEK87d6f5c0'>USDSEK</th>    <td id='bUSDSEK87d6f5c0'>       --- </td>    <td id='aUSDSEK87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cUSDSGD87d6f5c0'>USDSGD</th>    <td id='bUSDSGD87d6f5c0'>       --- </td>    <td id='aUSDSGD87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cUSDTRY87d6f5c0'>USDTRY</th>    <td id='bUSDTRY87d6f5c0'>       --- </td>    <td id='aUSDTRY87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cUSDZAR87d6f5c0'>USDZAR</th>    <td id='bUSDZAR87d6f5c0'>       --- </td>    <td id='aUSDZAR87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='cXAGUSD87d6f5c0'>XAGUSD</th>    <td id='bXAGUSD87d6f5c0'>       --- </td>    <td id='aXAGUSD87d6f5c0'>       --- </td>  </tr>  <tr>    <th id='cXAUUSD87d6f5c0'>XAUUSD</th>    <td id='bXAUUSD87d6f5c0'>       --- </td>    <td id='aXAUUSD87d6f5c0'>       --- </td>  </tr>  <tr class='webtoolToggleRow'>    <th id='c87d6f5c0'></th>    <td id='b87d6f5c0'>       --- </td>    <td id='a87d6f5c0'>       --- </td>  </tr></table></td>            <td class='webToolRightBody'></td>        </tr>        <tr class='webToolOptRow' id='ACMToolOptRow87d6f5c0' style='display:none;'>            <td class='webToolLeftOpt'></td>            <td class='webToolMidOpt'><table id='ACMCodeTQ'><tr><td><span class='webToolPutCode'>Put this code on your website:</span></td></tr><tr><td><textarea cols='21' rows='3' id='ACMText87d6f5c0' class='webToolCode' ><!--script parameters: design=true|false : designed or simple component | currency=EURUSD,GBPUSD,USDCHF,USDJPY type the ACM currency pairs you want | width=180 : set the width of your tool (not for designed mode)--> <a href='http://www.ac-markets.com' id='ACMLink'>Forex Trading</a> <script language='javascript' src='http://www.tradingtoolsonline.com/tablequote-script.aspx?design=true&amp;currency=EURUSD,GBPUSD,USDCHF,USDJPY' type='text/javascript'> </script> </textarea></td></tr><tr><td><input type='button' value='Copy to clipboard' onclick='ACMCopyCode(\"ACMText87d6f5c0\")' class='webToolCopy' /> <input type='button' value='Close' onclick='ACMHideCode(\"87d6f5c0\")'  class='webToolClose'/></td></tr></table></td>            <td class='webToolRightOpt'></td>        </tr>        <tr class='webToolLinkRow'>            <td class='webToolLeftLink'></td>            <td class='webToolMidLink'><a href='http://www.ac-markets.com' target='_parent'>www.ac-markets.com</a></td>            <td class='webToolRightLink'></td>        </tr>        <tr class='webToolAddRow'>            <td class='webToolLeftAdd'></td>            <td class='webToolMidAdd'><a onclick='ACMShowCode(\"87d6f5c0\")'>Add to your site</a></td>            <td class='webToolRightAdd'></td>        </tr>    </table></div>");RegisterCurrency('AUDJPY', '87d6f5c0');
RegisterCurrency('AUDUSD', '87d6f5c0');
RegisterCurrency('CADJPY', '87d6f5c0');
RegisterCurrency('CHFDKK', '87d6f5c0');
RegisterCurrency('CHFNOK', '87d6f5c0');
RegisterCurrency('CHFSEK', '87d6f5c0');
RegisterCurrency('DKKSEK', '87d6f5c0');
RegisterCurrency('EURCAD', '87d6f5c0');
RegisterCurrency('EURCHF', '87d6f5c0');
RegisterCurrency('EURDKK', '87d6f5c0');
RegisterCurrency('EURGBP', '87d6f5c0');
RegisterCurrency('EURJPY', '87d6f5c0');
RegisterCurrency('EURNOK', '87d6f5c0');
RegisterCurrency('EURPLN', '87d6f5c0');
RegisterCurrency('EURSEK', '87d6f5c0');
RegisterCurrency('EURTRY', '87d6f5c0');
RegisterCurrency('EURUSD', '87d6f5c0');
RegisterCurrency('GBPCAD', '87d6f5c0');
RegisterCurrency('GBPCHF', '87d6f5c0');
RegisterCurrency('GBPDKK', '87d6f5c0');
RegisterCurrency('GBPJPY', '87d6f5c0');
RegisterCurrency('GBPNOK', '87d6f5c0');
RegisterCurrency('GBPSEK', '87d6f5c0');
RegisterCurrency('GBPUSD', '87d6f5c0');
RegisterCurrency('NOKSEK', '87d6f5c0');
RegisterCurrency('NZDJPY', '87d6f5c0');
RegisterCurrency('NZDUSD', '87d6f5c0');
RegisterCurrency('USDCAD', '87d6f5c0');
RegisterCurrency('USDCHF', '87d6f5c0');
RegisterCurrency('USDDKK', '87d6f5c0');
RegisterCurrency('USDHKD', '87d6f5c0');
RegisterCurrency('USDJPY', '87d6f5c0');
RegisterCurrency('USDMXN', '87d6f5c0');
RegisterCurrency('USDNOK', '87d6f5c0');
RegisterCurrency('USDPLN', '87d6f5c0');
RegisterCurrency('USDSEK', '87d6f5c0');
RegisterCurrency('USDSGD', '87d6f5c0');
RegisterCurrency('USDTRY', '87d6f5c0');
RegisterCurrency('USDZAR', '87d6f5c0');
RegisterCurrency('XAGUSD', '87d6f5c0');
RegisterCurrency('XAUUSD', '87d6f5c0');
RegisterCurrency('', '87d6f5c0');
clearTimeout(TQTimer);
TQTimer = setTimeout('SendAjaxTQ()',100);
}