// Dart Random Number
_krdDartOrd = new Date().getTime();

//  Dart Tile Number 1-16 unique in page by inc 1
_krdDartInc = 0;

var navReady = false;
var toolsReady = false;
var partner_group = "";

function getSite(){
    foundSite = false;
    site=document.location.hostname;
    endPos=site.indexOf(".com");
    if (endPos >= 1) {
        foundSite = true;
        site = site.substr(0, endPos);
        startPos = site.lastIndexOf(".");
        site = site.substr(startPos + 1);
    }
    return site;
}
function getPublication(){
    publication=document.location.pathname;
    startPos=publication.indexOf("/mld/");
    publication=publication.substr(startPos+5);
    endPos=publication.indexOf("/");
    publication=publication.substr(0,endPos);
    return publication;
}
function openSlideshow(url,width,height) {
    y=Math.floor((screen.availHeight-height)/2);
    x=Math.floor((screen.width-width)/2);
    window.open(url,'slideshow','width='+width+',height='+height+',top='+y+',left='+x+',scrollbars=yes,resizable=yes').focus();
}
function openWin(URL,WIDTH,HEIGHT) {
    if (typeof WIDTH == 'undefined') {
        WIDTH = 500;
    }
    if (typeof HEIGHT == 'undefined') {
        HEIGHT = 400;
    }
    WIDTH = WIDTH + 200;
    HEIGHT = HEIGHT + 250;

    var Win_Param = 'width='+WIDTH+',height='+HEIGHT+',resizable=yes,scrollbars=yes';
    aWindow = window.open(URL,'thewindow',Win_Param);
}

// Check environment.
function isTestEnv() {
  testHost = document.location.host;
  if (testHost == "" || testHost.match(/(\.(int|qa|stg)\.|localhost)/)) {
    return true;
  }
  return false;
}

var _isTestEnv = isTestEnv();

// Relative URLs
function relPath(path) {

p=document.location.pathname;document.location=p.substring(0,(i=5+p.substring(5).indexOf('/'))>4?i:p.length)+'/'+path;

}

//---------------- END GLOBAL.JS
