//// bubble help JS
(function(){
    var cityCenterPopup = {
        openHelp:null,
        content:null,
        pElement:null,
        initialize:function() {

            yuiEvent.addListener(yuiDom.getElementsByClassName('bubblehelpClose'),'click',function(e) {
                SW.widget.CityCenterPopup.fnClosebubble();
                yuiEvent.stopPropagation(e);
            });
            yuiDom.getElementsByClassName('cityCenterBlock').forEach(function(el){
                yuiEvent.addListener(el,"click",function(e,element){
                    SW.widget.CityCenterPopup.fnDisplayBubble(element);
                },el);
            });

        },
        fnDisplayBubble:function(el) {
            var self = cityCenterPopup;
            var loSearchHelpDiv = yuiDom.get("bubbleHelpDiv");
            loSearchHelpDiv.parentNode.removeChild(loSearchHelpDiv);
            el.appendChild(loSearchHelpDiv);
        // write the bubble help
            messageHeadDiv = yuiDom.get('bubblehelpHeader');
            if(document.layers){
                text2 = self.content;
                messageHeadDiv.document.open();
                messageHeadDiv.document.write(text2);
                messageHeadDiv.document.close();
                messageDiv.document.close();
            } else {
                messageHeadDiv.innerHTML = self.content;
            }
            loSearchHelpDiv.style.display = 'inline';
        },
        fnClosebubble:function() {
            var loSearchHelpDiv = yuiDom.get("bubbleHelpDiv");
            loSearchHelpDiv.style.display = 'none';
        }
    };
    yuiEvent.onDOMReady(cityCenterPopup.initialize,cityCenterPopup,true);
    SW.widget.CityCenterPopup = cityCenterPopup;
})();
