﻿// JScript File

function mp_onload()
    {
        if(window.body_onload != null)
        window.body_onload();
    }

function disableEnterKey(e)
    {
    var key;      
    if(window.event)
        key = window.event.keyCode; //IE
    else
        key = e.which; //firefox      
        return (key != 13);
    }

function clickclear(thisfield, defaulttext) {
    if (thisfield.value == defaulttext) {
        thisfield.value = "";
    }
    }

function clickrecall(thisfield, defaulttext) {
    if (thisfield.value == "") {
        thisfield.value = defaulttext;
    }
    }
    
function showhide(id){ 
    if (document.getElementById){ 
        obj = document.getElementById(id); 
        if (obj.style.display == "none"){ 
            obj.style.display = ""; 
        } else { 
            obj.style.display = "none";
        } 
        } 
    }

function LoadGoogleAnalytics(gaCode) {
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
}

function InvokeGoogleAnalytics(gaCode) {
    if (typeof(_gat) == "object") {
        try {
            var pageTracker = _gat._getTracker(gaCode);
            pageTracker._trackPageview();
            //alert('Tracking ' + gaCode);
            }
            catch(err)
            {
            //alert('Error: ' + err);
            }
        }
        else
        {
        //alert('GA Not loaded ' + gaCode);
        }
}

function TrackPageView(gaCode,gaPageToTrack) {
    if (typeof(_gat) == "object") {
        try {
            var pageTrackerG4 = _gat._getTracker(gaCode);
            pageTrackerG4._trackPageview(gaPageToTrack);
            //alert('Tracking ' + gaCode + ' at page ' +  gaPageToTrack);
            }
            catch(err)
            {
            //alert('Error: ' + err);
            }
        }
        else
        {
        //alert('GA Not loaded for ' + gaCode);
        }
}


