
var YAHOO=function(){return{util:{},widget:{},example:{},namespace:function(sNameSpace){if(!sNameSpace||!sNameSpace.length){return null;}
var levels=sNameSpace.split(".");var currentNS=YAHOO;for(var i=(levels[0]=="YAHOO")?1:0;i<levels.length;++i){currentNS[levels[i]]=currentNS[levels[i]]||{};currentNS=currentNS[levels[i]];}
return currentNS;}};}();YAHOO.util.Dom=new function(){this.get=function(el){if(typeof el=='string'){el=document.getElementById(el);}
return el;};this.getStyle=function(el,property){var value=null;var dv=document.defaultView;el=this.get(el);if(property=='opacity'&&el.filters){value=1;try{value=el.filters.item('DXImageTransform.Microsoft.Alpha').opacity/100;}catch(e){try{value=el.filters.item('alpha').opacity/100;}catch(e){}}}
else if(el.style[property]){value=el.style[property];}
else if(el.currentStyle&&el.currentStyle[property]){value=el.currentStyle[property];}
else if(dv&&dv.getComputedStyle)
{var converted='';for(i=0,len=property.length;i<len;++i){if(property.charAt(i)==property.charAt(i).toUpperCase()){converted=converted+'-'+property.charAt(i).toLowerCase();}else{converted=converted+property.charAt(i);}}
if(dv.getComputedStyle(el,'').getPropertyValue(converted)){value=dv.getComputedStyle(el,'').getPropertyValue(converted);}}
return value;};this.setStyle=function(el,property,val){el=this.get(el);switch(property){case'opacity':if(el.filters){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle.hasLayout){el.style.zoom=1;}}else{el.style.opacity=val;el.style['-moz-opacity']=val;el.style['-khtml-opacity']=val;}
break;default:el.style[property]=val;}};this.getXY=function(el){el=this.get(el);if(el.parentNode===null||this.getStyle(el,'display')=='none'){return false;}
var parent=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;var scrollLeft=document.documentElement.scrollLeft||document.body.scrollLeft;return[box.left+scrollLeft,box.top+scrollTop];}
else if(document.getBoxObjectFor){box=document.getBoxObjectFor(el);pos=[box.x,box.y];}
else{pos=[el.offsetLeft,el.offsetTop];parent=el.offsetParent;if(parent!=el){while(parent){pos[0]+=parent.offsetLeft;pos[1]+=parent.offsetTop;parent=parent.offsetParent;}}
var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1||(ua.indexOf('safari')!=-1&&this.getStyle(el,'position')=='absolute')){pos[1]-=document.body.offsetTop;}}
if(el.parentNode){parent=el.parentNode;}
else{parent=null;}
while(parent&&parent.tagName!='BODY'&&parent.tagName!='HTML'){pos[0]-=parent.scrollLeft;pos[1]-=parent.scrollTop;if(parent.parentNode){parent=parent.parentNode;}
else{parent=null;}}
return pos;};this.getX=function(el){return this.getXY(el)[0];};this.getY=function(el){return this.getXY(el)[1];};this.setXY=function(el,pos,noRetry){el=this.get(el);var pageXY=YAHOO.util.Dom.getXY(el);if(pageXY===false){return false;}
if(this.getStyle(el,'position')=='static'){this.setStyle(el,'position','relative');}
var delta=[parseInt(YAHOO.util.Dom.getStyle(el,'left'),10),parseInt(YAHOO.util.Dom.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=0;}
if(isNaN(delta[1])){delta[1]=0;}
if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}
if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}
var newXY=this.getXY(el);if(!noRetry&&(newXY[0]!=pos[0]||newXY[1]!=pos[1])){this.setXY(el,pos,true);}
return true;};this.setX=function(el,x){return this.setXY(el,[x,null]);};this.setY=function(el,y){return this.setXY(el,[null,y]);};this.getRegion=function(el){el=this.get(el);return new YAHOO.util.Region.getRegion(el);};this.getClientWidth=function(){return(document.documentElement.offsetWidth||document.body.offsetWidth);};this.getClientHeight=function(){return(self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight);};};YAHOO.util.Region=function(t,r,b,l){this.top=t;this.right=r;this.bottom=b;this.left=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"  t: "+this.top+", r: "+this.right+", b: "+this.bottom+", l: "+this.left+"}");}
YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){this.x=x;this.y=y;this.top=y;this.right=x;this.bottom=y;this.left=x;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.util.CustomEvent=function(type,oScope){this.type=type;this.scope=oScope||window;this.subscribers=[];if(YAHOO.util["Event"]){YAHOO.util.Event.regCE(this);}};YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,bOverride){this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,bOverride));},unsubscribe:function(fn,obj){var found=false;for(var i=0;i<this.subscribers.length;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
return found;},fire:function(){for(var i=0;i<this.subscribers.length;++i){var s=this.subscribers[i];if(s){var scope=(s.override)?s.obj:this.scope;s.fn.call(scope,this.type,arguments,s.obj);}}},unsubscribeAll:function(){for(var i=0;i<this.subscribers.length;++i){this._delete(i);}},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
delete this.subscribers[index];}};YAHOO.util.Subscriber=function(fn,obj,bOverride){this.fn=fn;this.obj=obj||null;this.override=(bOverride);};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){return(this.fn==fn&&this.obj==obj);};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var listeners=[];var delayedListeners=[];var unloadListeners=[];var customEvents=[];var legacyEvents=[];var legacyHandlers=[];return{EL:0,TYPE:1,FN:2,WFN:3,SCOPE:3,ADJ_SCOPE:4,isSafari:(navigator.userAgent.match(/safari/gi)),isIE:(!this.isSafari&&navigator.userAgent.match(/msie/gi)),addListener:function(el,sType,fn,oScope,bOverride){if(this._isValidCollection(el)){var ok=true;for(var i=0;i<el.length;++i){ok=(this.on(el[i],sType,fn,oScope,bOverride)&&ok);}
return ok;}else if(typeof el=="string"){if(loadComplete){el=this.getEl(el);}else{delayedListeners[delayedListeners.length]=[el,sType,fn,oScope,bOverride];return true;}}
if(!el){return false;}
if("unload"==sType&&oScope!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,oScope,bOverride];return true;}
var scope=(bOverride)?oScope:el;var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),oScope);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1){legacyIndex=legacyEvents.length;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}
legacyHandlers[legacyIndex].push(index);}else if(el.addEventListener){el.addEventListener(sType,wrappedFn,false);}else if(el.attachEvent){el.attachEvent("on"+sType,wrappedFn);}
return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true;var le=legacyHandlers[legacyIndex];for(i=0;i<le.length;++i){var index=le[i];if(index){var li=listeners[index];var scope=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
return ok;},getLegacyIndex:function(el,sType){for(var i=0;i<legacyEvents.length;++i){var le=legacyEvents[i];if(le&&le[0]==el&&le[1]==sType){return i;}}
return-1;},useLegacyEvent:function(el,sType){return((!el.addEventListener&&!el.attachEvent)||(sType=="click"&&this.isSafari));},removeListener:function(el,sType,fn){if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(var i=0;i<el.length;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}
return ok;}
var cacheItem=null;var index=this._getCacheIndex(el,sType,fn);if(index>=0){cacheItem=listeners[index];}
if(!el||!cacheItem){return false;}
if(el.removeEventListener){el.removeEventListener(sType,cacheItem[this.WFN],false);}else if(el.detachEvent){el.detachEvent("on"+sType,cacheItem[this.WFN]);}
delete listeners[index][this.WFN];delete listeners[index][this.FN];delete listeners[index];return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;if(resolveTextNode&&t&&"#text"==t.nodeName){return t.parentNode;}else{return t;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
return y;},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
return t;},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}
return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
c=c.caller;}}
return ev;},getCharCode:function(ev){return ev.charCode||(ev.type=="keypress")?ev.keyCode:0;},_getCacheIndex:function(el,sType,fn){for(var i=0;i<listeners.length;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
return-1;},_isValidCollection:function(o){return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){for(i in this.elCache){delete this.elCache[i];}},regCE:function(ce){customEvents.push(ce);},_load:function(e){loadComplete=true;},_tryPreloadAttach:function(){var tryAgain=!loadComplete;for(var i=0;i<delayedListeners.length;++i){var d=delayedListeners[i];if(d){var el=this.getEl(d[this.EL]);if(el){this.on(el,d[this.TYPE],d[this.FN],d[this.SCOPE],d[this.ADJ_SCOPE]);delete delayedListeners[i];}}}
if(tryAgain){setTimeout("YAHOO.util.Event._tryPreloadAttach()",50);}},_unload:function(e,me){for(var i=0;i<unloadListeners.length;++i){var l=unloadListeners[i];if(l){var scope=(l[this.ADJ_SCOPE])?l[this.SCOPE]:window;l[this.FN].call(scope,this.getEvent(e),l[this.SCOPE]);}}
if(listeners&&listeners.length>0){for(i=0;i<listeners.length;++i){l=listeners[i];if(l){this.removeListener(l[this.EL],l[this.TYPE],l[this.FN]);}}
this.clearCache();}
for(i=0;i<customEvents.length;++i){customEvents[i].unsubscribeAll();delete customEvents[i];}
for(i=0;i<legacyEvents.length;++i){delete legacyEvents[i][0];delete legacyEvents[i];}},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement;db=document.body;if(dd&&dd.scrollTop){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}}};}();YAHOO.util.Event.on=YAHOO.util.Event.addListener;if(document&&document.body){YAHOO.util.Event._load();}else{YAHOO.util.Event.on(window,"load",YAHOO.util.Event._load,YAHOO.util.Event,true);}
YAHOO.util.Event.on(window,"unload",YAHOO.util.Event._unload,YAHOO.util.Event,true);YAHOO.util.Event._tryPreloadAttach();}
YAHOO.namespace('Finance');YAHOO.Finance.Syndication={DEBUG:0,version:0.1,constants:{MIN_WIDTH:180,MIN_WIDTH_FLAT_SKIN:160,MAX_WIDTH:300,TREND_SHOW_DETAIL_WIDTH_THRESHOLD:300,FLAT_SKIN_CLASS_NAME:'yfi_flat',LIGHT_SKIN_CLASS_NAME:'yfi_light',QUOTE_ROW_CLASS:'yfi_syn_quote',QUOTE_ROW_TRADE_CELL_CLASS:'yfi_trade',QUOTE_ROW_TRADE_CELL_WIDE_CLASS:'yfi_trade_wide',COMPANY_NAME_ROW_CLASS:'yfi_name_long',OPEN_COMPANY_NAME_ROW_CLASS:'yfi_name_long_open',DETAIL_ROW_CLASS:'yfi_syn_detail',OPEN_QUOTE_ROW_CLASS:'yfi_syn_open_quote',CLOSED_QUOTE_ROW_CLASS:'yfi_syn_quote',CHANGE_CLASS:'yfi_change',CHART_CLASS:'yfi_syn_chrt',CHARTDIV_CLASS:'yfi_chart',ARROW_CLASS:'yfi_arrow',NARROW_COLSPAN:2,WIDE_COLSPAN:3,ie:(document.all&&navigator.userAgent.indexOf('Opera')<0),TRANSPARENT_GIF:'http://us.i1.yimg.com/us.yimg.com/i/us/fi/ws/badges/v1/spacer.gif',ROW_Display:null,CELL_Display:null}};YAHOO.Finance.Syndication.init={onContentLoaded:function(){pClass=this.constructor;if(pClass.pSingleton==undefined){pClass.pSingleton=this;pClass.pSingleton.val=new Number(0);}else{pClass.pSingleton.val++;}
if(document.addEventListener){YAHOO.util.Event.addListener(document,'DOMContentLoaded',YAHOO.Finance.Syndication.init.main);}
YAHOO.util.Event.addListener(window,'load',YAHOO.Finance.Syndication.init.main);},main:function(){if(arguments.callee.done){return;}
arguments.callee.done=true;if(pClass.pSingleton.val!=0){pClass.pSingleton.val--;return;}
if(YAHOO.Finance.Syndication.DEBUG){createLoggingPane(true);}
var badges=YAHOO.Finance.Syndication.util.getElementsByTagAndClassName('div','yfi_syn');for(var i=0;i<badges.length;i++){var badge=new YAHOO.Finance.Syndication.Badge(badges[i]);}}};YAHOO.Finance.Syndication.init.onContentLoaded();YAHOO.Finance.Syndication.Badge=function(node){this.syndication=YAHOO.Finance.Syndication;this.node=node;this.rows=this.node.getElementsByTagName('tr');this.tickers=[];this.addTicker=function(ticker){this.tickers.push(ticker);};this.behaviour=new YAHOO.Finance.Syndication.BadgeBehaviour(this);this.display=new YAHOO.Finance.Syndication.BadgeDisplay(this);this.behaviour.init();this.display.init();return this;};YAHOO.Finance.Syndication.Ticker=function(row,badge){this.id=row.className.split(' ')[0];this.quoteRow=row;this.longNameRow=YAHOO.Finance.Syndication.util.getElementsByTagAndClassName('tr',this.id+'_long',badge.node)[0];this.detailRow=YAHOO.Finance.Syndication.util.getElementsByTagAndClassName('tr',this.id+'_aux',badge.node)[0];this.onQuoteRowClick=function(e,badge){var isOpenTicker=this.className.indexOf(badge.syndication.constants.OPEN_QUOTE_ROW_CLASS)>-1;var tickerString=YAHOO.Finance.Syndication.util.getTickerString(this.className.split(' ')[0]);if(isOpenTicker){YAHOO.Finance.Syndication.util.goToSummaryPage(tickerString);}
else{var clickedTickerhasDetailRow=YAHOO.Finance.Syndication.util.getElementsByTagAndClassName('tr',this.className.split(' ')[0]+'_aux',badge.node)[0];if(!clickedTickerhasDetailRow){YAHOO.Finance.Syndication.util.goToSummaryPage(tickerString);}
else{for(var i=0;i<badge.tickers.length;++i){var ticker=badge.tickers[i];var isClickedTicker=(ticker.id===this.className.split(' ')[0]);var tickerHasDetailRow=ticker.detailRow;if(isClickedTicker){badge.syndication.util.addClassName(ticker.quoteRow,badge.syndication.constants.OPEN_QUOTE_ROW_CLASS);badge.syndication.util.addClassName(ticker.longNameRow,badge.syndication.constants.OPEN_COMPANY_NAME_ROW_CLASS);if(tickerHasDetailRow){YAHOO.util.Dom.setStyle(ticker.detailRow,'display',badge.syndication.constants.ROW_DISPLAY);}
var chart_el=YAHOO.Finance.Syndication.util.getElementsByTagAndClassName("img",badge.syndication.constants.CHART_CLASS,clickedTickerhasDetailRow)[0];badge.display.setChartSize(chart_el,badge.display.chartWidth);}
else{badge.syndication.util.removeClassName(ticker.quoteRow,badge.syndication.constants.OPEN_QUOTE_ROW_CLASS);badge.syndication.util.removeClassName(ticker.longNameRow,badge.syndication.constants.OPEN_COMPANY_NAME_ROW_CLASS);if(tickerHasDetailRow){YAHOO.util.Dom.setStyle(ticker.detailRow,'display','none');}
if(i===0){badge.syndication.util.addClassName(ticker.quoteRow,'yfi_syn_quote_first');}}}}
if(this.className.indexOf(badge.syndication.constants.OPEN_QUOTE_ROW_CLASS)>-1){badge.display.fixDetailCellHeight(badge);badge.display.newsMgr.fixNewsHeights(badge.display.moduleWidth);}}};YAHOO.util.Event.addListener(row,'click',this.onQuoteRowClick,badge);YAHOO.util.Event.addListener(row,'mouseover',badge.display.cursor,badge.syndication);YAHOO.util.Event.addListener(row,'mouseout',badge.display.cursor,badge.syndication);};YAHOO.Finance.Syndication.BadgeBehaviour=function(badge){this.badge=badge;this.init=function(){for(var i=0;i<this.badge.rows.length;++i){var row=this.badge.rows[i];if(row.className.indexOf(badge.syndication.constants.QUOTE_ROW_CLASS)>-1){this.badge.addTicker(new YAHOO.Finance.Syndication.Ticker(row,this.badge));}}};};YAHOO.Finance.Syndication.BadgeDisplay=function(badge){this.badge=badge;this.syndication=badge.syndication;this.chartWidth=0;this.moduleWidth=0;this.init=function(){var ret=this.setModuleWidth();if(ret){this.badge.node.style.color="red";this.badge.node.innerHTML=ret;}
this.setFirstChartSize();this.syndication.constants.ROW_DISPLAY=(this.syndication.constants.ie)?'block':'table-row';this.syndication.constants.CELL_DISPLAY=(this.syndication.constants.ie)?'block':'table-cell';this.fixDetailCellHeight(this.badge);this.showHideChangeDetail(this.syndication);this.showFirstTickerDetail(this.badge);if(!(document.all&&navigator.userAgent.indexOf('Opera')<0)){this.fixInlinePNGS();}
this.newsMgr.fixNewsItems(this.moduleWidth);this.newsMgr.fixNewsHeights(this.moduleWidth);};this.newsMgr=function(){var _charsPerLine={"160":15,"200":26,"250":37,"300":45};var _chartHeights={"160":90,"200":95,"250":101,"300":115};var numLinesHL=2;var syndication=badge.syndication;function _getCharsPerLine(bw){var cpl=_charsPerLine[bw];if(!cpl){cpl=_charsPerLine["160"];}
return cpl;}
function _getChartHeight(bw){var ch_els=syndication.util.getElementsByTagAndClassName("div","yfi_chart");var ch_el=ch_els[0];var h=YAHOO.util.Dom.getStyle(ch_el,"height");h=parseInt(h.substring(0,h.length-2));if(isNaN(h)){h=_chartHeights[bw];if(!h){h=_chartHeights["300"];}}
return h;}
function _getNumLinesSrcTime(bw){if(bw<=200){return 2;}
return 1;}
return{fixNewsItems:function(bWidth){var links=document.getElementsByTagName("a");for(var i in links){if(links[i].parentNode&&links[i].parentNode.parentNode&&links[i].parentNode.parentNode.id!="yfi_ad"){var t=links[i].innerHTML;if(t&&t.indexOf("<")!=-1&&t.indexOf(">")!=-1){continue;}
if(t&&t.length>numLinesHL*_getCharsPerLine(bWidth)){t=t.substring(0,numLinesHL*_getCharsPerLine(bWidth)-3)+"...";links[i].innerHTML=t;}}}
var srcs=document.getElementsByTagName("cite");var times=syndication.util.getElementsByTagAndClassName("span","yfitime");for(var i=0;i<srcs.length;i++){var t=srcs[i].innerHTML+times[i].innerHTML;if(t&&t.length>_getNumLinesSrcTime(bWidth)*_getCharsPerLine(bWidth)){t=t.substring(0,_getNumLinesSrcTime(bWidth)*_getCharsPerLine(bWidth)-3)+"...";srcs[i].innerHTML=t;times[i].innerHTML="";}}},fixNewsHeights:function(bWidth){var news_els=syndication.util.getElementsByTagAndClassName("dt","yfi_news");if(news_els.length==0){return;}
var cn_els=syndication.util.getElementsByTagAndClassName("div","yfi_wrp");for(var i=0;i<cn_els.length;i++){var cn_el=cn_els[i];var other_fixed_ht=60;var nnews=YAHOO.Finance.Syndication.util.$("yfi_badge_news").innerHTML;var cn_el_ht;if(bWidth<=200){cn_el_ht=other_fixed_ht+_getChartHeight(bWidth)+nnews*59;}else{cn_el_ht=other_fixed_ht+_getChartHeight(bWidth)+nnews*45;}
YAHOO.util.Dom.setStyle(cn_el,"height",""+cn_el_ht+"px");}}}}();this.setModuleWidth=function(){var node=this.badge.node;var containerWidth=parseInt(YAHOO.util.Dom.getStyle(node.parentNode,'width'));var containerOffsetWidth=parseInt(node.parentNode.offsetWidth);containerWidth=parseInt(containerWidth)?containerWidth:containerOffsetWidth;if(!parseInt(containerWidth)){containerWidth=YAHOO.util.Dom.getClientWidth();}
var moduleWidth=width(containerWidth,this.syndication);this.chartWidth=moduleWidth-40;var isFlatSkin=(node.className.indexOf(badge.syndication.constants.FLAT_SKIN_CLASS_NAME)>-1);if(isFlatSkin){if(containerWidth<this.syndication.constants.MIN_WIDTH){moduleWidth=this.syndication.constants.MIN_WIDTH_FLAT_SKIN;}
if(containerWidth<this.syndication.constants.MIN_WIDTH_FLAT_SKIN){}}
YAHOO.util.Dom.setStyle(node,'width',moduleWidth+"px");tables=node.getElementsByTagName('table');var tblWidthDiff=20;if(isFlatSkin&&moduleWidth==this.syndication.constants.MIN_WIDTH_FLAT_SKIN){tblWidthDiff=10;}
for(i=0;i<tables.length;i++){if(tables[i].className!='yfi_badge_wrp'){YAHOO.util.Dom.setStyle(tables[i],'width',(moduleWidth-tblWidthDiff)+"px");}else{YAHOO.util.Dom.setStyle(tables[i],'width',moduleWidth+"px");}}
this.moduleWidth=moduleWidth;function width(containerWidth,Syndication){var _width;if(containerWidth<Syndication.constants.MIN_WIDTH){_width=Syndication.constants.MIN_WIDTH;}
else if(containerWidth>Syndication.constants.MAX_WIDTH){_width=Syndication.constants.MAX_WIDTH;}
else{_width=containerWidth;}
return _width;}
return false;};this.setFirstChartSize=function(){var chart_el=this.syndication.util.getElementsByTagAndClassName("img",this.syndication.constants.CHART_CLASS)[0];this.setChartSize(chart_el,this.chartWidth);};this.setChartsSize=function(){this.syndication.util.map(this.setChartSize,this.syndication.util.getElementsByTagAndClassName('*',this.syndication.constants.CHART_CLASS),this.chartWidth);};this.setChartSize=function(chartElm,chartWidth){if(!chartElm){return;}
var chartSize='135x90';var chartRealWidth='135px';var chartHeight='90px';if(chartWidth){if(chartWidth>=160&&chartWidth<180){chartSize='160x95';chartRealWidth='160px';chartHeight='95px';}else if(chartWidth>=180&&chartWidth<200){chartSize='180x99';chartRealWidth='180px';chartHeight='99px';}else if(chartWidth>=200&&chartWidth<220){chartSize='200x101';chartRealWidth='200px';chartHeight='101px';}else if(chartWidth>=220&&chartWidth<240){chartSize='220x108';chartRealWidth='220px';chartHeight='108px';}else if(chartWidth>=240&&chartWidth<260){chartSize='240x111';chartRealWidth='240px';chartHeight='111px';}else if(chartWidth>=260){chartSize='260x115';chartRealWidth='260px';chartHeight='115px';}}
var imgSrc=chartElm.getAttribute('rev')+';size='+chartSize;chartElm.src=imgSrc;YAHOO.util.Dom.setStyle(chartElm,"height",chartHeight);YAHOO.util.Dom.setStyle(chartElm,"width",chartRealWidth);};this.showHideChangeDetail=function(){if(parseInt(YAHOO.util.Dom.getStyle(this.badge.node,'width'))>=this.syndication.constants.TREND_SHOW_DETAIL_WIDTH_THRESHOLD){this.syndication.util.map(this.setDisplay,this.syndication.util.getElementsByTagAndClassName('*',this.syndication.constants.CHANGE_CLASS));var cells=this.badge.node.getElementsByTagName('td');this.syndication.util.map(this.setCellDisplay,cells);}else{var arrowTH=this.syndication.util.getElementsByTagAndClassName('th',this.syndication.constants.ARROW_CLASS);var changeTH=this.syndication.util.getElementsByTagAndClassName('th','yfi_change_hd');var changeTD=this.syndication.util.getElementsByTagAndClassName('td','yfi_change_hd');for(var i=0;i<arrowTH.length;i++){YAHOO.util.Dom.setStyle(arrowTH[i],'display','none');}
for(var i=0;i<changeTH.length;i++){YAHOO.util.Dom.setStyle(changeTH[i].getElementsByTagName('div')[0],'visibility','hidden');}}};this.showFirstTickerDetail=function(badge){if(badge.tickers.length>0){var firstTicker=badge.tickers[0];if(firstTicker&&firstTicker.detailRow){badge.syndication.util.addClassName(firstTicker.quoteRow,badge.syndication.constants.OPEN_QUOTE_ROW_CLASS);badge.syndication.util.addClassName(firstTicker.longNameRow,badge.syndication.constants.OPEN_COMPANY_NAME_ROW_CLASS);YAHOO.util.Dom.setStyle(firstTicker.detailRow,'display',badge.syndication.constants.ROW_DISPLAY);}}};this.shrinkArrowWidth=function(elm){YAHOO.util.Dom.setStyle(elm,'width','5px');};this.turnoffDisplay=function(elm){YAHOO.util.Dom.setStyle(elm,'display','none');};this.setDisplay=function(elm){YAHOO.util.Dom.setStyle(elm,'display',YAHOO.Finance.Syndication.constants.CELL_DISPLAY);};this.setCellDisplay=function(elm,display){if(elm.colSpan===YAHOO.Finance.Syndication.constants.NARROW_COLSPAN){elm.colSpan=YAHOO.Finance.Syndication.constants.WIDE_COLSPAN;}
if(elm.className.indexOf(YAHOO.Finance.Syndication.constants.QUOTE_ROW_TRADE_CELL_CLASS)>-1){YAHOO.Finance.Syndication.util.addClassName(elm,YAHOO.Finance.Syndication.constants.QUOTE_ROW_TRADE_CELL_WIDE_CLASS);}};this.show=function(){YAHOO.util.Dom.setStyle(badge.node,'visibility','visible');};this.cursor=function(e,syndication){var hand=(e.type=='mouseover'&&this.className.indexOf(syndication.constants.OPEN_QUOTE_ROW_CLASS)<0);if(hand){syndication.util.addClassName(this,'hand');}
else{syndication.util.removeClassName(this,'hand');}};this.fixDetailCellHeight=function(badge){if(!document.all&&navigator.userAgent.indexOf('AppleWebKit')<0){var wrappers=this.syndication.util.getElementsByTagAndClassName('*','yfi_wrp',badge.node);this.syndication.util.map(this.fixDetailWrapperHeight,wrappers);}};this.fixDetailWrapperHeight=function(elm){var height=parseInt(YAHOO.util.Dom.getStyle(elm.parentNode,'height'));var parentHeight=parseInt(YAHOO.util.Dom.getStyle(elm.parentNode,'height'));YAHOO.util.Dom.setStyle(elm,'height',YAHOO.util.Dom.getStyle(elm.parentNode,'height'));};this.fixInlinePNGS=function(){this.syndication.util.map(this.fixPNGS,this.getPNGs(this.badge));this.syndication.util.map(this.fixImgPNGS,this.syndication.util.getElementsByTagAndClassName('img'));};this.fixPNGS=function(elm){for(var i=0;i<elm.node.length;i++){try{rev_url=YAHOO.Finance.Syndication.util.$(elm.node[i]).getAttribute('rev');if(rev_url!=undefined&&rev_url!=''){YAHOO.Finance.Syndication.util.$(elm.node[i]).src=YAHOO.Finance.Syndication.util.$(elm.node[i]).getAttribute('rev');}else{YAHOO.Finance.Syndication.util.$(elm.node[i]).src=elm.source;}
YAHOO.util.Dom.setStyle(elm.node[i],'visibility','visible');}
catch(e){}}};this.getPNGs=function(badge){var pngAppend=(badge.node.className.indexOf(badge.syndication.constants.FLAT_SKIN_CLASS_NAME)>-1)?'_flat':'';var hdrAppend=(badge.node.className.indexOf(badge.syndication.constants.LIGHT_SKIN_CLASS_NAME)>-1)?'yahoo_finance_logo_155.2.gif':'yf_155grey.png';return[{node:YAHOO.Finance.Syndication.util.getElementsByTagAndClassName('*','yfi_header'),source:'http://us.i1.yimg.com/us.yimg.com/i/us/fi/ws/badges/v1/'+hdrAppend},{node:YAHOO.Finance.Syndication.util.getElementsByTagAndClassName('*','yfis_get_quote'),source:'http://us.i1.yimg.com/us.yimg.com/i/us/fi/ws/badges/v1/btn_get_quote'+pngAppend+'.png'},{node:YAHOO.Finance.Syndication.util.getElementsByTagAndClassName('*','yfi_add_to_site'),source:'http://us.i1.yimg.com/us.yimg.com/i/us/fi/ws/badges/v1/btn_add_this_to_your_site'+pngAppend+'.png'},];};this.fixImgPNGS=function(elm){try{if(!(document.all&&navigator.userAgent.indexOf('Opera')<0)){if(elm.className=='yfi_arrow_up'){elm.src='http://us.i1.yimg.com/us.yimg.com/i/us/fi/ws/badges/v1/arrow_up_green.png';}else if(elm.className=='yfi_arrow_down'){elm.src='http://us.i1.yimg.com/us.yimg.com/i/us/fi/ws/badges/v1/arrow_down_red.png';}else if(elm.className=='yfi_copyright'||elm.className=='yfi_privacy'||elm.className=='yfi_delayed_quote'){elm.src=elm.getAttribute('rev');}}
YAHOO.util.Dom.setStyle(elm.id,'visibility','visible');}
catch(e){}};};YAHOO.Finance.Syndication.submit_form=function(form){YAHOO.Finance.Syndication.get_symbol(form);return false;};YAHOO.Finance.Syndication.get_symbol=function(form){inputValue=YAHOO.Finance.Syndication.util.getElementsByTagAndClassName('input','yfi_symbol',form)[0].value;var redirect='http://us.rd.yahoo.com/finance/badge/search/';if(form.searchtype[0].checked){if(inputValue=="Enter Symbol"||inputValue==""){YAHOO.Finance.Syndication.redirect(redirect+'quote/*http://finance.yahoo.com',true);}else{YAHOO.Finance.Syndication.redirect(redirect+'quote/*http://finance.yahoo.com/q?s='+inputValue,true);}}else if(form.searchtype[1].checked){if(inputValue=="Enter Keyword"||inputValue==""){YAHOO.Finance.Syndication.redirect(redirect+'web/*http://search.yahoo.com?fr=fin-badge',true);}else{YAHOO.Finance.Syndication.redirect(redirect+'web/*http://search.yahoo.com/search?fr=fin-badge&p='+inputValue,true);}}};YAHOO.Finance.Syndication.redirect=function(url,new_window){if(!new_window){document.location.href=url;}else{window.open(url,'whatever');}};YAHOO.Finance.Syndication.util={Syndication:YAHOO.Finance.Syndication,$:YAHOO.util.Dom.get,insertAfter:function(parent,node,referenceNode){parent.insertBefore(node,referenceNode.nextSibling);},setClassName:function(elm,newClassName){elm.className=newClassName;},addClassName:function(elm,newClassName){elm.className=elm.className+" "+newClassName;},removeClassName:function(elm,removedClassName){var aClasses=elm.className.split(' ');aClasses=this.Syndication.util.filter(removeClass,aClasses);elm.className=aClasses.join(' ');function removeClass(classItem){return!(classItem===removedClassName);}},filter:function(fn,lst,self){var rval=[];if(typeof(Array.prototype.filter)=='function'){return Array.prototype.filter.call(lst,fn,self);}else if(typeof(self)=='undefined'||self===null){for(var i=0;i<lst.length;++i){var o=lst[i];if(fn(o)){rval.push(o);}}}else{for(i=0;i<lst.length;++i){o=lst[i];if(fn.call(self,o)){rval.push(o);}}}
return rval;},map:function(fn,lst,obj){var rval=[];for(var i=0;i<lst.length;++i){rval.push(fn(lst[i],obj));}
return rval;},getElementsByTagAndClassName:function(tagName,className,parent){if(typeof(tagName)=='undefined'||tagName===null){tagName='*';}
if(typeof(parent)=='undefined'||parent===null){parent=document;}
var children=parent.getElementsByTagName(tagName)||document.all;if(typeof(className)=='undefined'||className===null){return children;}
var elements=[];for(var i=0;i<children.length;++i){var child=children[i];var classNames=child.className.split(' ');for(var j=0;j<classNames.length;++j){if(classNames[j]==className){elements.push(child);break;}}}
return elements;},getTickerString:function(className){return className.replace(/^yfi_ticker_([^\_]*).*$/,'$1');},goToSummaryPage:function(ticker){YAHOO.Finance.Syndication.redirect('http://us.rd.yahoo.com/finance/badge/quote/*http://finance.yahoo.com/q?s='+ticker,true);}};