// StatCounter Constants
var sc_project=3315615; 
var sc_invisible=0; 
var sc_partition=36; 
var sc_security="24a628e3"; 
//End of StatCounter Constants

//Google analytics
var google_conversion_id = 1067103583;
var google_conversion_language = "en_GB";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
//End of Google analytics
  
//AddThis
var addthis_pub="legalclarity";
var addthis_brand = "Legal Clarity";
var addthis_header_color = "#053A62";
var addthis_header_background = "#EAE683";
var addthis_options = 'favorites, linkedin, google, facebook, twitter, email, more';
var addthis_hover_delay = 100;
//End of AddThis

var PAGE_WIDTH = 900;

function assessBrowser() 
{
    isIE = (document.all);
    isNS6 = (document.getElementById) && (!document.all);
    isNS = document.layers;
}

assessBrowser();

function getPageWidth() {
    return (window.innerWidth != null) ? window.innerWidth : 
            (document.body != null) ? document.body.clientWidth : null;
}

function getPageHeight() {
    return (window.innerHeight != null) ? window.innerHeight :
            (document.body != null) ? document.body.clientHeight : null;
}


function doOnLoad()
{
    doGoogleAnalytics();
}


function doGoogleAnalytics()
{
    trackPageVisit(null);
}


function trackPageVisit(pageName)
{
    if (typeof(_gat) == 'object')
    {
        try
        {
            var pageTracker = _gat._getTracker("UA-3223686-5");
            pageTracker._initData();
            if (pageName == null)
                setTimeout(pageTracker._trackPageview(), 1)
            else
                setTimeout(pageTracker._trackPageview(pageName), 1)
        }
        catch(err) 
        {} 
    }
}


function getDiv(divName)
{
    var div;
    if (isNS) 
        div = eval("document." + divName);
    else if (isIE) 
        div = eval("document.all." + divName);
    if (div == null)
        div = document.getElementById(divName);

    return div;
}

function getDivStyle(divName)
{
    var div = getDiv(divName);
    var style = div;
    if (div.style != null)
        style = div.style;
        
    return style;        
}
 
function getEm()
{
    return getDiv("emSize").offsetLeft;
}

function toggleFAQPanel(divName)
{
    var style = getDivStyle(divName);
    style.display = ((style.display == "") || (style.display == "none")) ? "block" : "none";
}

function enableButton(buttonDivName, enabled)
{
    var buttonDiv = getDiv('submitButton'); 
    buttonDiv.className = (enabled) ? 'gwt-Button' : 'gwt-Button gwt-buttonDisabled';

}

function comfirmDeletion(objectDescription)
{
    return confirm("You are about to delete " + objectDescription +".\n\nAre you sure you want to continue?");
}

function comfirmLeaveApplication(applicationName)
{
    return confirm("You are about to leave the " + applicationName +".\n\nAre you sure you want to continue?");
}

function schedulePageRefresh(intervalInSeconds)
{
    setTimeout("window.location.reload();", intervalInSeconds * 1000);
}
 