﻿// General Purpose JScript functionality
// =====================================

function getObj(name)
{
    if (document.getElementById) // test if browser supports document.getElementById
    {
        this.obj = document.getElementById(name);
        this.style = document.getElementById(name).style;
    }
    else if (document.all) // test if browser supports document.all
    {
        this.obj = document.all[name];
        this.style = document.all[name].style;
    }
    else if (document.layers) // test if browser supports document.layers
    {
        this.obj = document.layers[name];
        this.style = document.layers[name].style;
    }
}

function BreakOutOfFrameSet()
{
     if(top.location != location)
     {
         // top.location.href = document.location.href;
         top.location.replace(document.location.href);
     }
}

function PrepareTrigger(TriggerId,TriggerValue)
{        
    var TriggerOb = new getObj(TriggerId);
    if(TriggerOb)
    {
        TriggerOb.obj.value = TriggerValue;
        return TriggerId;
    }
    
    return "";
}

function InvokePopupWindow(TheLink, WindowName)
{
     if (!window.focus) return true;
     
     var lnkRef;
     if (typeof(TheLink) == 'string') lnkRef=TheLink;
     else lnkRef=TheLink.href;
     
     myWin = window.open(lnkRef, WindowName, 'width=600,height=400,scrollbars=yes,location=no,status=no,dependent=yes,resizable=yes');
     myWin.focus();

     return false;
}

function OpenLandingPage(TheLink)
{
     if (!window.focus) return true;
     
     var lnkRef;
     if (typeof(TheLink) == 'string') lnkRef=TheLink;
     else lnkRef=TheLink.href;
     
     myWin = window.open(lnkRef, 'LandingPageHelper', 'width=600,height=400,scrollbars=no,location=no,status=no,dependent=yes,resizable=yes');
     myWin.focus();

     return false;
}

/*
function GoogleTracker()
{
    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"));

    try 
    {
        var pageTracker = _gat._getTracker("UA-6477071-1");
        pageTracker._initData();
        pageTracker._trackPageview();
    } 
    catch(err) {}
}
*/