omnitureSelectedFAQ = '';

function RetrieveApplication()
{
    s=s_gi(s_account);
    s.linkTrackVars = 'events';
    s.linkTrackEvents = 'event4';
    s.events = 'event4';
    s.tl(this, 'o', 'Application Retrieved');
}

function ToolUsed(tool)
{
    s=s_gi(s_account);
    s.linkTrackVars = 'prop10,eVar10,events';
    s.linkTrackEvents = 'event15';
    s.prop10=tool;
    s.eVar10=s.prop10;
    s.events = 'event15';
    s.tl(this,'o','Tool Usage');
}

function FAQViewed(faq)
{
    //if the FAQ isn't being collapsed we want to create an event
    if (faq != omnitureSelectedFAQ)
    {
        s=s_gi(s_account);
        s.linkTrackVars = 'prop36';
        s.linkTrackEvents = 'None';
        s.prop36=faq;
        s.tl(this, 'o', 'FAQ View');
        omnitureSelectedFAQ = faq;
     }
     //otherwise we just set omnitureSelectedFAQ to nothing as it has been collapsed
     else
     {
        omnitureSelectedFAQ = '';
     }
}

function FAQRating(faq, didThisHelp)
{
    s=s_gi(s_account);
    s.linkTrackVars = 'eVar36,eVar38';
    s.linkTrackEvents = 'None';
    s.eVar36=faq;
    s.eVar38=didThisHelp;
    s.tl(this, 'o', 'FAQ Rating');
}

function FAQCategorySearch(faqCategory, numberOfResults)
{
    s=s_gi(s_account);
    s.linkTrackVars = 'prop37,prop38,eVar37';
    s.linkTrackEvents = 'event16';
    s.events = 'event16';
    s.prop37=faqCategory;
    s.prop38=numberOfResults;
    s.eVar37=s.prop37;
    s.tl(this, 'o', 'FAQ Category Search');
}

function DownloadClicked(download)
{
    s=s_gi(s_account);
    s.linkTrackVars = 'eVar12,events';
    s.linkTrackEvents = 'event7';
    s.eVar12=download;
    s.events = 'event7';
    s.tl(this, 'd', download);
}

function ContactUs(contactUsType)
{
    s=s_gi(s_account);
    s.linkTrackVars = 'events,eVar11';
    s.linkTrackEvents = 'event11';
    s.eVar11=contactUsType;
    s.events = 'event11';
    s.tl(this, 'o', contactUsType);
}

function QuoteResults(products, customerType, customerState, productType, paymentType)
{
    s=s_gi(s_account);
    s.linkTrackVars = 'products,events,eVar24,eVar25,eVar28,eVar31';
    s.products = products;
    s.eVar29 = s.products;
    s.linkTrackEvents = 'event2';
    s.eVar24=customerType;
    s.eVar25=customerState;
    s.eVar28=productType;
    s.eVar31=paymentType;
    s.events = 'event2';
    s.tl(this, 'o', 'Quote Results');
}

function SendToFriend()
{
    s=s_gi(s_account);
    s.linkTrackVars = 'events';
    s.linkTrackEvents = 'event9';
    s.events = 'event9';
    s.tl(this, 'o', 'Send To Friend');
}

function PrintPage()
{
    s=s_gi(s_account);
    s.linkTrackVars = 'events';
    s.linkTrackEvents = 'event8';
    s.events = 'event8';
    s.tl(this, 'o', 'Print this Page');
}

function TrackPage(pageName)
{
    s.pageName = pageName;
    s.t();
}

function QuickQuoteExcessChanged(products, excessAmount) 
{
    s = s_gi(s_account);
    s.linkTrackVars = 'events,eVar26,products';
    s.linkTrackEvents = 'event20';
    s.events = 'event20';
    s.eVar26 = excessAmount;
    s.products = products;
    s.tl(this, 'o', 'Quick Quote Excess Changed');
}

function QuickQuoteInclusions(directDebit, govtRebate, lhcShown, lhcExcempt, lhcContinuous, certifiedAge, partnerLhcContinuous, partnerCertifiedAge) 
{
    s = s_gi(s_account);
    s.linkTrackVars = 'events,eVar34,eVar35,eVar39,eVar40,eVar41,eVar42,eVar43,eVar44';
    s.linkTrackEvents = 'event24';
    s.events = 'event24';
    s.eVar34 = govtRebate;
    s.eVar35 = directDebit;

    if (lhcShown)
    {
        s.eVar39 = lhcExcempt;
        
        if (lhcContinuous != '')
        {
            s.eVar40 = lhcContinuous;
        }

        if (certifiedAge != '')
        {
            s.eVar41 = certifiedAge;
        }
        
        if (partnerLhcContinuous != '') 
        {
            s.eVar42 = partnerLhcContinuous;
        }

        if (partnerCertifiedAge != '') 
        {
            s.eVar43 = partnerCertifiedAge;
        }
    }
    s.tl(this, 'o', 'Quick Quote Inclusions');
}

function ButtonClicked(buttonName)
{
    s = s_gi(s_account);
    s.linkTrackVars = 'prop6';
    s.prop6 = buttonName;
    s.tl(this, 'o', 'Button Clicked');
}

function QuickQuoteUpdateRestore(eventName, customerState, customerType, productType, paymentFrequency, dob, partnerdob, pregnancy, majorDental, naturalTherapies, products) 
{
    s = s_gi(s_account);
    s.linkTrackVars = 'products,events,eVar25,eVar24,eVar28,eVar31,eVar8,eVar9,eVar13,eVar23,eVar45';
    s.linkTrackEvents = eventName;
    s.events = eventName;
    s.eVar25 = customerState;
    s.eVar24 = customerType;
    s.eVar28 = productType;
    s.eVar31 = paymentFrequency;
    s.eVar8 = dob;

    if (partnerdob != '')
    {
        s.eVar44 = partnerdob;
    }
    
    s.eVar9 = pregnancy;
    s.eVar13 = majorDental;
    s.eVar23 = naturalTherapies;
    s.products = products;
    
    s.tl(this, 'o', 'Quick Quote Update/Restore');
}

function TooltipViewed(tooltip)
{
    s = s_gi(s_account);
    s.linkTrackVars = 'prop9';
    s.prop9 = tooltip;
    s.tl(this, 'o', 'Tooltip Viewed');
}

function BuyOnlineMilestoneReached(value)
{
    s = s_gi(s_account);

    s.linkTrackVars = 'prop12';
    s.linkTrackEvents = 'None';
    s.prop12 = value;
    s.tl(this, 'o', 'Buy Online Progress');
}