if (!window.org) org = {}
if (!org.healthwise) org.healthwise = {};
if (!org.healthwise.analytics) org.healthwise.analytics = {};


if (!org.healthwise.analytics.track) {
    org.healthwise.analytics.track = function(request) {
        // do nothing by default- may be overwritten by subsequent includes
    }
}

org.healthwise.analytics.PageViewed = (function() {

    function PageViewed(documentHwid, documentType, documentTitle, documentLocalization, sectionHwid, sectionTitle) {
        this._documentHwid = documentHwid;
        this._documentType = documentType;
        this._documentTitle = documentTitle;
        this._documentLocalization = documentLocalization;

        if (sectionHwid != undefined) {
            this._sectionHwid = sectionHwid; //optional
        }
        else this._sectionHwid = "";

        if (sectionHwid != undefined) {
            this._sectionTitle = sectionTitle; //optional
        }
        else this._sectionTitle = "";
    }

    PageViewed.prototype.isPageView = function() {
        return true;
    }

    PageViewed.prototype.type = function() {
        return "org.healthwise.analytics.PageViewed";
    }
       
    PageViewed.prototype.documentHwid = function() {
        return this._documentHwid;
    }

    PageViewed.prototype.documentType = function() {
        return this._documentType;
    }

    PageViewed.prototype.documentTitle = function() {
        return this._documentTitle;
    }

    PageViewed.prototype.documentLocalization = function() {
        return this._documentLocalization;
    }

    PageViewed.prototype.sectionHwid = function() {
        return this._sectionHwid;
    }

    PageViewed.prototype.sectionTitle = function() {
        return this._sectionTitle;
    }

    PageViewed.prototype.toString = function() {
        return "PageViewed:\n" +
 			"   document hwid : " + this._documentHwid + "\n" +
 			"   document type : " + this._documentType + "\n" +
 			"   document localization : " + this._documentLocalization + "\n" +
 			"   document title : " + this._documentTitle + "\n" +
 			"   section hwid : " + this._sectionHwid + "\n" +
 			"   section title : " + this._sectionTitle + "\n";
    }

    return PageViewed;
})();

org.healthwise.analytics.PdfViewed = (function() {

    function PdfViewed(documentHwid, documentTitle, documentLocalization) {
        this._documentHwid = documentHwid;
        this._documentTitle = documentTitle;
        this._documentLocalization = documentLocalization;
    }

    PdfViewed.prototype.isPdfView = function() {
        return true;
    }

    PdfViewed.prototype.type = function() {
        return "org.healthwise.analytics.PdfViewed";
    }
    
    PdfViewed.prototype.documentHwid = function() {
        return this._documentHwid;
    }

    PdfViewed.prototype.documentTitle = function() {
        return this._documentTitle;
    }

    PdfViewed.prototype.documentLocalization = function() {
        return this._documentLocalization;
    }

    PdfViewed.prototype.toString = function() {
        return "PdfViewed:\n" +
 			"   document hwid : " + this._documentHwid + "\n" +
 			"   document localization : " + this._documentLocalization + "\n" +
 			"   document title : " + this._documentTitle + "\n";
    }

    return PdfViewed;
})();

org.healthwise.analytics.DocumentPrinted = (function() {

    function DocumentPrinted(documentHwid, documentType, documentTitle, documentLocalization) {
        this._documentHwid = documentHwid;
        this._documentTitle = documentTitle;
        this._documentType = documentType;
        this._documentLocalization = documentLocalization;
    }

    DocumentPrinted.prototype.isDocumentPrinted = function() {
        return true;
    }

    DocumentPrinted.prototype.type = function() {
        return "org.healthwise.analytics.DocumentPrinted";
    }
    
    DocumentPrinted.prototype.documentHwid = function() {
        return this._documentHwid;
    }

    DocumentPrinted.prototype.documentTitle = function() {
        return this._documentTitle;
    }

    DocumentPrinted.prototype.documentType = function() {
        return this._documentType;
    }

    DocumentPrinted.prototype.documentLocalization = function() {
        return this._documentLocalization;
    }

    DocumentPrinted.prototype.toString = function() {
        return "DocumentPrinted:\n" +
 			"   document hwid : " + this._documentHwid + "\n" +
 			"   document type : " + this._documentType + "\n" +
 			"   document localization : " + this._documentLocalization + "\n" +
 			"   document title : " + this._documentTitle + "\n";
    }

    return DocumentPrinted;
})();

org.healthwise.analytics.CategoryViewed = (function() {

    function CategoryViewed(categoryName) {
        this._category = categoryName;
    }

    CategoryViewed.prototype.isCategoryViewed = function() {
        return true;
    }

    CategoryViewed.prototype.type = function() {
        return "org.healthwise.analytics.CategoryViewed";
    }

    CategoryViewed.prototype.category = function() {
        return this._category;
    }

    CategoryViewed.prototype.toString = function() {
        return "CategoryViewed:\n" +
 			"   category : " + this._category + "\n";
    }

    return CategoryViewed;
})();

org.healthwise.analytics.ListViewed = (function() {

    function ListViewed(letter, filter) {
        this._letter = letter;
        if (filter != undefined) {
            this._filter = filter; // optional
        }
        else this._filter = "";
    }

    ListViewed.prototype.isListViewed = function() {
        return true;
    }

    ListViewed.prototype.type = function() {
        return "org.healthwise.analytics.ListViewed";
    }

    ListViewed.prototype.letter = function() {
        return this._letter;
    }

    ListViewed.prototype.filter = function() {
        return this._filter;
    }

    ListViewed.prototype.toString = function() {
        return "ListViewed:\n" +
 			"   letter : " + this._letter + "\n" +
 			"   filter : " + this._filter + "\n";
    }

    return ListViewed;
})();

org.healthwise.analytics.Search = (function() {

    function Search(term, numberOfResults, conceptMatch, matchType, filter) {
        this._term = term;
        this._numberOfResults = numberOfResults;
        this._conceptMatch = conceptMatch;
        this._matchType = matchType;
        if (filter != undefined) {
            this._filter = filter; // optional
        }
        else this._filter = "";
    }

    Search.prototype.isSearch = function() {
        return true;
    }

    Search.prototype.type = function() {
        return "org.healthwise.analytics.Search";
    }
    
    Search.prototype.term = function() {
        return this._term;
    }

    Search.prototype.numberOfResults = function() {
        return this._numberOfResults;
    }

    Search.prototype.conceptMatch = function() {
        return this._conceptMatch;
    }

    Search.prototype.matchType = function() {
        return this._matchType;
    }

    Search.prototype.filter = function() {
        return this._filter;
    }

    Search.prototype.toString = function() {
        return "Search:\n" +
 			"   term : " + this._term + "\n" +
 			"   numberOfResults : " + this._numberOfResults + "\n" +
 			"   conceptMatch : " + this._conceptMatch + "\n" +
 			"   matchType : " + this._matchType + "\n" +
 			"   filter : " + this._filter + "\n";
    }

    return Search;
})();

org.healthwise.analytics.DocumentSurveyed = (function() {

    function DocumentSurveyed(question, response, documentHwid, documentType, documentTitle, documentLocalization, sectionHwid, sectionTitle, feedbackText) {
        this._question = question;
        this._response = response;
        this._documentHwid = documentHwid;
        this._documentType = documentType;
        this._documentTitle = documentTitle;
        this._documentLocalization = documentLocalization;
        this._feedbackText = feedbackText;

        if (sectionHwid != undefined) {
            this._sectionHwid = sectionHwid; //optional
        }
        else this._sectionHwid = "";

        if (sectionHwid != undefined) {
            this._sectionTitle = sectionTitle; //optional
        }
        else this._sectionTitle = "";

        if (feedbackText != undefined) {
            this._feedbackText = feedbackText; //optional
        }
        else this._feedbackText = "";
    }

    DocumentSurveyed.prototype.isDocumentSurveyed = function() {
        return true;
    }

    DocumentSurveyed.prototype.type = function() {
        return "org.healthwise.analytics.DocumentSurveyed";
    }

    DocumentSurveyed.prototype.question = function() {
        return this._question;
    }

    DocumentSurveyed.prototype.response = function() {
        return this._response;
    }

    DocumentSurveyed.prototype.documentHwid = function() {
        return this._documentHwid;
    }

    DocumentSurveyed.prototype.documentType = function() {
        return this._documentType;
    }

    DocumentSurveyed.prototype.documentTitle = function() {
        return this._documentTitle;
    }

    DocumentSurveyed.prototype.documentLocalization = function() {
        return this._documentLocalization;
    }

    DocumentSurveyed.prototype.sectionHwid = function() {
        return this._sectionHwid;
    }

    DocumentSurveyed.prototype.sectionTitle = function() {
        return this._sectionTitle;
    }

    DocumentSurveyed.prototype.feedbackText = function() {
        return this._feedbackText;
    }

    DocumentSurveyed.prototype.toString = function() {
        return "DocumentSurveyed:\n" +
 		  "   question : " + this._question + "\n" +
 		  "   response : " + this._response + "\n" +
 			"   document hwid : " + this._documentHwid + "\n" +
 			"   document type : " + this._documentType + "\n" +
 			"   document localization : " + this._documentLocalization + "\n" +
 			"   document title : " + this._documentTitle + "\n" +
 			"   section hwid : " + this._sectionHwid + "\n" +
 			"   section title : " + this._sectionTitle + "\n" +
 			"   feedback text : " + this._feedbackText + "\n";
    }

    return DocumentSurveyed;
})();

org.healthwise.analytics.IToolTransitioned = (function() {

    function IToolTransitioned(name, stage) {
        this._name = name;
        this._stage = stage;
    }

    IToolTransitioned.prototype.isIToolTransitioned = function() {
        return true;
    }

    IToolTransitioned.prototype.type = function() {
        return "org.healthwise.analytics.IToolTransitioned";
    }
    
    IToolTransitioned.prototype.name = function() {
        return this._name;
    }

    IToolTransitioned.prototype.stage = function() {
        return this._stage;
    }

    IToolTransitioned.prototype.toString = function() {
        return "IToolTransitioned:\n" +
 			"   name : " + this._name + "\n" +
 			"   stage : " + this._stage + "\n";
    }

    return IToolTransitioned;
})();

org.healthwise.analytics.SlideShowViewed = (function() {

    function SlideShowViewed(documentTitle, totalNumberOfSlides, numberOfSlidesViewed) {
        this._documentTitle = documentTitle;
        this._totalNumberOfSlides = totalNumberOfSlides;
        this._numberOfSlidesViewed = numberOfSlidesViewed;
    }

    SlideShowViewed.prototype.isSlideShowViewed = function() {
        return true;
    }

    SlideShowViewed.prototype.type = function() {
        return "org.healthwise.analytics.SlideShowViewed";
    }
    
    SlideShowViewed.prototype.documentTitle = function() {
        return this._documentTitle;
    }

    SlideShowViewed.prototype.totalNumberOfSlides = function() {
        return this._totalNumberOfSlides;
    }

    SlideShowViewed.prototype.numberOfSlidesViewed = function() {
        return this._numberOfSlidesViewed;
    }

    SlideShowViewed.prototype.toString = function() {
        return "SlideShowViewed:\n" +
 			"   documentTitle : " + this._documentTitle + "\n" +
 			"   totalNumberOfSlides : " + this._totalNumberOfSlides + "\n" +
 			"   numberOfSlidesViewed : " + this._numberOfSlidesViewed + "\n";
    }

    return SlideShowViewed;
})();

org.healthwise.analytics.HomePageVisited = (function() {

    function HomePageVisited() {
    }

    HomePageVisited.prototype.isHomePageVisited = function() {
        return true;
    }

    HomePageVisited.prototype.type = function() {
        return "org.healthwise.analytics.HomePageVisited";
    }
    
    HomePageVisited.prototype.toString = function() {
        return "HomePageVisited:\n";
    }

    return HomePageVisited;
})();

org.healthwise.analytics.DecisionPointTabSelected = (function() {

    function DecisionPointTabSelected(documentHwid, documentTitle, tabTitle, tabNumber) {
        this._documentHwid = documentHwid;
        this._documentTitle = documentTitle;
        this._tabTitle = tabTitle;
        this._tabNumber = tabNumber;
    }

    DecisionPointTabSelected.prototype.isDecisionPointTabSelected = function() {
        return true;
    }

    DecisionPointTabSelected.prototype.type = function() {
        return "org.healthwise.analytics.DecisionPointTabSelected";
    }
    
    DecisionPointTabSelected.prototype.documentHwid = function() {
        return this._documentHwid;
    }

    DecisionPointTabSelected.prototype.documentTitle = function() {
        return this._documentTitle;
    }

    DecisionPointTabSelected.prototype.tabTitle = function() {
        return this._tabTitle;
    }

    DecisionPointTabSelected.prototype.tabNumber = function() {
        return this._tabNumber;
    }

    DecisionPointTabSelected.prototype.toString = function() {
        return "DecisionPointTabSelected:\n" +
            "   documentHwid : " + this._documentHwid + "\n" +
 			"   documentTitle : " + this._documentTitle + "\n" +
 			"   tabTitle : " + this._tabTitle + "\n" +
 			"   tabNumber : " + this._tabNumber + "\n";
    }

    return DecisionPointTabSelected;
})();

org.healthwise.analytics.DecisionPointTabAway = (function() {

    function DecisionPointTabAway(documentHwid, documentTitle, tabTitle, tabNumber, linkLevelKeyValues, linkTrackedVariables) {
        this._documentHwid = documentHwid;
        this._documentTitle = documentTitle;
        this._tabTitle = tabTitle;
        this._tabNumber = tabNumber;
        this._linkLevelKeyValues = linkLevelKeyValues;
        this._linkTrackedVariables = linkTrackedVariables;
    }

    DecisionPointTabAway.prototype.isDecisionPointTabAway = function() {
        return true;
    }

    DecisionPointTabAway.prototype.type = function() {
        return "org.healthwise.analytics.DecisionPointTabAway";
    }
    
    DecisionPointTabAway.prototype.documentHwid = function() {
        return this._documentHwid;
    }

    DecisionPointTabAway.prototype.documentTitle = function() {
        return this._documentTitle;
    }

    DecisionPointTabAway.prototype.tabTitle = function() {
        return this._tabTitle;
    }

    DecisionPointTabAway.prototype.tabNumber = function() {
        return this._tabNumber;
    }

    DecisionPointTabAway.prototype.linkLevelKeyValues = function() {
        return this._linkLevelKeyValues;
    }

    DecisionPointTabAway.prototype.linkTrackedVariables = function() {
        return this._linkTrackedVariables;
    }


    DecisionPointTabAway.prototype.toString = function() {
        var details = "DecisionPointTabAway:\n" +
            "   documentHwid : " + this._documentHwid + "\n" +
 			"   documentTitle : " + this._documentTitle + "\n" +
 			"   tabTitle : " + this._tabTitle + "\n" +
 			"   tabNumber : " + this._tabNumber + "\n" +
            "   linkLevelKeyValues : \n";
        for (var i = 0; i < this._linkLevelKeyValues.length; i++) {
            details = details + "     property : [" + this._linkLevelKeyValues[i].name + "] value [" + this._linkLevelKeyValues[i].value + "]\n";
        }
        details = details + "   linkLevelVariables : " + this._linkTrackedVariables + "\n";
        return details;
    }

    return DecisionPointTabAway;
})();

org.healthwise.analytics.DecisionPointAccessibilityModeSelected = (function() {

    function DecisionPointAccessibilityModeSelected(documentHwid, documentTitle, description) {
        this._documentHwid = documentHwid;
        this._documentTitle = documentTitle;
        this._description = description;
    }

    DecisionPointAccessibilityModeSelected.prototype.isDecisionPointAccessibilityModeSelected = function() {
        return true;
    }

    DecisionPointAccessibilityModeSelected.prototype.type = function() {
        return "org.healthwise.analytics.DecisionPointAccessibilityModeSelected";
    }
    
    DecisionPointAccessibilityModeSelected.prototype.documentHwid = function() {
        return this._documentHwid;
    }

    DecisionPointAccessibilityModeSelected.prototype.documentTitle = function() {
        return this._documentTitle;
    }

    DecisionPointAccessibilityModeSelected.prototype.description = function() {
        return this._description;
    }

    DecisionPointAccessibilityModeSelected.prototype.toString = function() {
        return "DecisionPointAccessibilityModeSelected:\n" +
 			"   documentHwid : " + this._documentHwid + "\n" +
 			"   documentTitle : " + this._documentTitle + "\n" +
 			"   description : " + this._description + "\n";
    }

    return DecisionPointAccessibilityModeSelected;
})();

org.healthwise.analytics.DecisionPointSummaryPrinted = (function() {

    function DecisionPointSummaryPrinted(documentHwid, documentTitle) {
        this._documentHwid = documentHwid;
        this._documentTitle = documentTitle;
    }

    DecisionPointSummaryPrinted.prototype.isDecisionPointSummaryPrinted = function() {
        return true;
    }

    DecisionPointSummaryPrinted.prototype.type = function() {
        return "org.healthwise.analytics.DecisionPointSummaryPrinted";
    }
    
    DecisionPointSummaryPrinted.prototype.documentHwid = function() {
        return this._documentHwid;
    }

    DecisionPointSummaryPrinted.prototype.documentTitle = function() {
        return this._documentTitle;
    }

    DecisionPointSummaryPrinted.prototype.toString = function() {
        return "DecisionPointSummaryPrinted:\n" +
 			"   documentHwid : " + this._documentHwid + "\n" +
 			"   documentTitle : " + this._documentTitle + "\n";
    }

    return DecisionPointSummaryPrinted;
})();  
