// Function to allow one JavaScript file to be included by another.
// Copyright (C) 2006-08 www.cryer.co.uk
function IncludeJavaScript(jsFile) {
  document.write('<script type="text/javascript" src="' + jsFile + '"></scr' + 'ipt>');
}

/* Load jQuery */
google.load("jquery", "1");
google.setOnLoadCallback(function() {
  $('#home-topics-content').load('/trends/current/');
});

var net_check = 'TRUE';
function do_net_check() {
  $.ajax({
    type: "GET",
    url: "/home/net_check123/",
    success: function(data) {
      net_check = 'TRUE';
      $('#message-box').fadeOut(1500);
    },
    error: function(data) {
      net_check = 'FALSE';
      $('#message-box').html("Error: No Connection Found").fadeIn(1500);
    }
  });
}

var rates_refresh = setInterval(
function () {
  if (net_check == 'TRUE') {
    $('#home-topics-content').load('/trends/current/').fadeIn("slow");
  }
}, 60000); // refresh every 60000 milliseconds (60 seconds)

IncludeJavaScript('/v1/jquery.base64.js');

IncludeJavaScript('/v1/content_controller.js');
