﻿function CallOut(co_a){var co_=this;co_.co_am='px';co_.co_t='';co_.co_b=null;co_.co_l=null;co_.co_z=false;co_.co_bt=true;co_.co_bm=co_a['ev']?co_a['ev']:'';co_.co_bs=co_a['ah']!="undefined"?co_a['ah']:true;co_.co_ax=co_a['aht']?co_a['aht']:5000;co_.co_ae=co_a['ti']?co_a['ti']:1000;co_.co_bb=false;co_.co_s=co_a['cop']!=null?co_a['cop']:0.5;co_.co_br=co_a['w']?co_a['w']:200;co_.co_i=co_a['p']?co_a['p']:'right';co_.co_cd=co_a['ml']?co_a['ml']:0;co_.co_ca=co_a['so']?co_a['so']:0;co_.co_o=co_a['pre']?co_a['pre']:'co_';co_.co_y=co_a['ps']?co_a['ps']:'lg';co_.co_aq=co_a['nbtn']?co_a['nbtn']:null;if(!co_a['id']){co_.co_ar('callout: no id');}else{co_.co_bq=co_a['id'];};if(!co_a['co']){}else{co_.co_bv=co_a['co'];};if(!co_a['o']){co_.co_ar('callout: no parent element');}else{if(typeof co_a['o']=='string'){co_.co_ad=co_a['o'];co_.co_g=document.getElementById(co_a['o']);}else if(typeof co_a['o']=='object'){co_.co_ad=co_a['o'].id;co_.co_g=co_a['o'];}else{co_.co_ar('callout: no parent element');};};co_.co_v=11;co_.co_ai=25+9;co_.co_bp=11;co_.co_bl=25+9;/*co_.co_cb=StationDashboard.CallOut;*/co_.co_ah=false;};CallOut.prototype.co_ag=function(co_ay){var co_=this;co_ay=co_ay.value;if(co_ay){co_.render();co_.co_bg.innerHTML=co_ay;co_.show();}else{};};CallOut.prototype.getContent=function(_sFunc){var co_=this;co_.co_cb[_sFunc](co_.co_ag.bind(co_));};CallOut.prototype.co_ar=function(sString){var co_=this;co_.co_bt=false;};CallOut.prototype.co_at=function(_sType,_sClassName){var co_ak;if(typeof _sType=='undefined'){co_.co_ar('callout: can\'t create callout');return;};co_ak=document.createElement(_sType);if(typeof _sClassName=='string'){co_ak.className=_sClassName;};return co_ak;};CallOut.prototype.co_af=function(_sLocation){var co_=this;switch(_sLocation){case'top':co_.co_i='top';co_.co_t=co_.co_o+'pnt_'+co_.co_y+'_b';break;case'bottom':co_.co_i='bottom';co_.co_t=co_.co_o+'pnt_'+co_.co_y+'_t';break;case'left':co_.co_i='left';co_.co_t=co_.co_o+'pnt_'+co_.co_y+'_r';break;case'right':default:co_.co_i='right';co_.co_t=co_.co_o+'pnt_'+co_.co_y+'_l';};if(co_.co_l!=null){co_.co_l.className=co_.co_ac();};};CallOut.prototype.co_ac=function(){var co_=this;return co_.co_o+'pnt '+co_.co_t;};CallOut.prototype.show=function(){var co_=this;if(co_.co_g==undefined||co_.co_g==null){co_.co_g=document.getElementById(co_.co_ad);};if(!co_.co_ah){co_.render();};document.getElementById(co_.co_bq).style.display='';co_.co_ab();if(co_.co_bb){co_.co_bx();};if(co_.co_bs==true){setTimeout(function(){co_.hide()},co_.co_ax);};};CallOut.prototype.showByID=function(_sID){var co_=this;co_.co_ad=_sID;co_.co_g=document.getElementById(co_.co_ad);co_.show();};CallOut.prototype.hide=function(){var co_=this;if(co_.co_bb){co_.co_bx();};document.getElementById(co_.co_bq).style.display='none';};CallOut.prototype.co_bx=function(){var co_=this,co_k=co_.co_b.getAttribute('op'),co_j=co_.co_b.getAttribute('ti'),co_cc=co_.co_b.style.opacity;if(co_k==1||co_k==-1){co_k=co_k==1?-1:1;co_j=co_.co_ae-co_j;co_.co_b.setAttribute('op',co_k);co_.co_b.setAttribute('ti',co_j);}else{co_k=co_k==2?-1:1;co_j=co_.co_ae;co_.co_b.setAttribute('op',co_k);co_.co_b.setAttribute('ti',co_j);setTimeout(function(){co_.co_bi(new Date().getTime());},33);};};CallOut.prototype.co_bi=function(_iLastTick){var co_=this,co_av=new Date().getTime(),co_bj=co_av-_iLastTick,co_j=co_.co_b.getAttribute('ti'),co_n=0;if(co_j<=co_bj){co_.co_b.style.opacity=co_.co_b.getAttribute('op')==1?'1':'0';co_.co_b.style.filter='alpha(opacity = '+(co_.co_b.getAttribute('op')==1?'100':'0')+')';co_.co_b.setAttribute('op',(co_.co_b.getAttribute('op')==1?2:-2));return;};co_.co_b.setAttribute('ti',co_j-co_bj);co_n=co_.co_b.getAttribute('ti')/co_.co_ae;if(co_.co_b.getAttribute('op')==1){co_n=1-co_n;};co_.co_b.style.opacity=co_n;co_.co_b.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity = '+parseInt(co_n*100)+')';co_.co_b.style.filter='alpha(opacity = '+parseInt(co_n*100)+')';setTimeout(function(){co_.co_bi(co_av);},33);};CallOut.prototype.toggle=function(){var co_=this,co_ak=document.getElementById(co_.co_bq);if(co_ak.style.display=='none'){co_ak.style.display='';}else{co_ak.style.display='none';};};CallOut.prototype.next=function(_oCallOutNext){var co_=this;co_.hide();if(_oCallOutNext!=null&&typeof _oCallOutNext!="undefined"){_oCallOutNext.show();};};CallOut.prototype.co_ba=function(){var co_=this,co_az=document.body?document.body:document,co_bf=co_az.scrollTop?co_az.scrollTop:0,co_be=co_az.scrollLeft?co_az.scrollLeft:0,co_bo=0,co_bn=0,co_m;for(co_m=co_.co_g;co_m;co_m=co_m.offsetParent){if(co_m.offsetLeft){co_bo+=co_m.offsetLeft;};if(co_m.offsetTop){co_bn+=co_m.offsetTop;};};co_bo+=co_be;co_bn+=co_bf;return{'left':co_bo,'top':co_bn};};CallOut.prototype.co_bk=function(){var co_=this,co_bd=co_.co_ba(co_.co_g),co_bz=co_.co_g.offsetWidth,co_bu=co_.co_g.offsetHeight;return{'left':co_bd.left,'top':co_bd.top,'width':co_bz,'height':co_bu};};CallOut.prototype.co_aa=function(){var co_=this,co_d=co_.co_bk(),co_ao=0,co_as=0,co_f=function(_sStr){return parseInt(_sStr);};switch(co_.co_i){case'top':if(co_.co_z==false&&co_.co_b.offsetHeight>co_d.top){co_.co_z=true;co_.co_af('bottom');return co_.co_aa();};co_ao=co_d.left-10-10-co_f(co_.co_l.offsetWidth/2)+co_f(co_d.width*co_.co_s)+co_.co_am;co_as=co_d.top-co_.co_b.offsetHeight-10+co_.co_am;break;case'bottom':co_ao=co_d.left-10-10-co_f(co_.co_l.offsetWidth/2)+co_f(co_d.width*co_.co_s)+co_.co_am;co_as=co_d.top+co_d.height+co_.co_l.offsetHeight-5+co_.co_am;break;case'left':if(co_.co_z==false&&co_.co_b.offsetWidth>co_d.left){co_.co_z=true;co_.co_af('right');return co_.co_aa();};co_ao=co_d.left-co_f(co_.co_br)-co_.co_ai+co_.co_am;co_as=co_d.top+co_f(co_.co_s*co_d.height)-co_f(co_.co_l.offsetHeight/2)-co_.co_v+co_.co_am;break;case'right':default:co_ao=co_d.left+co_d.width+co_.co_am;co_as=co_d.top+co_f(co_.co_s*co_d.height)-co_f(co_.co_l.offsetHeight/2)-co_.co_v+co_.co_am;break;};return{'left':co_ao,'top':co_as};};CallOut.prototype.co_ab=function(){var co_=this,co_by=co_.co_aa();co_.co_b.style.left=co_by.left;co_.co_b.style.top=co_by.top;};CallOut.prototype.co_e=function(sClassName){var co_=this;return co_.co_o+sClassName;};CallOut.prototype.co_al=function(){var co_=this,co_bh=co_.co_bm;switch(co_bh){case'mouseover':co_.co_g.onmouseover=function(){co_.co_g.style.cursor='pointer';co_.show();};co_.co_g.onmouseout=function(){co_.hide();};co_.co_b.onmouseover=function(){co_.show();};co_.co_b.onmouseout=function(){co_.hide();};co_.co_l.onmouseover=function(){co_.show();};co_.co_l.onmouseout=function(){co_.hide();};break;case'click':co_.co_g.onclick=function(){co_.show();};};};CallOut.prototype.updateContent=function(_sContent){var co_=this;co_.co_q.innerHTML=_sContent;};CallOut.prototype.render=function(){var co_=this;if(co_.co_bt&&!co_.co_ah){var co_x='div',co_ce='a',co_c=co_.co_at,co_h,co_r,co_ap,co_p,co_cf,co_au,co_q,co_aj,co_aw,co_w,co_an='';co_.co_af(co_.co_i);co_an=co_.co_ac();co_h=co_c(co_x,co_.co_e('outer'));co_h.id=co_.co_bq;co_h.style.width=co_.co_br;co_r=co_c(co_x,co_.co_e('inner'));co_ap=co_c(co_x,co_.co_e('t'));co_p=co_c(co_x,co_.co_e('content'));co_au=co_c(co_ce,co_.co_e('close'));co_q=co_c(co_x);co_.co_q=co_q;co_aj=co_c(co_x,co_.co_e('b'));co_aw=co_c(co_x);co_w=co_c(co_x,co_an);co_w.id=co_.co_bq+'_pnt';co_au.onclick=function(){co_.hide();};co_p.appendChild(co_au);co_q.innerHTML=co_.co_bv;co_.co_bg=co_q;co_p.appendChild(co_q);if(co_.co_aq!=null){var co_bc=co_c(co_x,co_.co_e('nb'));co_bc.innerHTML=co_.co_aq;co_p.appendChild(co_bc);};co_r.appendChild(co_ap);co_r.appendChild(co_p);co_aj.appendChild(co_aw);var co_u;co_u=co_c(co_x);co_u.appendChild(co_r);co_u.appendChild(co_aj);co_u.appendChild(co_w);co_h.appendChild(co_u);co_.co_g.parentNode.appendChild(co_h);co_.co_b=co_h;co_.co_l=co_w;co_.co_al();if(typeof window.onresize=='function'){var co_bw=window.onresize;window.onresize=function(){co_bw();co_.co_ab();};}else{window.onresize=function(){co_.co_ab();};};co_h.style.display='none';if(document.firstChild.nodeValue!=null){if(document.firstChild.nodeValue.indexOf('XHTML')==-1){co_ap.style.height='1000px';co_ap.style.backgroundRepeat="no-repeat";co_r.style.zoom='1';co_r.style.overflowY='hidden';};};if(co_.co_bb){co_h.setAttribute('op',-2);co_h.setAttribute('ti',co_.co_ae);co_h.style.opacity=0;};co_.co_ah=true;};};

