/*
 * 
 * Originally written for SiteCatalyst code version: H.20.3.
 * Now using H.24
 * Jim Humphrys
 * Last edited January 4, 2012  
 */
/*global tempassetname, tempcategory0, tempcategory1, tempcategory2, templocale, tempassettype:true, tempcategory3value, tempcategory2value, tempcategory1value, tempcategory0value, tempindustryvalue, tempsource, tempflexdefinition:true, tempparam1, tempparam2, tempparam3, tempparam4, tempparam5, tempparam6, tempparam7, tempparam8, tempparam9, tempi1master, tempi2master, document, tempassetid, s_account, s_gi, s, jQuery, gmetrics */
//the global line above is for jslint - javascript validation engine

/* Structure of this file
 * Configure report suite 
 * Read other browser values, URL parameters and use logic to define values that will be used later
 * Page metrics - Omniture named variables, hier, props, evars, events (including named events and Onclick events)
 * Functions for handling 'on click' events, special link tracking
 * Copy evars to props, props to evars
 */



//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
//Configure Report Suite 
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

//Link tracking configuration
s.trackDownloadLinks = true;
s.trackExternalLinks = true;
s.trackInlineStats = true;
s.linkInternalFilters = "javascript:,atomz.com,gore.com,search.atomz.com,gore.,brassring.com,goreelectronics.com,remedia.com,goremea.com,pristyne.com,soilgassurvey.com,soilgassurveys.com,goremicrowave.com,phaseflex.com,flexliteoptics.com,wlgore.com,rastex.com";


s.linkDownloadFileTypes = "exe,zip,wav,mp3,mov,mpg,avi,wmv,doc,pdf,xls";
s.linkLeaveQueryString = false;
s.linkTrackVars = "None";
s.linkTrackEvents = "None";
s.charSet = "UTF-8";  //need to validate with all site developers for each new site or app

/* media tracking */
s.loadModule("Media");
s.Media.autoTrack = true;
s.Media.trackVars = "None";
s.Media.trackEvents = "None";

//End of configure the report suite section


//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
//Read other browser values, URL parameters, and write logic to define values used later
//Meta names were read in s_metricsaccount.js and put into variables beginning with 'temp'
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

//read other browser values, other useful values

var visitStart = (s.getVisitStart('s_visit') === '1');



//end of read other browser values, other useful values



//logic to define values for use later
var temppagestart = "";
var temppagestem = tempassetname;
var tempsection = tempcategory0;
var tempsubsection = tempcategory1;
var tempsubsubsection = tempcategory2;
var tempcontentsource = "";
var tempproduct = "";

//change locale from what was in meta name to what will be shown in Site Catalyst variable values - for page name
switch (templocale) {
case 'en_xx':
    temppagestart = "INT";
    break;
case 'de_de':
    temppagestart = "DEU";
    break;
case 'en_gb':
    temppagestart = "GBR";
    break;
case 'zh_cn':
    temppagestart = "CHN";
    break;
case 'ko_kr':
    temppagestart = "KOR";
    break;
case 'it_it':
    temppagestart = "IT";
    break;
case 'es_es':
    temppagestart = "ES";
    break;
case 'ja_jp':
    temppagestart = "JP";
    break;
case 'zh_tw':
    temppagestart = "TW";
    break;
}

//change assettype from what was in meta name to what will be shown in Site Catalyst variable values
if (tempassettype === "gore_product_c") {tempassettype = "product";
    } else if (tempassettype === "gore_landing_c") {
    tempassettype = "landing";
} else if (tempassettype === "gore_doc_c") {
    tempassettype = "doc";
} else if (tempassettype === "gore_marcom_c") {
    tempassettype = "marcom";
}

/*logic for pagenaming.  In general, this will involve only the pagestem.
*For product pages,docs pagestem = asset name
*For Landing: Home page and level 1 pages (primary nav), pagestem=Category0Value
*For Landing: level 2 pages, pagestem=Category1Value
*For Landing: level 3 pages, pagestem=Category2Value
*For Landing: level 4 pages, pagestem=Category3Value
*Landing pages in Careers section will be set in Careers code further down. They use I1_Master and I2_Master. However the Careers Landing page page stem is set here.  
*/
if (tempassettype === "landing") {
    if (tempcategory3value !== "") {temppagestem = tempcategory3value; } else if (tempcategory2value !== "") {temppagestem = tempcategory2value; } else if (tempcategory1value !== "") {temppagestem = tempcategory1value; } else {temppagestem = tempcategory0value; }
    if (tempindustryvalue !== "") {temppagestem = tempindustryvalue; } //for industry page details   
}
if ((tempassettype === "landing") && (tempcategory0 === "HomepageFeaturedLandings")) {temppagestem = tempassetname; } //for home page featured product landings
//catch null values for pagestem
if (temppagestem === "") {temppagestem = 'nullvalue'; }


//need to write logic for prop8, prop9 for certain pages
if ((tempcategory0 === '02 Industries') || (tempcategory0 === '03 Technologies') || (tempcategory0 === '04 About Us') || (tempcategory0 === '08 News and Events') || (tempcategory0 === 'Site Map')) {
    tempsubsection = 'gore';
    tempsubsubsection = 'gore';
}

/* For Endeca generated pages */
// includes site search, prodfinder, docfinder, job search, job search details
if (tempsource === "Endeca") {
    temppagestart = 'app';
    temppagestem = templocale + ':' + tempassetname;
    tempflexdefinition = "Application";  //for prop10

    switch (tempassettype) {

    case "jobsearch":  //for both the job search results and the job details page
        s.prop32 = templocale;
        s.eVar46 = templocale;
        if (tempassetname === 'job results') {
            tempsubsection = '05 Careers';
            tempsubsubsection = 'recruit:jobsearch';
            s.prop34 = tempparam3;
            s.prop35 = tempparam1.toLowerCase();
            s.prop36 = s.prop35 + ":" + tempparam5 + ":" + tempparam7 + ":" + tempparam6 + ":" + tempparam3 + ":" + tempparam2;
            s.eVar43 = "+1";
            s.eVar48 = s.prop34;
            s.eVar49 = s.prop35;
            s.events = s.apl(s.events, "event36", ",", 1);
            s.events = s.apl(s.events, "event37", ",", 1);
        } else {    //tempassetname not 'job results', so must be 'job details' page
            tempsubsection = '05 Careers';
            tempsubsubsection = 'recruit:jobsearch';
            s.eVar41 = tempparam1;
            s.eVar45 = "+1";
            s.events = s.apl(s.events, "event39", ",", 1);
            s.events = s.apl(s.events, "event40", ",", 1);
        }
        break;

    case "search":     //site search
        tempsubsection = 'search';
        tempsubsubsection = 'search';
        s.prop6 = tempparam1.toLowerCase();  //search term, phrase
        s.prop7 = tempparam2;
        s.prop27 = tempparam9;//template type-all, 1=products, 2=related info, 3=news,events 4-additional info
        s.eVar6 = s.prop6;
        s.eVar7 = s.prop6; //linear allocation of events to search term
        s.events = s.apl(s.events, "event25", ",", 1);
        if ((tempparam7 !== "Null") && (tempparam7 !== "")) {//there is a spotlight on the page
            s.eVar51 = tempparam7;
            s.events = s.apl(s.events, "event31", ",", 1);
            s.prop25 = tempparam7;
            s.prop26 = s.prop25 + "::Q::" + s.prop6;
        }
        if (tempparam5 === "New Search") {s.events = s.apl(s.events, "event26", ",", 1); }
        if (s.prop7 === "0") {//zero search results
            temppagestem = templocale + ':' + tempassetname + 'zeroresults';//will change the pagename if no results
            s.events = s.apl(s.events, "event27", ",", 1);
            if ((tempparam7 === "Null") || (tempparam7 === "")) {//zero results and no spotlight
                s.events = s.apl(s.events, "event33", ",", 1);
            } else {//for zero results and a spotlight
                s.events = s.apl(s.events, "event32", ",", 1);
                s.prop28 = tempparam7 + "::Q::" + s.prop6;
                s.eVar52 = tempparam7;
            }
        }


        break;

    case "prodfinder":
        tempsubsection = 'site applications';
        tempsubsubsection = 'prodfinder';

        break;

    case "docfinder":
        tempsubsection = 'site applications';
        tempsubsubsection = 'docfinder';

        break;

    } //end of switch

}
/* End of section for Endeca generated pages*/

//for upper level pages not in section above (industries, about us, etc.) then make sure there is a subsection and subsubsection value.  This should mostly be the sections for home, products, contact us, careers
if (tempsubsubsection === "") {  //if a page below the top level of the site

    if (tempsubsection === "") {  //if at the top level of the site, then set these values to the 'section'
        tempsubsection = tempsection;
        tempsubsubsection = tempsection;
    } else {tempsubsubsection = tempsubsection; }
}


//for careers section
if (tempcategory0 === '05 Careers') {
    s.prop32 = templocale;
    s.eVar46 = templocale;

    if (tempi1master !== "") {
        tempsubsubsection = 'recruit:' + tempi1master;
        temppagestem = tempi1master;//affects all Careers CMS pages except the landing
        if (tempi2master !== "") {//detail page in careers
            temppagestem = tempi2master;
        }
        if (tempi1master === "05.10 Professionals") {
            s.events = s.apl(s.events, "event38", ",", 1);
            s.eVar42 = "professional";
        } else if (tempi1master === "05.11 Students & New Graduates") {
            s.events = s.apl(s.events, "event38", ",", 1);
            s.eVar42 = "student";
        } else if (tempi1master === "05.12 Manufacturing & Skilled Trades") {
            s.events = s.apl(s.events, "event38", ",", 1);
            s.eVar42 = "manufacturing";
        } else if (tempi1master === "05.16 Associate Stories") {
            s.eVar47 = "stories visitor";
        }

    }
}
//end career code

//for subsubsections with comma delimited list of Category2 values, use the subsection value
//if for some reason, the subsection also includes a comma, then set values to section of the site -e.g. 01 Products
if (tempsubsubsection.indexOf(',', 0) !== -1) {tempsubsubsection = tempsubsection; }
if (tempsubsection.indexOf(',', 0) !== -1) {
    tempsubsection = tempsection;
    tempsubsubsection = tempsection;
}





//end of logic to define values for later use







//end of section for reading other browser values, url parameters, and logic to define values to be used later



//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// Page metrics - Omniture named variables, hier, props, evars, events (including named events and Onclick events)
// Omniture named variables - pageName,channel, server, pageType, products, state, zip, purchaseID, campaign
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX





// pageName - Unique page naming taxonomy
//see logic above on pagestem
s.pageName = temppagestart + ":" + tempassettype + ":" + temppagestem;

// channel - Site content section
s.channel = tempsection;

/*External Campaign Tracking */
if (!s.campaign) {s.campaign = s.getQueryParam('xcmp'); }
var campaignval = s.getAndPersistValue(false, 's_campaignval', 7); //make campaign value available for metrics for jobapply
if ((campaignval === "") && s.getQueryParam('xcmp')) {campaignval = s.getAndPersistValue(s.getQueryParam('xcmp'), 's_campaignval', 7); }
if ((!s.campaign) && (s.getQueryParam('CID'))) {s.campaign = "ET:" + s.getQueryParam('CID'); }
if (s.getQueryParam('CID') && s.getQueryParam('xcmp')) {s.campaign = "ET:" + s.getQueryParam('CID') + "::" + s.getQueryParam('xcmp'); }



//Special pages
//Sets multiple values at once
//covers error page, product view pages, ????
// *** TODO: handling specific to how 404 will be managed


// 404 Error page special handling
if (tempassetname.indexOf('404Error', 0) >= 0) {
    s.pageName = "404 Error page";
    s.prop2 = s.getQueryParam('referer');
    s.prop3 = s.getQueryParam('requested_page');
//will also make prop20=404 error+ requested page
}



//Product page viewed
if (tempassettype === "product") {
    s.events = s.apl(s.events, "prodView", ",", 1);
    s.events = s.apl(s.events, "event28", ",", 1);
    s.events = s.apl(s.events, "event13", ",", 1);
    s.eVar32 = tempcategory1 + ":" + tempcategory2 + ":" + tempassetname;
    s.eVar33 = tempcategory1 + ":" + tempcategory2 + ":" + tempassetname;
    s.products = ";" + tempcategory1 + ":" + tempcategory2 + ":" + tempassetname;
}



// PROPS
// 1. 
//s.prop1 = templocale;
// 2. see 404 handling above



// 3. see 404 handling above

// 4. test of plugin
//s.prop4=s.getDaysSinceLastVisit();
// 5.


// 6. Internal search words

// 7. Internal search results count

// 8. SubSection
s.prop8 = tempsubsection;

// 9. SubSubSection
s.prop9 = tempsubsubsection;
// 10. Page Type 
s.prop10 = tempflexdefinition;
// 11. 
s.prop11 = "::" + s.pageName + "::" + s.prop8 + "::" + s.prop9;
// 12. 
//s.prop12 = tempparam1;
// 13.
//s.prop13 = tempparam2;
// 14. just a test to see if plugins are working
//s.prop14=s.getVisitNum();

/*
// 15. setting visit/session id to time of visit start
 tempvisID=new Date().getTime(); 
 s.prop15=s.getAndPersistValue(false,'s_visitID'); 
      if (s.prop15==="") {s.prop15=s.getAndPersistValue(tempvisID,'s_visitID');}

// 16. setting visitor ID to time of first visit
 s.prop16=s.getAndPersistValue(false,'s_visitorID',360); 
 if (s.prop16==="") {s.prop16=s.getAndPersistValue(tempvisID,'s_visitorID',360);s.eVar16=s.prop16;}
*/

// 15. setting visit/session id to time of visit start (format visitorID:sessionID)
// 16. setting visitor ID to time of first visit
var tempvisID = new Date().getTime();
s.prop16 = s.getAndPersistValue(false, 's_visitorID', 360);
if (s.prop16 === "") {s.prop16 = s.getAndPersistValue(tempvisID, 's_visitorID', 360); s.eVar16 = s.prop16; }
var tempstring = s.prop16 + ":" + tempvisID;
s.prop15 = s.getAndPersistValue(false, 's_visitID');
if (s.prop15 === "") {s.prop15 = s.getAndPersistValue(tempstring, 's_visitID'); s.eVar15 = s.prop15; }
// 17. 
/*Redirect URLs*/
s.prop17 = s.getQueryParam('RDCT');
// 18. Document URL  (only holds 100 characters)
s.prop18 = document.URL;
// 19. prior page
s.prop19 = "";
if (s.prop19 !== s.pageName) {
    var tempvar = s.getAndPersistValue(false, 's_priorpage');  //retrieves the cookie value  - contains last pageName
    s.prop19 = s.getAndPersistValue(s.pageName, 's_priorpage');  //sets the cookie to current page
    s.prop19 = tempvar;
}


// 20. Detailed Clickpath
s.prop20 = s.pageName;
if ((s.getQueryParam('xcmp')) || (s.getQueryParam('CID'))) {s.prop20 = "xcmp:" + s.campaign + ":" + s.pageName; }
if (s.pageName === "404 Error page") {s.prop20 = "404 Error page:requested:" + s.prop3; }
if ((s.pageName.indexOf('app', 0) === 0) && (tempassetname !== "job results")) {
    //var tempsubstr;
    //tempsubstr=s.pageName.substr(4,s.pageName.indexOf(":",4)-4); //get the name of the application embedded in pageName
    switch (tempassetname) {

    case "search_result_page": s.prop20 = s.pageName + ":" + s.prop6;
        break;
    case "pf_results": s.prop20 = s.pageName + ':num pages:' + tempparam2;
        break;
    case "df_results": s.prop20 = s.pageName + ':num pages:' + tempparam2;
        break;
    case "job details": s.prop20 = s.pageName + ":" + tempparam1;
        break;
    case "job results": s.prop20 = s.pageName + ":" + s.prop36;//prop36 defined in Endeca section
        break;

    }
}
// 21. Asset ID
s.prop21 = tempassetid;
// 22. Exact Target ID (see also eVar22)
s.prop22 = s.getQueryParam('etsid');
// 23. priorpage::searchterm
if (tempparam5 === "New Search") {s.prop23 = s.prop19 + "::" + s.prop6; }
// 24. Pages seen that were published more than 30 days before. 
if (gmetrics.pubdate !== undefined) { //meta element pubdate exists
    gmetrics.pub = Date.parse(gmetrics.pubdate);//read the text string and put into numbers
    gmetrics.today = new Date();
    if ((gmetrics.pub + 2592000000) < gmetrics.today) {//if the pubdate is older than 30 days ago
        s.prop24 = s.pageName + ":" + gmetrics.pubdate;//pagename:pubdate
    }
} 

// 25. spotlight name (set in Endeca section)
// 26. spotlight name::Q::search term (set in Endeca section)
// 27. search template (set in Endeca section)
// 28. zero result spotlight name::Q::search term (set in Endeca section)
// 29. 
// 30.
// 31.
// 32. locale for careers (set above)

// 33. 
// 34. recruiting function (set above)
// 35. recruiting keyword (set above)
// 36. recruiting string keyword:country:state:city:function:type (set above)

// 37.
// 38.
// 39.
// 40. 

// 41. 

// 42. 

// 43.
// 44.
// 45.
// 46.
// 47.
// 48.
// 49.
// 50.


//eVARS

// 1.
// 2. 

// 3. 

// 4. 
// 5. 

// 6. internal search term - last (set in Endeca section) 
// 7. internal search term - linear allocation (set in Endeca section)
// 8. 
// 9. 
// 10. 
// 11. 
// 12. Exact Target - Campaign/eMail ID
if (s.getQueryParam('CID')) {s.eVar12 = "ET:" + s.getQueryParam('CID'); }

// 13. Page Name
s.eVar13 = s.pageName;
// 14. 
// 15. see prop15 
// 16. see prop16
// 17. 

// 18. 
// 19. Page counter (this visit)
s.eVar19 = "+1";
// 20. Page counter (all visits)
s.eVar20 = "+1";
// 21.
// 22. Exact Target ID  (see also prop22) 
s.eVar22 = s.getQueryParam('etsid');
// 23.
// 24. 
// 25. 
// 26.
// 27.
// 28.
// 29.
// 30.
// 31. 
// 32. set when product viewed (above)
// 33. set when product viewed (above)
// 34. buynow module clicked - set below in doClick()
// 35.
// 36. 
// 37. 
// 38. 
// 39. 
// 40.
// 41. job id(jobsearch, set in endeca section)
// 42. careers section (set above) 
// 43. (jobsearch, set in endeca section)
// 44. 

// 45. number of views of job details page(jobsearch, set in endeca section)

// 46. locale for careers (set above)

// 47. careers - visit stories section? (set above) 

// 48. careers - function (set above)
// 49. careers - keyword (set above)
// 50.
// 51. Spotlight name (set in Endeca section)
// 52. Spotlight name on zero results page (set in Endeca section)


//EVENTS

//named events prodView, 

//prodview  - see logic above for product detail pages


// event1 
// event2 
// event3 

// event4 

// event5 

// event6 
// event7 
// event8 
// event9
// event10
// event11
// event12 Page View (event)
s.events = s.apl(s.events, "event12", ",", 1);
// event13 Product view (event) set in products section
// event14
// event15 
// event16 

// event17
// event18
// event19 internal search result clicked - set below in doClick()
// event20
// event21
// event22
// event23 
// event24 
// event25 search visit (set in endeca section)
// event26 number of searches (set in endeca section)
// event27 number of zero search results (set in endeca section)
// event28 product page viewed - set above in product
// event29 on click events for buynow module - set below in doClick()
// event30 on click event for buynow module - set below in doClick()
// event31 spotlight event (set in Endeca section)
// event32 spotlight event on zero results page (set in Endeca section)
// event33 no spotlight and zero results (set in Endeca section)
// event34 spotlight link clicked
// event35 
// event36 jobsearch visits(jobsearch, set in endeca section)
// event37 number of job 'searches'(jobsearch, set in endeca section)
// event38 entered careers section (set above in careers)
// event39 viewed job details page(jobsearch, set in endeca section)
// event40 job details page visit(jobsearch, set in endeca section)
// event41
// event42
// event43
// event44
// event45
// event46
// event47
// event48
// event49
// event50
// event51
// event52
// event53
// event54
// event55
// event56
// event57
// event58
// event59
// event60
// event61
// event62
// event63
// event64
// event65
// event66
// event67
// event68
// event69
// event70
// event71
// event72
// event73
// event74
// event75
// event76
// event77
// event78
// event79
// event80

//xxxxxxxxxxxxxxxxx
//Custom Links
//xxxxxxxxxxxxxxxxx

//need to configure for each of the different types of links
//There must be an onclick event calling the function, and the link must have a unique link ID starting with the text track::.  The next part of the string identifies what type of link it is.   



function doClick(obj) {
    "use strict"; //added due to jslint
    var tempid, colonloc, tempstring, jobtype, jobid, campid, applyhref;//most are used in the jobdetails link tracking
    tempid = obj.id;

    if (tempid.indexOf("track::") === 0) {
        if ((tempid.indexOf("buynow::") === 7) && (tempassettype === "product")) {
            s = s_gi(s_account);
            s.linkTrackVars = 'prop20,products,eVar34,events';
            s.linkTrackEvents = 'event29,event30';
            s.prop20 = 'link:howtobuy:' + temppagestem;
            //s.products is already set on the page and will be passed because it listed in the linktrackvars variable
            s.eVar34 = 'howtobuy:' + temppagestem;
            s.events = 'event29,event30';
            s.tl(obj, 'o', 'how to buy');
        } else if (tempid.indexOf("searchresult::") === 7) {//internal site search
            s = s_gi(s_account);
            s.linkTrackVars = 'prop20,prop29,events';
            s.linkTrackEvents = 'event19';
            s.prop29 = "searchresultclicked";
            if (tempid.indexOf("searchresult::prod") === 7) {
                s.prop29 = "product";
                if (tempid.indexOf("searchresult::prod::h3") === 7) {
                    s.prop29 = "product::headline";
                }
                if (tempid.indexOf("searchresult::prod::cat") === 7) {
                    s.prop29 = "product::category";
                }
                if (tempid.indexOf("searchresult::prod::rel") === 7) {
                    s.prop29 = "product::related";
                }
                if (tempid.indexOf("searchresult::prod::all") === 7) {
                    s.prop29 = "product::all";
                }
            }
            if (tempid.indexOf("searchresult::relinfo") === 7) {
                s.prop29 = "relatedinfo";
            }
            if (tempid.indexOf("searchresult::news") === 7) {
                s.prop29 = "news";
            }
            if (tempid.indexOf("searchresult::addl") === 7) {
                s.prop29 = "additionalinfo";
            }
            if (tempid.indexOf("searchresult::all") === 7) {
                s.prop29 = "resultsnotcategorized";
            }
            if (tempid.indexOf("searchresult::gore") === 7) {
                s.prop29 = "gore.com locale";
            }
            if (tempid.indexOf("searchresult::other") === 7) {
                s.prop29 = "othergoresite";
            }
            s.prop20 = 'link:searchresultclicked:' + temppagestem;
            s.events = 'event19';
            s.tl(obj, 'o', 'search result clicked');
        } else if (tempid.indexOf("jobapply::") === 7) {//tracking the apply now link on job details page
//link will have this format - id="track::jobapply::JobType::JobID"

            applyhref = document.getElementById(tempid).href;//will be href for the apply now link
            tempstring = 'RCRT:' + templocale + ':apply_for_job';
            colonloc = tempid.indexOf("::", 17);//holds location of :: separating jobtype and jobid
            jobtype = tempid.substring(17, colonloc);//available, but not reported
            jobid = tempid.substring(colonloc + 2);
            s = s_gi(s_account);
            s.linkTrackVars = 'prop20,eVar41,eVar44,events';
            s.linkTrackEvents = 'event7,event41';
            s.prop20 = 'link:' + tempstring + ':' + jobid;
            s.eVar41 = jobid;
            s.eVar44 = '+1';
            s.events = 'event7,event41';
            s.tl(obj, 'o', tempstring);
        //campaignval set from cookie in campaign area above
            if (campaignval !== "") {
                applyhref = applyhref + '%26src%3D' + campaignval;
            }
            document.getElementById(tempid).href = applyhref;
        }

    }
}



//vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//Linktracking with jquery



function jqleftnav() {

    var linktext = jQuery(document.activeElement).text();

    s = s_gi('wlggoretest3');
    s.linkTrackVars = 'prop1,prop2,prop3,prop4,prop5,prop6';
    s.prop1 = tempsection + ':leftnav';
    s.prop2 = tempsection + ':' + templocale + ':leftnav';
    s.prop3 = tempsection + ':leftnav:' + linktext;
    s.prop4 = tempsection + ':' + templocale + ':leftnav:' + linktext;
    s.prop5 = tempsection + ':' + temppagestart + ":" + tempassettype + ":" + temppagestem + ':leftnav';
    s.prop6 = tempsection + ':' + temppagestart + ":" + tempassettype + ":" + temppagestem + ':leftnav:' + linktext;
    s.tl(this, 'o', 'leftnav');
}
function jqmenubar(e) {

    var linktext = jQuery(document.activeElement).text();

    s = s_gi('wlggoretest3');
    s.linkTrackVars = 'prop1,prop2,prop3,prop4,prop5,prop6';
    s.prop1 = tempsection + ':primenav';
    s.prop2 = tempsection + ':' + templocale + ':primenav';
    s.prop3 = tempsection + ':primenav:' + linktext;
    s.prop4 = tempsection + ':' + templocale + ':primenav:' + linktext;
    s.prop5 = tempsection + ':' + temppagestart + ":" + tempassettype + ":" + temppagestem + ':primenav';
    s.prop6 = tempsection + ':' + temppagestart + ":" + tempassettype + ":" + temppagestem + ':primenav:' + linktext;
    s.tl(this, 'o', 'primenav');
}
function jqbread(e) {

    var linktext = jQuery(document.activeElement).text();

    s = s_gi('wlggoretest3');
    s.linkTrackVars = 'prop1,prop2,prop3,prop4,prop5,prop6';
    s.prop1 = tempsection + ':bread';
    s.prop2 = tempsection + ':' + templocale + ':bread';
    s.prop3 = tempsection + ':bread:' + linktext;
    s.prop4 = tempsection + ':' + templocale + ':bread:' + linktext;
    s.prop5 = tempsection + ':' + temppagestart + ":" + tempassettype + ":" + temppagestem + ':bread';
    s.prop6 = tempsection + ':' + temppagestart + ":" + tempassettype + ":" + temppagestem + ':bread:' + linktext;
    s.tl(this, 'o', 'bread');
}
function jqcontentarea(e) {

    var linktext = jQuery(document.activeElement).text();

    s = s_gi('wlggoretest3');
    s.linkTrackVars = 'prop1,prop2,prop3,prop4,prop5,prop6';
    s.prop1 = tempsection + ':content';
    s.prop2 = tempsection + ':' + templocale + ':content';
    s.prop3 = tempsection + ':content:' + linktext;
    s.prop4 = tempsection + ':' + templocale + ':content:' + linktext;
    s.prop5 = tempsection + ':' + temppagestart + ":" + tempassettype + ":" + temppagestem + ':content';
    s.prop6 = tempsection + ':' + temppagestart + ":" + tempassettype + ":" + temppagestem + ':content:' + linktext;
    s.tl(this, 'o', 'content');
}
function jqmodules() {

    var linktext = jQuery(document.activeElement).text();

    s = s_gi('wlggoretest3');
    s.linkTrackVars = 'prop1,prop2,prop3,prop4,prop5,prop6';
    s.prop1 = tempsection + ':modules';
    s.prop2 = tempsection + ':' + templocale + ':modules';
    s.prop3 = tempsection + ':modules:' + linktext;
    s.prop4 = tempsection + ':' + templocale + ':modules:' + linktext;
    s.prop5 = tempsection + ':' + temppagestart + ":" + tempassettype + ":" + temppagestem + ':modules';
    s.prop6 = tempsection + ':' + temppagestart + ":" + tempassettype + ":" + temppagestem + ':modules:' + linktext;
    s.tl(this, 'o', 'modules');

}

function jqfooter() {

    var linktext = jQuery(document.activeElement).text();

    s = s_gi('wlggoretest3');
    s.linkTrackVars = 'prop1,prop2,prop3,prop4,prop5,prop6';
    s.prop1 = tempsection + ':footer';
    s.prop2 = tempsection + ':' + templocale + ':footer';
    s.prop3 = tempsection + ':footer:' + linktext;
    s.prop4 = tempsection + ':' + templocale + ':footer:' + linktext;
    s.prop5 = tempsection + ':' + temppagestart + ":" + tempassettype + ":" + temppagestem + ':footer';
    s.prop6 = tempsection + ':' + temppagestart + ":" + tempassettype + ":" + temppagestem + ':footer:' + linktext;
    s.tl(this, 'o', 'footer');

}

//action starts here
if (typeof jQuery !== "undefined") { //make sure jQuery is available

    jQuery('#left-nav a').click(jqleftnav);  //calls the click handler function=jqleftnav for any a link clicked that is a descendent of an id=left-nav
    jQuery('#menubar a').click(jqmenubar);
    jQuery('#bread a').click(jqbread);
    jQuery('#content-area a').click(jqcontentarea);
    jQuery('.modules a').click(jqmodules);
    jQuery('#footer a').click(jqfooter);
}


//end of linktracking with jquery
//vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv



//id="track::searchresult::http://www.gore.com/en_xx/products/electronic/fuelcells/fuel_cell_technology_background.html" 


/*  another approach
  if (tempclass=='string1') {
  //do stuff
  } 
  else if(tempclass=='string2') {
  //do other stuff
  }
  else {
  }
}
*/

//end custom links




// Copy eVars to props if needed




