/* TODO: copy coremetrics tagging from groupbanking module */
var cmElementTags = {
    /* <id of actionable drawer toggle>: {elementId: <element id>, elementCategory: <element category>}, */
   // Chatonline:                         {elementId: "Chatonline", elementCategory: "Deposits:Marketing:InterestChecking"}

}

var cmPageViewTags = {
    // <bac_state>:
  defaultCase:    { pageId:"Dep:Mkt:Checking;GetMore", categoryId:"Dep;Mkt;Checking" }
}

var bac_state = jimAuld.utils.cookies.get('state');
var pvkey = (bac_state !== null && typeof(cmPageViewTags[bac_state]) !== 'undefined') ? bac_state : "defaultCase";

function getPageId(){
    return cmPageViewTags[pvkey]['pageId'];
}

function getCategoryId(){
    return cmPageViewTags[pvkey]['categoryId'];
}

function initCmElementEvents(){
    // attach each pageElement tag to it's associated element
    for(elementId in cmElementTags){
        //alert($(elementId).inspect());
        if ($(elementId)) {
            $(elementId).observe('click', function(event) {
                //alert(cmElementTags[this.id]['elementId'] +" " + cmElementTags[this.id]['elementCategory']);
                cmCreatePageElementTag(cmElementTags[this.id]['elementId'], cmElementTags[this.id]['elementCategory']);
            });
        }
    }
}


/*
    //Element: Print action
    $$('.print').invoke('observe', 'click', function()
    {
        cmCreateManualLinkClickTag(href, linkName, pageID);
        alert()
    });
 */