﻿function sc_Link(linkLocation) {
    s.linkTrackVars = 'None';
    s.linkTrackEvents = 'None';
    s.tl(this, 'o', linkLocation);
}
//Site Catalyst    
function sc_SendLinkToSC(linkname) {
    var trackVars = "prop22,eVar22";
    var trackEvents = "None";
    var trackVarsValue = "prop22=" + linkname + ",";
    trackVarsValue += "eVar22=" + linkname;
    sendLinkToSC(trackVars, trackVarsValue, trackEvents, linkname);
    return true;
}

function handleClick(theEl) {
    var theLoc = null;
    if (theEl) {
        switch (theEl) {
            case 'signInBtn':
                //theLoc='/fsg/xt_mboxredirect.ashx?s=hpbody_signin&t=%2Ffsg%2Fshopper_lookup.asp%3Ftarget%3Daccount.asp';
                theLoc = '/fsg/login/Shopper_Lookup.aspx?target=account.aspx';
                break;
            case 'getStartedBtn':
                //theLoc='/fsg/xt_mboxredirect.ashx?s=hpbody_customize&t=%2Ffsg%2Fxt_customization_launch.asp%3Fpf_id%3DCHECK-02';
                theLoc = '/fsg/xt_customization_launch.asp?pf_id%=CHECK-02';
                break;
            case 'getStartedBtnSec':
                theLoc = '/fsg/xt_customization_launch.asp?pf_id%=CHECK-11';
                break;
            case 'holCdBtn':
                //theLoc='/fsg/xt_mboxredirect.ashx?s=hpbody_holcd&t=%2Ffsg%2Fproduct%2Fdept.aspx%3Fdept_id%3D1546';
                theLoc = '/fsg/marketingmaterials/businessholidaycardsandcalendars.aspx';
                break;
        }
    }
    if (theLoc != null) {
        window.location.href = theLoc;
    }
}

function handleTstClick(elementID) {
    switch (elementID) {
        case 'protectYourself':
            var theTarget = jQuery("#protectYourself");
            if (theTarget.attr('mbox_triggered') != '1') {
                theTarget.attr('mbox_triggered', '1');
                mboxDefine('checkfraudMbox', 'im_home_hero_checkfraud_dmbox', '');
                mboxUpdate('im_home_hero_checkfraud_dmbox', '');
            }
            break;
        case 'startNowBtn':
            var theTarget = jQuery("#startNowBtn");
            if (theTarget.attr('mbox_triggered') != '1') {
                theTarget.attr('mbox_triggered', '1');
                mboxDefine('startNowBtnMbox', 'im_home_hero_getstartedbutton_dmbox', '');
                mboxUpdate('im_home_hero_getstartedbutton_dmbox', '');
            }
            break;
        case 'checkFraudBtn':
            var theTarget = jQuery("#checkFraudBtn");
            if (theTarget.attr('mbox_triggered') != '1') {
                theTarget.attr('mbox_triggered', '1');
                mboxDefine('checkFraudBtnMbox', 'im_home_hero_checkFraudBtn_dmbox', '');
                mboxUpdate('im_home_hero_checkFraudBtn_dmbox', '');
            }
            break;
        case 'checkLockBtn':
            var theTarget = jQuery("#checkLockBtn");
            if (theTarget.attr('mbox_triggered') != '1') {
                theTarget.attr('mbox_triggered', '1');
                mboxDefine('checkLockBtnMbox', 'im_home_hero_checkLockBtn_dmbox', '');
                mboxUpdate('im_home_hero_checkLockBtn_dmbox', '');
            }
            break;
    }
}

function swapImage() {
    var date_cutoff = new Date(2012, 4, 1, 0, 0, 0, 0); // May 1 2012 Night 12'0 clock.
    var end_date = new Date(2012, 4, 16, 0, 0, 0, 0); // Feb 16 2012 Night 12'0 clock.
    var date_today = new Date();
    var compImage = document.getElementById('complianceImg');
    
    if (date_today < end_date && compImage) {
        if (date_today < date_cutoff) {
            compImage.src = '/fsg/images/HomePage/Brand3/compliance_hp_banner_April30_deadline.gif';
            compImage.alt = 'New Federal NLRA';
        }
        else {
            compImage.src = '/fsg/images/HomePage/Brand3/compliance_hp_banner_April30_deadline_past.gif';
            compImage.alt = 'New Federal NLRA';
        }    
    }      
}
