/* Modified for Binary Bit LAN Binary Bit Templates
*   http://binarybit.com/
*   TechSupport@binarybit.com
*   Last Update: 8 Nov 2008 13:26
*   Version 1.0.1
*
*   Copyright (c) 2007, Caridy Patino. All rights reserved.
*   Portions Copyright (c) 2007, Yahoo!, Inc. All rights reserved.
*   Code licensed under the BSD License: http://www.bubbling-library.com/eng/licence
*   version: 1.5.0
*
* Errors to fix

_handle = 'yui-cms-snap',
_className = 'yui-cms-tt',
_loadingClass = 'loading',
_status = false,
_ready = false,
_timer = null,
_delayTimer = null,
_pos = [0, 0],
_thisClassName: ClassName is use
yuiBubbling.getIt('soundid', this.contentAttributes): Sound Man Track ID: from rel tag or soundid in Style Content
_fx: Effect: popboxbrowser
yuiBubbling.getIt('lsrc', this.contentAttributes): Link Source: href or src
yuiBubbling.getIt('isrc', this.contentAttributes): Image Source:  href or src
yuiBubbling.getIt('title', this.contentAttributes): Title Tab
yuiBubbling.getIt('header', this.contentAttributes): Header, from Title Tag or header in Style Content
yuiBubbling.getIt('linkname', this.contentAttributes): Link Title from Title or linkname in Style Content
_cHeight = 0,
_cWidth = 0,
_cHeightUnit = 'px',
_cWidthUnit = 'px',
_elid: Element ID: From elid
_eltype: Element Type: div, span, a, button, input, img
_popImage = false,
_doClose = false,
_stopSound = false,
_isOnClick = false,
_frameId = null,
_count = 0,
_defConf =

*/
(function(){var yuiDom=YAHOO.util.Dom,yuiEvent=YAHOO.util.Event,yuiLang=YAHOO.lang,yuiBubbling=YAHOO.Bubbling,yuiBrowser=YAHOO.env.ua,yuiLog=YAHOO.log,yuiDomGet=YAHOO.util.Dom.get;YAHOO.widget.TooltipManager=function(){var obj={},_handle="yui-cms-snap",_className="yui-cms-tt",_loadingClass="loading",_status=false,_ready=false,_timer=null,_delayTimer=null,_pos=[0,0],_thisClassName="",_cWidth="",_cWidthUnit="",_cHeight="",_cHeightUnit="",_fx="",_popImage=false,_doClose=false,_isSoundOnClick=false,_isSoundOnRollover=false,_stopSound=false,_isOnClick=false,_frameId=null,_count=0,_defConf={autodismissdelay:5000,constraintoviewport:true,close:false,effect:null,fixedcenter:false,height:"auto",iframe:true,modal:false,opacity:1,preventoverlap:true,showdelay:200,underlay:"shadow",width:"auto",zIndex:14000};var actionControlOnRollOver=function(layer,args){_isOnClick=false;var el=obj.finder(args[1].target,true);if(yuiLang.isObject(el)){_count++;_setClassName(el);if(_thisClassName.indexOf("onclick")>-1){return}obj.check(args[0],el)}};var actionControlOnClick=function(layer,args){_isOnClick=true;var el=obj.finder(args[1].target,false);if(yuiLang.isObject(el)){_setClassName(el);switch(_thisClassName){case"yui-hastooltip":case"hastip":case"yui-tip":case"showthumbnail":return}if(_thisClassName.indexOf("onrollover")>-1){return}obj.check(args[0],el);args[1].stop=true}return true};var _setClassName=function(el){_thisClassName="";var classArr=[];if(el.className.length>0){classArr=el.className.split(" ")}_stopSound=false;_isSoundOnClick=false;_isSoundOnRollover=false;for(i=0;i<classArr.length;i++){switch(classArr[i].toLowerCase()){case"yui-hastooltip":case"hastip":case"yui-tip":if(!_isOnClick){_thisClassName="yui-tip"}break;case"popboxonrollover":if(!_isOnClick){_thisClassName="popboxonrollover";_popImage=true}break;case"showthumbnail":if(!_isOnClick){_thisClassName="showthumbnail";_popImage=true}break;case"slimbox":case"popboxonclick":if(_isOnClick){_thisClassName="popboxonclick";_popImage=true}break;case"soundonrollover":_isSoundOnRollover=true;break;case"soundonclick":_isSoundOnClick=true;if(_isOnClick){_stopSound=true}break}}return _thisClassName};var _calcPos=function(){};var _generatePath=function(path,limit){limit=limit||30;var reURI=new RegExp("^((?:http|https)://)("+document.domain+")(/.*)$","i"),reClearUri=/#.*/,uri=path||"",current=_getLocation;uri=uri.replace(reClearUri,"");current=current.replace(reClearUri,"");var m=uri.match(reURI);if(m){uri=((uri==current)?"":m[3])}if(!uri||(uri.indexOf("javascript:")===0)||(uri=="/")){uri=""}else{uri=(uri.length>limit?uri.substring(0,limit)+"...":uri)}return uri};var _getLocation=function(){if(window.location){return window.location.toString()}else{return""}};obj.handleOverlay=null;obj.element=null;obj.body="";obj.header=null;obj.footer=null;obj.onCompile=null;obj.onRender=null;obj.destructible=true;obj.contentAttributes={};obj.trackId="tt";obj.allowedOnRollOver=["hasTip","yui-hastooltip","yui-tip","showThumbnail","popBoxOnRollOver"];obj.allowedOnClick=["popBoxOnClick","slimbox"];obj.config=function(userConfig){c=userConfig||{};_defConf.autodismissdelay=(yuiLang.isNumber(c.autodismissdelay)?c.autodismissdelay:_defConf.autodismissdelay);_defConf.constraintoviewport=(yuiLang.isBoolean(c.constraintoviewport)?c.constraintoviewport:_defConf.constraintoviewport);_defConf.close=(yuiLang.isBoolean(c.close)?c.close:_defConf.close);_defConf.effect=(yuiLang.isObject(c.effect)?c.effect:_defConf.effect);_defConf.fixedcenter=(yuiLang.isBoolean(c.fixedcenter)?c.fixedcenter:_defConf.fixedcenter);_defConf.height=(yuiLang.isNumber(c.height)||yuiLang.isString(c.height)?c.height:_defConf.height);_defConf.iframe=(yuiLang.isBoolean(c.iframe)?c.iframe:_defConf.iframe);_defConf.modal=(yuiLang.isBoolean(c.modal)?c.modal:_defConf.modal);_defConf.opacity=(yuiLang.isNumber(c.opacity)?c.opacity:_defConf.opacity);_defConf.preventoverlap=(yuiLang.isBoolean(c.preventoverlap)?c.preventoverlap:_defConf.preventoverlap);_defConf.showdelay=(yuiLang.isNumber(c.showdelay)?c.showdelay:_defConf.showdelay);_defConf.underlay=(yuiLang.isString(c.underlay)?c.underlay:_defConf.underlay);_defConf.width=(yuiLang.isNumber(c.width)||yuiLang.isString(c.width)?c.width:_defConf.width);_defConf.zIndex=(yuiLang.isNumber(c.zIndex)?c.zIndex:_defConf.zIndex)};obj.init=function(){if(!_ready){_ready=true;yuiBubbling.on("rollover",actionControlOnRollOver);yuiBubbling.on("navigate",actionControlOnClick);yuiBubbling.on("key",function(layer,args){var o=args[1],ev=args[0];if((o.type=="keyup")&&(o.keyCode===27)){obj.closex()}});if(yuiBrowser.opera){obj.fixContent()}}};obj.check=function(e,el){var i=0;this.init();this.contentAttributes=yuiBubbling.loadAll(yuiBubbling.getContent(el));if(!this.contentAttributes[this.trackId]){this.setDefaults(el);this.contentAttributes[this.trackId]="1";yuiBubbling.save(el,this.contentAttributes)}if(yuiBubbling.getIt("height",this.contentAttributes)){_cHeight=parseInt(yuiBubbling.getIt("height",this.contentAttributes),10);if(_cHeight.length>0){if(_cHeight.indexOf("%")!==-1){_cHeightUnit="%"}if(_cHeight.indexOf("px")!==-1){_cHeightUnit="px"}_cHeight=parseInt(_cHeight,10)}}if(yuiBubbling.getIt("width",this.contentAttributes)){_cWidth=parseInt(yuiBubbling.getIt("width",this.contentAttributes),10);if(_cWidth.length>0){if(_cWidth.indexOf("%")!==-1){_cWidthUnit="%"}if(_cWidth.indexOf("px")!==-1){_cWidthUnit="px"}_cWidth=parseInt(_cWidth,10)}}if(!_isOnClick){_fx=""}if(this.element){if(_isOnClick){obj.dismiss()}yuiEvent.removeListener(this.element,"mouseout",obj.hide)}this.element=el;_pos=yuiEvent.getXY(e);_calcPos();_doClose=false;switch(_thisClassName){case"showthumbnail":case"popboxonrollover":case"slimbox":case"popboxonclick":_doClose=true;break;default:yuiEvent.addListener(obj.element,"mouseout",obj.dismiss,obj,true);break}this.body="";this.header=null;this.footer=null;if(!yuiLang.isFunction(this.onCompile)||!this.onCompile.apply(obj,[this.element])){this.compileBody(el)}obj.config({effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2},modal:false,fixedcenter:false,close:false,width:"auto",opacity:1});switch(_thisClassName){case"showthumbnail":obj.config({effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2},close:true,width:"auto",opacity:1});obj.thumbnail(el);break;case"slimbox":case"popboxonrollover":obj.config({effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2},modal:true,fixedcenter:true,autodismissdelay:0,close:true,width:"auto",opacity:1});obj.popBox(el);break;case"slimbox":case"popboxonclick":obj.config({effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2},modal:true,fixedcenter:true,autodismissdelay:0,close:true,width:"auto",opacity:1});obj.popBox(el);break}if((yuiLang.isString(this.body)&&(this.body!==""))||yuiLang.isString(this.header)||yuiLang.isString(this.footer)){obj.delay()}};obj.thumbnail=function(el){var img=null,xl="",theHeader="";_fx=yuiBubbling.getIt("fx",this.contentAttributes);_fx=_fx.toLowerCase();img=new Image();if(yuiBubbling.getIt("isrc",this.contentAttributes)){img.setAttribute("src",yuiBubbling.getIt("isrc",this.contentAttributes))}if(yuiBubbling.getIt("header",this.contentAttributes)){this.header=theHeader=yuiBubbling.getIt("header",this.contentAttributes)+" &nbsp; &nbsp; "}this.body='<img src="'+yuiBubbling.getIt("isrc",this.contentAttributes)+'" alt="Loading Image..." /><br />'+yuiBubbling.getIt("title",this.contentAttributes);if(yuiBubbling.getIt("lsrc",this.contentAttributes)){this.footer='<a href="'+yuiBubbling.getIt("lsrc",this.contentAttributes)+'" target="_blank">'+(!yuiBubbling.getIt("linkname",this.contentAttributes)?(!yuiBubbling.getIt("title",this.contentAttributes)?theHeader:yuiBubbling.getIt("title",this.contentAttributes)):yuiBubbling.getIt("linkname",this.contentAttributes))+"</a>"}return true};obj.popBox=function(el){yuiLog("popBox className = "+el.className,"info","YuiToolTipMan");var img=null,xl="",theHeader="";if(yuiBubbling.getIt("header",this.contentAttributes)){this.header=theHeader="&nbsp;"+yuiBubbling.getIt("header",this.contentAttributes)}_fx=yuiBubbling.getIt("fx",this.contentAttributes);_fx=_fx.toLowerCase();switch(_fx){case"lightbox":case"popbox":break;case"popboxbrowser":obj.config({effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2},modal:true,fixedcenter:true,autodismissdelay:0,close:true,width:_cWidth+_cWidthUnit,height:_cHeight+_cHeightUnit,opacity:1});this.body=yuiBubbling.getIt("lsrc",this.contentAttributes);return}img=new Image();if(yuiBubbling.getIt("isrc",this.contentAttributes)){img.setAttribute("src",yuiBubbling.getIt("isrc",this.contentAttributes))}this.body='<img src="'+yuiBubbling.getIt("isrc",this.contentAttributes)+'" alt="Loading Image..." /><br />'+yuiBubbling.getIt("title",this.contentAttributes);if(yuiBubbling.getIt("lsrc",this.contentAttributes)){this.footer='<a href="'+yuiBubbling.getIt("lsrc",this.contentAttributes)+'" target="_blank">'+(!yuiBubbling.getIt("linkname",this.contentAttributes)?(!yuiBubbling.getIt("title",this.contentAttributes)?theHeader:yuiBubbling.getIt("title",this.contentAttributes)):yuiBubbling.getIt("linkname",this.contentAttributes))+"</a>"}return true};obj.fixContent=function(){var fixArr=[],i=0,j=0;if(obj.allowedOnClick.length>0){for(i=0;i<obj.allowedOnClick.length;i++){fixArr=yuiDom.getElementsByClassName(obj.allowedOnClick[i]);for(j=0;j<fixArr.length;j++){yuiBubbling.getContent(fixArr[j])}}}if(obj.allowedOnRollOver.length>0){for(i=0;i<obj.allowedOnRollOver.length;i++){fixArr=yuiDom.getElementsByClassName(obj.allowedOnRollOver[i]);for(j=0;j<fixArr.length;j++){yuiBubbling.getContent(fixArr[j])}}}};obj.isEmptyNull=function(theValue){if(typeof theValue===undefined||typeof theValue==="undefined"||theValue===null||theValue===""){return true}return false};obj.theContent=function(theValue){var myContent=this.contentAttributes[theValue];if(this.isEmptyNull(myContent)){return""}else{return myContent}};obj.setDefaults=function(el){var reImg=/.*#/,reLink=/#.*/,ContentArr=[],i,theInnerHTML="",theRel="",theAlt="",theValue="",theLinkName="",theHeader="",theTitle="",theLinkSrc="",theImageSource="",theSoundTrackId="",theFx="";theLinkSrc=this.theContent("lsrc");theImageSource=this.theContent("isrc");theTitle=this.theContent("title");theHeader=this.theContent("header");theFx=this.theContent("fx");theLinkName=this.theContent("linkname");theSoundTrackId=this.theContent("soundid");if(this.isEmptyNull(theTitle)){theTitle=el.getAttribute("title",2)}if(!this.isEmptyNull(theTitle)){try{if(el.removeAttribute){el.removeAttribute("title")}else{el.setAttribute("title","")}}catch(e){}ContentArr=theTitle.split("::");for(i=0;i<ContentArr.length;i++){switch(i){case 0:theHeader=ContentArr[0];break;case 1:theTitle=ContentArr[1];break;case 2:theLinkName=ContentArr[2];break}}}else{theTitle=""}theAlt=el.getAttribute("alt",2);if(!this.isEmptyNull(theAlt)){try{if(el.removeAttribute){el.removeAttribute("alt")}else{el.setAttribute("alt","")}}catch(ex){}}else{theAlt=""}try{var childs=el.getElementsByTagName("img");if(childs&&(childs.length>0)){for(i=0;i<childs.length;i++){if((!theAlt||theAlt==="")&&(childs[i].alt&&childs[i].alt!=="")){theAlt=childs[i].alt||""}else{childs[i].alt=""}}}}catch(e1){}switch(el.tagName){case"A":theInnerHTML=el.innerHTML;if(this.isEmptyNull(theInnerHTML)){theInnerHTML=""}if(this.isEmptyNull(theLinkSrc)){theLinkSrc=el.getAttribute("href",2);if(this.isEmptyNull(theLinkSrc)){theLinkSrc=""}}theRel=el.getAttribute("rel",2);if(this.isEmptyNull(theRel)){theRel=""}else{if(_isSoundOnClick||_isSoundOnRollover){theSoundTrackId=theRel}else{if(this.isEmptyNull(theFx)){theFx=theRel}}}if(this.isEmptyNull(theHeader)){theHeader=theInnerHTML}if(this.isEmptyNull(theTitle)){theTitle=theLinkSrc}break;case"IMG":if(this.isEmptyNull(theImageSource)){theImageSource=el.getAttribute("src",2)}if(this.isEmptyNull(theImageSource)){theImageSource=""}if(this.isEmptyNull(theTitle)){theTitle=theImageSource||""}if(this.isEmptyNull(theHeader)){theHeader=theAlt||""}break;case"BUTTON":theValue=el.getAttribute("value",2);theInnerHTML=el.innerHTML;if(this.isEmptyNull(theImageSource)){theInnerHTML=""}if(this.isEmptyNull(theValue)){theValue=""}if(this.isEmptyNull(theTitle)){theTitle=theInnerHTML}if(this.isEmptyNull(theHeader)){theHeader=theValue||""}break;case"INPUT":theValue=el.getAttribute("value",2);theImageSource=el.getAttribute("src",2);if(this.isEmptyNull(theValue)){theValue=""}if(this.isEmptyNull(theImageSource)){theImageSource=""}if(this.isEmptyNull(theTitle)){theTitle=theValue}if(this.isEmptyNull(theHeader)){theHeader=(theAlt?theAlt:theImageSource)}break;case"DIV":case"SPAN":theInnerHTML=el.innerHTML;if(this.isEmptyNull(theImageSource)){theInnerHTML=""}if(this.isEmptyNull(theTitle)){theTitle=theInnerHTML}if(this.isEmptyNull(theHeader)){theHeader=el.id||""}break}if(!this.isEmptyNull(theHeader)){theHeader="<strong>"+theHeader+"</strong>";if(yuiBubbling.isContent){}yuiBubbling.setIt("header",theHeader,this.contentAttributes)}if(!this.isEmptyNull(theTitle)){yuiBubbling.setIt("title",theTitle,this.contentAttributes)}if(!this.isEmptyNull(theLinkName)){yuiBubbling.setIt("linkname",theLinkName,this.contentAttributes)}if(!this.isEmptyNull(theFx)){theFx=theFx.toLowerCase();yuiBubbling.setIt("fx",theFx,this.contentAttributes)}else{yuiBubbling.setIt("fx","popbox",this.contentAttributes)}if(!this.isEmptyNull(theSoundTrackId)){yuiBubbling.setIt("soundid",theSoundTrackId,this.contentAttributes)}if(!this.isEmptyNull(theLinkSrc)){if(theLinkSrc.indexOf("#")!=-1){if(theLinkSrc.length>1){theImageSource=theLinkSrc.replace(reImg,"");theLinkSrc=theLinkSrc.replace(reLink,"");el.setAttribute("href",theLinkSrc)}}else{if(_popImage){}else{}}}if(!this.isEmptyNull(theLinkSrc)){yuiBubbling.setIt("lsrc",theLinkSrc,this.contentAttributes)}if(theFx!="popboxbrowser"&&this.isEmptyNull(theImageSource)){if(!this.isEmptyNull(theLinkSrc)){theImageSource=theLinkSrc;theLinkSrc="";yuiBubbling.setIt("lsrc",theLinkSrc,this.contentAttributes);yuiBubbling.setIt("isrc",theImageSource,this.contentAttributes)}}else{yuiBubbling.setIt("isrc",theImageSource,this.contentAttributes)}return true};obj.render=function(){if(yuiLang.isObject(this.handleOverlay)&&this.destructible){this.handleOverlay.destroy()}this.destructible=true;if(!yuiLang.isFunction(YAHOO.widget.Panel)){return false}this.handleOverlay=new YAHOO.widget.Panel(_handle,{visible:false,constraintoviewport:true,zIndex:_defConf.zIndex,underlay:_defConf.underlay,modal:_defConf.modal,fixedcenter:_defConf.fixedcenter,iframe:_defConf.iframe,preventoverlap:_defConf.preventoverlap,width:_defConf.width,close:_defConf.close,context:this.element,xy:[_pos[0]+10,_pos[1]+10]});yuiDom.addClass(this.handleOverlay.element,_className);if(_defConf.close){this.handleOverlay.setHeader(" &nbsp; ");if(yuiLang.isFunction(YAHOO.util.DD)){this.handleOverlay.cfg.setProperty("dragable",true)}}if(this.body){if(_fx==="popboxbrowser"){_frameId=document.createElement("iframe");_frameId.src=this.body;if(_cWidthUnit==="%"){_frameId.width=_cWidth+_cWidthUnit}else{_frameId.width=(_cWidth-20)}if(_cHeightUnit==="%"){_frameId.height=_cHeight+_cHeightUnit}else{_frameId.height=(_cHeight-10)}this.handleOverlay.setBody(_frameId)}else{this.handleOverlay.setBody(this.body)}}if(this.header){this.handleOverlay.setHeader(this.header)}if(this.footer){this.handleOverlay.setFooter(this.footer)}if(yuiDom.inDocument(_handle)){this.handleOverlay.render()}else{this.handleOverlay.render(document.body)}if(_defConf.effect){this.handleOverlay.cfg.setProperty("effect",_defConf.effect)}this.handleOverlay.showEvent.subscribe(function(){obj.destructible=true;if(!yuiEvent.isIE||yuiBubbling.force2alfa){yuiDom.setStyle(obj.handleOverlay.element,"opacity",_defConf.opacity)}},obj,true);if(_doClose){this.handleOverlay.hideEvent.subscribe(obj.closex,obj,true)}else{this.handleOverlay.hideEvent.subscribe(function(){obj.destructible=true},obj,true)}if(yuiLang.isFunction(this.onRender)){this.onRender.apply(obj,[this.element,this.handleOverlay])}obj.show()};obj.dismiss=function(){yuiEvent.removeListener(obj.element,"mouseout",obj.dismiss);window.clearTimeout(_timer);window.clearTimeout(_delayTimer);if(!_defConf.close){obj.hide()}this.destructible=true};obj.closex=function(){if(!_doClose){return false}obj.hide();_doClose=false;if(_stopSound&&yuiBubbling.getIt("soundid",this.contentAttributes)!==""){yuiBubbling.fire("stopSound",{soundid:yuiBubbling.getIt("soundid",this.contentAttributes)})}if(yuiLang.isObject(this.handleOverlay)){this.handleOverlay.destroy()}this.handleOverlay=null;this.destructible=true;return true};obj.delay=function(){window.clearTimeout(_timer);window.clearTimeout(_delayTimer);if(!this.destructible){if(yuiLang.isObject(this.handleOverlay)){this.handleOverlay.hideEvent.subscribe(obj.delay,obj,true);this.handleOverlay.showEvent.subscribe(obj.delay,obj,true)}}else{_delayTimer=window.setTimeout(function(){obj.render()},_defConf.showdelay)}};obj.show=function(){if(this.handleOverlay&&this.element){this.destructible=false;this.handleOverlay.show();if(yuiLang.isNumber(_defConf.autodismissdelay)&&(_defConf.autodismissdelay>0)){window.clearTimeout(_timer);_timer=window.setTimeout(function(){obj.dismiss()},Math.abs(_defConf.autodismissdelay))}}};obj.hide=function(){if(this.handleOverlay&&this.element){this.handleOverlay.hide()}};obj.compilePath=function(uri,limit){return _generatePath(uri,limit)};obj.compileBody=function(el){if(yuiBubbling.getIt("header",this.contentAttributes)){this.header=yuiBubbling.getIt("header",this.contentAttributes)}if(yuiBubbling.getIt("title",this.contentAttributes)){this.body=yuiBubbling.getIt("title",this.contentAttributes)}};obj.finder=function(el,isRollOver){var classOwner=null;if(isRollOver){if(obj.allowedOnRollOver.length>0){for(i=0;i<obj.allowedOnRollOver.length;i++){classOwner=yuiBubbling.getOwnerByClassName(el,obj.allowedOnRollOver[i]);if(classOwner){return classOwner}}}}else{if(obj.allowedOnClick.length>0){for(i=0;i<obj.allowedOnClick.length;i++){classOwner=yuiBubbling.getOwnerByClassName(el,obj.allowedOnClick[i]);if(classOwner){return classOwner}}}}return null};yuiEvent.onDOMReady(obj.init,obj,true);return obj}()})();YAHOO.register("tooltipmanager",YAHOO.widget.TooltipManager,{version:"1.5.0",build:"213"});
