function openLocal(windowURL, Mode) {
        newWindow = window.open(windowURL , 'tseg', Mode  );
        }

function gobetfair()
{
    var id = get_param("marketid");
    if (id) {
//If someone lands here from the market smartlink, the id will have the value of the market he wanted to visit
        var cl = "http://sports.betfair.com/?mi=" + id + "&ex=1";
        window.location = cl;
    } else {
//This is for all those users who came directly to the landing page
        var cl = "http://www.betfair.com";
        window.location = cl;
    }
}

function get_params() {
   var GET = new Array();
   if(location.search.length > 0) {
      var get_param_str = location.search.substring(1, location.search.length);
      var get_params = get_param_str.split("&");
      for(i = 0; i < get_params.length; i++) {
         var key_value = get_params[i].split("=");
         if(key_value.length == 2) {
            var key = key_value[0];
            var value = key_value[1];
            GET[key] = value;
         }
      }
   }
   return(GET);
}

function get_param(key) {
   var params = get_params();
   if(params[key])
      return(params[key]);
   else
      return false;
}
