$(document).ready(function() {
var lisel = 'eurusd';
function restart(){
	var url = 'http://quotes.systemforex.net/quotes.php';
	
    $.getJSON(url + '?callback=?', function(data) {
      $('#dictionary').empty();
      $.each(data, function(entryIndex, entry) {
        var html = '<li id="';
		html += entry['symbol'] + '"';
		if(lisel == entry['symbol']) {html += 'class="cotip_left_act"';}
		html += '>';
        html += '<span class="';
		html += entry['updown'];
		html += '">';
		html += entry['symbol'] + '</span>';
		html += '<span>' + entry['bid'] + '</span>';
        html += '<span>' + entry['ask'] + '</span>';
        html += '</li>';
        $('#dictionary').append(html);
      });
	  $('#dictionary li').click(function() {
		 var liid = $(this).attr("id");
		 lisel = liid;
		 var obj = document.getElementById("img");
		 obj.src = '/dat/charts/'+lisel+'15_280x150x4.gif';
		 $('#dictionary li').removeClass();
		 $(this).addClass('cotip_left_act');
		  return false;
	  });
    });
}

	restart();
	setInterval(restart,15000);
});

