// Concatenated on Thu Mar  1 17:53:47 PST 2007 by joyd

// File: exception.js (1.2)

function Exception(name,message)
{if(name){this.name=name;}
if(message){this.message=message;}}
Exception.prototype.setName=function(name)
{this.name=name;};Exception.prototype.getName=function()
{return this.name;};Exception.prototype.setMessage=function(msg)
{this.message=msg;};Exception.prototype.getMessage=function()
{return this.message;};

// File: flashtag.js (1.2)

function FlashTag(src,width,height,version)
{if(arguments.length<4)
{throw new Exception('RequiredParameterException','You must pass in a src, width, height, and version when creating a FlashTag.');}
this.src=src;this.width=width;this.height=height;this.version=version;this.id=null;this.flashVars=null;this.flashVarsStr=null;this.genericParam={};this.ie=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
FlashTag.prototype.setSource=function(src)
{this.src=src;};FlashTag.prototype.setWidth=function(w)
{this.width=width;};FlashTag.prototype.setHeight=function(h)
{this.h=height;};FlashTag.prototype.setVersion=function(v)
{this.version=v;};FlashTag.prototype.setId=function(id)
{this.id=id;};FlashTag.prototype.setBgcolor=function(bgc)
{if(bgc.charAt(0)!='#')
{bgc='#'+bgc;}
this.genericParam.bgcolor=bgc;};FlashTag.prototype.addFlashVars=function(fvs)
{this.flashVarsStr=fvs;};FlashTag.prototype.addFlashVar=function(n,v)
{if(this.flashVars===null)
{this.flashVars={};}
this.flashVars[n]=v;};FlashTag.prototype.removeFlashVar=function(n)
{if(this.flashVars!==null)
{this.flashVars[n]=null;}};FlashTag.prototype.setSwliveconnect=function(swlc)
{this.genericParam.swliveconnect=swlc;};FlashTag.prototype.setPlay=function(p)
{this.genericParam.play=p;};FlashTag.prototype.setLoop=function(l)
{this.genericParam.loop=l;};FlashTag.prototype.setMenu=function(m)
{this.genericParam.menu=m;};FlashTag.prototype.setQuality=function(q)
{if(q!='low'&&q!='high'&&q!='autolow'&&q!='autohigh'&&q!='best')
{throw new Exception('UnsupportedValueException','Supported values are "low", "high", "autolow", "autohigh", and "best".');}
this.genericParam.quality=q;};FlashTag.prototype.setScale=function(sc)
{if(sc!='showall'&&sc!='noborder'&&sc!='exactfit')
{throw new Exception('UnsupportedValueException','Supported values are "showall", "noborder", and "exactfit".');}
this.genericParam.scale=sc;};FlashTag.prototype.setAlign=function(a)
{if(a!='l'&&a!='t'&&a!='r'&&a!='b')
{throw new Exception('UnsupportedValueException','Supported values are "l", "t", "r" and "b".');}
this.genericParam.align=a;};FlashTag.prototype.setSalign=function(sa)
{if(sa!='l'&&sa!='t'&&sa!='r'&&sa!='b'&&sa!='tl'&&sa!='tr'&&sa!='bl'&&sa!='br')
{throw new Exception('UnsupportedValueException','Supported values are "l", "t", "r", "b", "tl", "tr", "bl" and "br".');}
this.genericParam.salign=sa;};FlashTag.prototype.setWmode=function(wm)
{if(wm!='window'&&wm!='opaque'&&wm!='transparent')
{throw new Exception('UnsupportedValueException','Supported values are "window", "opaque", and "transparent".');}
this.genericParam.wmode=wm;};FlashTag.prototype.setBase=function(base)
{this.genericParam.base=base;};FlashTag.prototype.setAllowScriptAccess=function(sa)
{if(sa!='never'&&sa!='always')
{throw new Exception('UnsupportedValueException','Supported values are "never" and "always".');}
this.genericParam.allowScriptAccess=sa;};FlashTag.prototype.toString=function()
{var flashTag=String();if(this.ie)
{flashTag+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';if(this.id!==null)
{flashTag+='id="'+this.id+'" ';}
flashTag+='codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" ';flashTag+='width="'+this.width+'" ';flashTag+='height="'+this.height+'">';flashTag+='<param name="movie" value="'+this.src+'"/>';for(var n in this.genericParam)
{if(this.genericParam[n]!==null)
{flashTag+='<param name="'+n+'" value="'+this.genericParam[n]+'"/>';}}
if(this.flashVars!==null)
{var fv=this.getFlashVarsAsString();if(fv.length>0)
{flashTag+='<param name="flashvars" value="'+fv+'"/>';}}
flashTag+='</object>';}
else
{flashTag+='<embed src="'+this.src+'"';flashTag+=' width="'+this.width+'"';flashTag+=' height="'+this.height+'"';flashTag+=' type="application/x-shockwave-flash"';if(this.id!==null)
{flashTag+=' name="'+this.id+'"';}
for(n in this.genericParam)
{if(this.genericParam[n]!==null)
{flashTag+=(' '+n+'="'+this.genericParam[n]+'"');}}
if(this.flashVars!==null)
{fv=this.getFlashVarsAsString();if(fv.length>0)
{flashTag+=' flashvars="'+fv+'"';}}
flashTag+=' pluginspage="http://www.macromedia.com/go/getflashplayer">';flashTag+='</embed>';}
return flashTag;};FlashTag.prototype.write=function(doc)
{doc.write(this.toString());};FlashTag.prototype.getFlashVarsAsString=function()
{var qs=String();for(var n in this.flashVars)
{if(this.flashVars[n]!==null)
{qs+=(escape(n)+'='+escape(this.flashVars[n])+'&');}}
if(this.flashVarsStr!==null)
{return qs+this.flashVarsStr;}
return qs.substring(0,qs.length-1);};

// File: flashserializer.js (1.2)

function FlashSerializer(useCdata)
{this.useCdata=useCdata;}
FlashSerializer.prototype.serialize=function(args)
{var qs=String();for(var i=0;i<args.length;++i)
{switch(typeof(args[i]))
{case'undefined':qs+='t'+(i)+'=undf';break;case'string':qs+='t'+(i)+'=str&d'+(i)+'='+escape(args[i]);break;case'number':qs+='t'+(i)+'=num&d'+(i)+'='+escape(args[i]);break;case'boolean':qs+='t'+(i)+'=bool&d'+(i)+'='+escape(args[i]);break;case'object':if(args[i]===null)
{qs+='t'+(i)+'=null';}
else if(args[i]instanceof Date)
{qs+='t'+(i)+'=date&d'+(i)+'='+escape(args[i].getTime());}
else
{try
{qs+='t'+(i)+'=xser&d'+(i)+'='+escape(this._serializeXML(args[i]));}
catch(exception)
{throw new Exception("FlashSerializationException","The following error occurred during complex object serialization: "+exception.getMessage());}}
break;default:throw new Exception("FlashSerializationException","You can only serialize strings, numbers, booleans, dates, objects, arrays, nulls, and undefined.");}
if(i!=(args.length-1))
{qs+='&';}}
return qs;};FlashSerializer.prototype._serializeXML=function(obj)
{var doc={};doc.xml='<fp>';try
{this._serializeNode(obj,doc,null);}
catch(exception)
{if(exception.message)
{throw new Exception("FlashSerializationException","Unable to serialize object because: "+exception.message);}
throw exception;}
doc.xml+='</fp>';return doc.xml;};FlashSerializer.prototype._serializeNode=function(obj,doc,name)
{switch(typeof(obj))
{case'undefined':doc.xml+='<undf'+this._addName(name)+'/>';break;case'string':doc.xml+='<str'+this._addName(name)+'>'+this._escapeXml(obj)+'</str>';break;case'number':doc.xml+='<num'+this._addName(name)+'>'+obj+'</num>';break;case'boolean':doc.xml+='<bool'+this._addName(name)+' val="'+obj+'"/>';break;case'object':if(obj===null)
{doc.xml+='<null'+this._addName(name)+'/>';}
else if(obj instanceof Date)
{doc.xml+='<date'+this._addName(name)+'>'+obj.getTime()+'</date>';}
else if(obj instanceof Array)
{doc.xml+='<array'+this._addName(name)+'>';for(var i=0;i<obj.length;++i)
{this._serializeNode(obj[i],doc,null);}
doc.xml+='</array>';}
else
{doc.xml+='<obj'+this._addName(name)+'>';for(var n in obj)
{if(typeof(obj[n])==='function'){continue;}
this._serializeNode(obj[n],doc,n);}
doc.xml+='</obj>';}
break;default:throw new Exception("FlashSerializationException","You can only serialize strings, numbers, booleans, objects, dates, arrays, nulls and undefined");}};FlashSerializer.prototype._addName=function(name)
{if(name!==null)
{return' name="'+name+'"';}
return'';};FlashSerializer.prototype._escapeXml=function(str)
{if(this.useCdata){return'<![CDATA['+str+']]>';}
else{return str.replace(/&/g,'&amp;').replace(/</g,'&lt;');}};

// File: flashproxy.js (1.3)

function FlashProxy(lcId,flashId,proxySwfName,callbackScope)
{FlashProxy.fpmap[lcId]=this;this.uid=lcId;this.proxySwfName=proxySwfName;this.callbackScope=callbackScope;this.flashSerializer=new FlashSerializer(false);this.q=[];if(navigator.appName.indexOf('Internet Explorer')!=-1&&navigator.platform.indexOf('Win')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
{setUpVBCallback(flashId);}}
FlashProxy.prototype.call=function()
{if(arguments.length===0)
{throw new Exception("Flash Proxy Exception","The first argument should be the function name followed by any number of additional arguments.");}
this.q.push(arguments);if(this.q.length==1)
{this._execute(arguments);}};FlashProxy.prototype._execute=function(args)
{var ft=new FlashTag(this.proxySwfName,1,1,'6,0,65,0');ft.addFlashVar('lcId',this.uid);ft.addFlashVar('functionName',args[0]);if(args.length>1)
{var justArgs=[];for(var i=1;i<args.length;++i)
{justArgs.push(args[i]);}
ft.addFlashVars(this.flashSerializer.serialize(justArgs));}
var divName='_flash_proxy_'+this.uid;if(!document.getElementById(divName))
{var newTarget=document.createElement("div");newTarget.id=divName;document.body.appendChild(newTarget);}
var target=document.getElementById(divName);target.innerHTML=ft.toString();};FlashProxy.callJS=function(command,args)
{var argsArray=eval(args);var scope=FlashProxy.fpmap[argsArray.shift()].callbackScope;if(scope&&(command.indexOf('.')<0))
{var functionToCall=scope[command];functionToCall.apply(scope,argsArray);}
else
{var functionToCall=eval(command);functionToCall.apply(functionToCall,argsArray);}};FlashProxy.callComplete=function(uid)
{var fp=FlashProxy.fpmap[uid];if(fp!==null)
{fp.q.shift();if(fp.q.length>0)
{fp._execute(fp.q[0]);}}};FlashProxy.fpmap={};

// File: flashchart.js (1.74)

YFC.createFlashChart=function(uid,id,width,height)
{var chartswf='http://us.js2.yimg.com/us.yimg.com/i/us/fi/yfc/swf/flashchart_1.19.swf';var bridgeswf='http://us.js2.yimg.com/us.yimg.com/i/us/fi/yfc/swf/javascriptflashgateway_1.1.swf';return new YFC.FlashChart(uid,id,width,height,chartswf,bridgeswf);};YFC.FlashChart=function(uid,id,width,height,chartswf,bridgeswf)
{this.uid=uid;this.width=width;this.height=height;this.id=id;this.chartswf=chartswf;this.bridgeswf=bridgeswf;this.chartState=new YFC.ChartState();this.bgColor='ece4cd';this.flashVars='';this.dataHostName='';this.initState='';this.wmode='';this.onStateChange=function(x){};this.onChartError=function(x){};this.onLegendClick=function(x){};this.onLegendRemove=function(x){};this.onChartTipHotSpot=function(x){};this.onGraphColor=function(x)
{this.colors=x;};this.colors=[];this.init=function()
{this.setBgcolor('dbdbd3');this.setWmode('opaque');this.onStateChange=YFC.FlashChart.stateChanged;this.onChartError=YFC.FlashChart.error;this.onLegendClick=YFC.FlashChart.legendClick;this.onLegendRemove=YFC.FlashChart.legendRemove;this.onChartTipHotSpot=YFC.FlashChart.chartTipHotSpot;var readcookiestr;var convertedcookiestr;var mychartpref=YFC.getPrf('cd');function extractValue(str,key){var arr=str.split(';');for(var i in arr){var entry=arr[i].split('=');if(entry[0]==key){return entry[1];}}
return null;}
function replaceValue(str,key,val){var arr=str.split(';');var done=false;for(var i in arr){var entry=arr[i].split('=');if(entry[0]==key){entry[1]=val;arr[i]=entry.join('=');done=true;}}
str=arr.join(';');if(!done){str+=';'+key+'='+val;}
return str;}
if(YFC.Util.Browser.getLocationHash().length>0){var location=YFC.Util.Browser.getLocationHash();if(location.indexOf(":")!=-1){location=location.substr(location.indexOf(":")+1,location.length);}
this.chartState.update(location,"false");var specifiedCompares=extractValue(location,'compare');if(location.indexOf("crosshair")===-1){if(mychartpref&&(mychartpref!=="")){convertedcookiestr=mychartpref.replace(/_@/g,";");convertedcookiestr=convertedcookiestr.replace(/:/g,"=");if(specifiedCompares){convertedcookiestr=replaceValue(convertedcookiestr,'compare',specifiedCompares);}
else{convertedcookiestr=replaceValue(convertedcookiestr,'compare','');}
this.chartState.update(convertedcookiestr,"true");}
else{location+=";indicator=volume";this.chartState.update(location,"false");}}
if(YFC.isRealTime){this.setInitialSource('realtime');}
this.setInitialState(this.chartState.toVars());}
else{this.chartState.update('symbol=^dji;range=1y;indicator=volume;charttype=line;crosshair=on;logscale=off',"false");if(mychartpref&&(mychartpref!=="")){convertedcookiestr=mychartpref.replace(/_@/g,";");convertedcookiestr=convertedcookiestr.replace(/:/g,"=");this.chartState.update(convertedcookiestr,"true");}
this.setInitialState(this.chartState.toVars());if(YFC.isRealTime){this.setInitialSource('realtime');}}};if(this.uid!==0){this.flashProxy=new FlashProxy(uid,this.id,this.bridgeswf,this);this.init();}};YFC.FlashChart.prototype.setBgcolor=function(bgc)
{this.bgColor=bgc;};YFC.FlashChart.prototype.addCompare=function(s)
{this.flashProxy.call('addCompare',s);if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.removeCompare=function(s)
{this.flashProxy.call('removeCompare',s);if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.setIndicator=function(o)
{this.flashProxy.call('setIndicator',o);if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.setInitialSource=function(s)
{this.initSource=s;};YFC.FlashChart.prototype.unsetIndicator=function(o)
{this.flashProxy.call('unsetIndicator',o);if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.setLog=function(e)
{var val=e?1:0;this.flashProxy.call('setLog',val);if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.setWmode=function(wm)
{this.wmode=wm;};YFC.FlashChart.prototype.setFlashVars=function(s)
{this.flashVars=s;};YFC.FlashChart.prototype.setInitialState=function(s)
{this.initState=s;};YFC.FlashChart.prototype.setAnchorBug=function(e)
{this.anchorBug=e;};YFC.FlashChart.prototype.setTitle=function(s)
{this.title=s;};YFC.FlashChart.prototype.resetTitle=function()
{var x=this.title;setTimeout(function(){document.title=x;},0);};YFC.FlashChart.prototype.resetFlashProxy=function()
{this.flashProxy.q=[];};YFC.FlashChart.prototype.toString=function()
{var tag=new FlashTag(this.chartswf,this.width,this.height,'6,0,0,0');tag.addFlashVar('lcId',this.uid);tag.setMenu(false);var fvs='';if(this.initState!==''){fvs+='state='+escape(this.initState);}
if(this.initSource!==''){if(fvs!==''){fvs+='&';}
fvs+="source="+this.initSource;}
if(this.dataHostName!==''){if(fvs!==''){fvs+='&';}
fvs+="data_hostname="+this.dataHostName;}
if(this.flashVars!==''){if(fvs!==''){fvs+='&';}
fvs+=this.flashVars;}
if(fvs!==''){tag.addFlashVars(fvs);}
tag.setId(this.id);tag.setBgcolor(this.bgColor);tag.setLoop(false);if(this.wmode!==''){tag.setWmode(this.wmode);}
return tag.toString();};YFC.FlashChart.prototype.write=function(doc)
{var tag=this.toString();doc.write(tag);};YFC.FlashChart.prototype.isLoaded=function()
{if(typeof(document[flashChart.id])!='undefined'){if(typeof(document[flashChart.id].PercentLoaded)=='function'){return((document[flashChart.id].PercentLoaded()==100));}
else{return true;}}
return false;};YFC.FlashChart.prototype.linkReady=function()
{this.flashProxy.call('linkReady');if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.doNothing=function(s)
{};YFC.FlashChart.prototype.setSymbol=function(evt)
{var s=document.getElementById("txtGetChart").value;this.flashProxy.call('setSymbol',s);if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.setPeriod=function(p)
{this.flashProxy.call('setPeriod',p.toVars());if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.setChartType=function(ct)
{this.flashProxy.call('setChartType',ct);if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.addIndicator=function(o)
{this.flashProxy.call('addIndicator',o);if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.removeIndicator=function(o)
{this.flashProxy.call('removeIndicator',o);if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.setCrosshair=function(c)
{this.flashProxy.call('setCrosshair2',c);if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.setState=function(s)
{this.flashProxy.call('setState',s);if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.refresh=function()
{this.flashProxy.call('refresh');if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.prototype.setChartLinks=function(sym,links)
{this.flashProxy.call('setChartLinks',{sym:sym,links:links});if(this.anchorBug){this.resetTitle();}}
YFC.FlashChart.prototype.setSource1=function(s)
{this.flashProxy.call('setSource',s);if(this.anchorBug){this.resetTitle();}};YFC.FlashChart.stateChanged=function(s)
{if(typeof YFC.isLoaded!='undefined')
{if(YFC.previousState===s){return;}
this.setTitle(flashChart.chartState.symbol.toUpperCase()+' Chart - Yahoo! Finance');YAHOO.log("state changed: "+s);var cookiestr=s.replace(/;/g,"_@");cookiestr=cookiestr.replace(/=/g,":");YFC.setPrf('cd',cookiestr,3650);YFC.browserHistory.registerChange(s);var st=flashChart.chartState;flashChart.mapColors(st);YFC.shouldShowAd=true;if(typeof YFC.LeftPanelTree!='undefined')
{function shouldUpdateTreeColors(){if(!YFC.LeftPanelTree.constructing){YFC.LeftPanelTree.updateColors();}
else{setTimeout(shouldUpdateTreeColors,200);}}}
setTimeout(YFC.ChartSettingsMenu.init,500);setTimeout(YFC.TechnicalIndicatorMenu.init,500);function setChartlinksTimeout()
{var flashsym=(flashChart.chartState.symbol).toLowerCase();flashChart.setChartLinks(flashsym,(YFC.leftpanelhash[flashsym]).chartlinks);}
function shouldUpdateQuoteLeftpanel(){var flashsym=(flashChart.chartState.symbol).toLowerCase();if(YFC.quotebarhash[flashsym]&&(YFC.quotebarhash[flashsym].used!==true)&&YFC.leftpanelhash[flashsym]&&(YFC.leftpanelhash[flashsym].used!==true)){setTimeout(setChartlinksTimeout,500);YFC.QuoteBar.displayData(YFC.quotebarhash[flashsym]);YFC.LeftPanelTree.setParams(YFC.leftpanelhash[flashsym]);YFC.LeftPanelTree.initialize();shouldUpdateTreeColors();}
else{setTimeout(shouldUpdateQuoteLeftpanel,200);}}
var quoteInfoTicker_el=YAHOO.util.Dom.get("quoteInfoTicker");var quotebarsymname=(quoteInfoTicker_el!=null)?quoteInfoTicker_el.innerHTML:null;if(quotebarsymname&&quotebarsymname!=="&nbsp;"){if(quotebarsymname.toLowerCase()!==flashChart.chartState.symbol){shouldUpdateQuoteLeftpanel();}else{shouldUpdateTreeColors();}}else{shouldUpdateQuoteLeftpanel();}
YFC.previousState=s;}
else{YAHOO.log("state changed but scripts not loaded ");}};YFC.FlashChart.error=function(o)
{var s='';if(this.clonedState&&this.clonedState!==""){this.chartState.update(this.clonedState,"false");this.clonedState=null;}
for(var i=0;i<o.errors.length;i++){s+=o.errors[i].msg;}
var dlgIcon=YAHOO.widget.SimpleDialog.ICON_WARN;var dlg=new YAHOO.widget.SimpleDialog("errordlg1",{width:"400px",fixedcenter:true,visible:false,draggable:false,close:true,modal:true,text:s,icon:dlgIcon,constraintoviewport:true,buttons:[{text:"OK",handler:function(){this.hide();},isDefault:true}]});dlg.setHeader('Oops!');dlg.render(document.body);dlg.show();};YFC.FlashChart.legendClick=function(s)
{var ind=YFC.createIndicatorByVars(s);if(ind.type!=='main'){if(!YFC.TechnicalIndicatorMenu.showDialogByIndicatorType(ind.type)){flashChart.removeIndicator(ind);}}};YFC.FlashChart.legendRemove=function(s)
{var ind=YFC.createIndicatorByVars(s);if(ind.type!=='main'){flashChart.removeIndicator(ind.toVars());}else{if(flashChart.chartState.compares.length>0){flashChart.chartState.symbol=flashChart.chartState.compares[0].symbol;flashChart.chartState.compares.shift();YFC.LeftPanelTree.setParamsAndInitialize();var quoteServerAccess=new YFC.ServerAccess();quoteServerAccess.retrieveQuoteInfo(flashChart.chartState.symbol);YAHOO.log("st "+flashChart.chartState.toVars())
flashChart.setState(flashChart.chartState.toVars());}}};YFC.FlashChart.chartTipHotSpot=function(obj)
{};YFC.FlashChart.prototype.mapColors=function(state)
{state.main.colors=this.colors.slice(0,1);var c=1;for(var i=0;i<state.compares.length;i++){state.compares[i].colors=this.colors.slice(c,c+state.compares[i].numColor);c+=state.compares[i].numColor;}
for(i=0;i<state.overlays.length;i++){state.overlays[i].colors=this.colors.slice(c,c+state.overlays[i].numColor);c+=state.overlays[i].numColor;}
for(i=0;i<state.technicals.length;i++){state.technicals[i].colors=this.colors.slice(0,c+state.technicals[i].numColor);}};

// File: indicator.js (1.18)

YFC.INDICATOR_MAIN=0;YFC.INDICATOR_OVERLAY=1;YFC.INDICATOR_TECHNICAL=2;YFC.INDICATOR_COMPARE=3;YFC.Compare_TYPE='compare';YFC.Period=function(s)
{this.str=s;this.toVars=function(){return this.str;};};YFC.Period.makeCustomPeriod=function(s,e){return new YFC.Period('c,'+s+','+e);};YFC.Period.makePredefinedPeriod=function(s){return new YFC.Period(s);};YFC.Period.PERIOD_1D=new YFC.Period('1d');YFC.Period.PERIOD_5D=new YFC.Period('5d');YFC.Period.PERIOD_3M=new YFC.Period('3m');YFC.Period.PERIOD_6M=new YFC.Period('6m');YFC.Period.PERIOD_1Y=new YFC.Period('1y');YFC.Period.PERIOD_2Y=new YFC.Period('2y');YFC.Period.PERIOD_5Y=new YFC.Period('5y');YFC.Period.PERIOD_MY=new YFC.Period('my');YFC.createIndicatorByKeyValue=function(key,value)
{var ind;if(key==YFC.Compare_TYPE){ind=new YFC.Compare();}
else if(key==YFC.TechnicalMACD_TYPE){ind=new YFC.TechnicalMACD();}
else if(key==YFC.TechnicalVolume_TYPE){ind=new YFC.TechnicalVolume();}
else if(key==YFC.TechnicalVolumeMA_TYPE){ind=new YFC.TechnicalVolumeMA();}
else if(key==YFC.TechnicalMFI_TYPE){ind=new YFC.TechnicalMFI();}
else if(key==YFC.TechnicalRSI_TYPE){ind=new YFC.TechnicalRSI();}
else if(key==YFC.TechnicalROC_TYPE){ind=new YFC.TechnicalROC();}
else if(key==YFC.TechnicalFastStoch_TYPE){ind=new YFC.TechnicalFastStoch();}
else if(key==YFC.TechnicalSlowStoch_TYPE){ind=new YFC.TechnicalSlowStoch();}
else if(key==YFC.TechnicalWPR_TYPE){ind=new YFC.TechnicalWPR();}
else if(key==YFC.OverlaySMA_TYPE){ind=new YFC.OverlaySMA();}
else if(key==YFC.OverlayEMA_TYPE){ind=new YFC.OverlayEMA();}
else if(key==YFC.OverlayBollinger_TYPE){ind=new YFC.OverlayBollinger();}
else if(key==YFC.OverlayPSAR_TYPE){ind=new YFC.OverlayPSAR();}
else if(key==YFC.OverlaySplits_TYPE){ind=new YFC.OverlaySplits();}
else if(key==YFC.OverlayDividends_TYPE){ind=new YFC.OverlayDividends();}
else if(key==YFC.Main_TYPE){ind=new YFC.Main();}
else{return null;}
if(value!==''){ind.setParamsByVars(value);}
return ind;};YFC.createIndicatorByVars=function(str)
{var n1=str.indexOf('(');var n2=str.indexOf(')');var key;var val;if(n1==-1){key=str;val='';}
else{key=str.substring(0,n1);val=str.substring(n1+1,n2);}
return YFC.createIndicatorByKeyValue(key,val);};YFC.Main_TYPE='main';YFC.Main=function(s,ct)
{this.type=YFC.Main_TYPE;this.ind=YFC.INDICATOR_MAIN;this.symbol=s;this.chartType=ct;this.numColor=1;this.setParamsByVars=function(s)
{var a=s.split(',');this.symbol=a[0];this.chartType=a[1];};this.toVars=function(){return this.type+'('+this.symbol+','+this.chartType+')';};};YFC.Compare=function(s)
{this.type=YFC.Compare_TYPE;this.type='compare';this.ind=YFC.INDICATOR_COMPARE;this.symbol=s;this.numColor=1;this.setParamsByVars=function(s){this.symbol=s;};this.toVars=function(){return this.type+'('+this.symbol+')';};};YFC.TechnicalVolume_TYPE="volume";YFC.TechnicalVolume=function()
{this.type=YFC.TechnicalVolume_TYPE;this.ind=YFC.INDICATOR_TECHNICAL;this.numColor=1;this.setParamsByVars=function(s){};this.toVars=function(){return this.type;};};YFC.TechnicalVolumeMA_TYPE="volumema";YFC.TechnicalVolumeMA=function(p)
{this.type=YFC.TechnicalVolumeMA_TYPE;this.ind=YFC.INDICATOR_TECHNICAL;this.period=p;this.numColor=2;this.setParamsByVars=function(s){this.period=Number(s);};this.toVars=function(){return this.type+'('+this.period+')';};};YFC.TechnicalMACD_TYPE='macd';YFC.TechnicalMACD=function(p1,p2,s)
{this.type=YFC.TechnicalMACD_TYPE;this.ind=YFC.INDICATOR_TECHNICAL;this.period1=p1;this.period2=p2;this.signal=s;this.numColor=3;this.setParamsByVars=function(s)
{var a=s.split(',');this.period1=Number(a[0]);this.period2=Number(a[1]);this.signal=Number(a[2]);};this.toVars=function(){return this.type+'('+this.period1+','+this.period2+','+this.signal+')';};};YFC.TechnicalMFI_TYPE='mfi';YFC.TechnicalMFI=function(p)
{this.type=YFC.TechnicalMFI_TYPE;this.ind=YFC.INDICATOR_TECHNICAL;this.period=p;this.numColor=1;this.setParamsByVars=function(s){this.period=Number(s);};this.toVars=function()
{if(this.period===0){return this.type;}
return this.type+'('+this.period+')';};};YFC.TechnicalRSI_TYPE='rsi';YFC.TechnicalRSI=function(p)
{this.type=YFC.TechnicalRSI_TYPE;this.ind=YFC.INDICATOR_TECHNICAL;this.period=p;this.numColor=1;this.setParamsByVars=function(s){this.period=Number(s);};this.toVars=function()
{if(this.period===0){return this.type;}
return this.type+'('+this.period+')';};};YFC.TechnicalROC_TYPE='roc';YFC.TechnicalROC=function(p)
{this.type=YFC.TechnicalROC_TYPE;this.ind=YFC.INDICATOR_TECHNICAL;this.period=p;this.numColor=1;this.setParamsByVars=function(s){this.period=Number(s);};this.toVars=function()
{if(this.period===0){return this.type;}
return this.type+'('+this.period+')';};};YFC.TechnicalFastStoch_TYPE='stochasticfast';YFC.TechnicalFastStoch=function(k,d)
{this.type=YFC.TechnicalFastStoch_TYPE;this.ind=YFC.INDICATOR_TECHNICAL;this.kperiod=k;this.dperiod=d;this.numColor=2;this.setParamsByVars=function(s)
{var a=s.split(',');this.kperiod=Number(a[0]);this.dperiod=Number(a[1]);};this.toVars=function(){return this.type+'('+this.kperiod+','+this.dperiod+')';};};YFC.TechnicalSlowStoch_TYPE='stochasticslow';YFC.TechnicalSlowStoch=function(k,d)
{this.type=YFC.TechnicalSlowStoch_TYPE;this.ind=YFC.INDICATOR_TECHNICAL;this.kperiod=k;this.dperiod=d;this.numColor=2;this.setParamsByVars=function(s)
{var a=s.split(',');this.kperiod=Number(a[0]);this.dperiod=Number(a[1]);};this.toVars=function(){return this.type+'('+this.kperiod+','+this.dperiod+')';};};YFC.TechnicalWPR_TYPE='wpr';YFC.TechnicalWPR=function(p)
{this.type=YFC.TechnicalWPR_TYPE;this.ind=YFC.INDICATOR_TECHNICAL;this.period=p;this.setParamsByVars=function(s){this.period=Number(s);};this.toVars=function(){return this.type+'('+this.period+')';};};YFC.OverlaySMA_TYPE='sma';YFC.OverlaySMA=function(p1,p2,p3)
{this.type=YFC.OverlaySMA_TYPE;this.ind=YFC.INDICATOR_OVERLAY;this.period1=p1;this.period2=p2;this.period3=p3;this.numColor=1;if(this.period2){this.numColor++;}
if(this.period3){this.numColor++;}
this.setParamsByVars=function(s)
{var a=s.split(',');this.period1=Number(a[0]);this.period2=Number(a[1]);this.period3=Number(a[2]);this.numColor=1;if(this.period2){this.numColor++;}
if(this.period3){this.numColor++;}};this.toVars=function(){return this.type+'('+this.period1+','+this.period2+','+this.period3+')';};};YFC.OverlayEMA_TYPE='ema';YFC.OverlayEMA=function(p1,p2,p3)
{this.type=YFC.OverlayEMA_TYPE;this.ind=YFC.INDICATOR_OVERLAY;this.period1=p1;this.period2=p2;this.period3=p3;this.numColor=1;if(this.period2){this.numColor++;}
if(this.period3){this.numColor++;}
this.setParamsByVars=function(s)
{var a=s.split(',');this.period1=Number(a[0]);this.period2=Number(a[1]);this.period3=Number(a[2]);this.numColor=1;if(this.period2){this.numColor++;}
if(this.period3){this.numColor++;}};this.toVars=function(){return this.type+'('+this.period1+','+this.period2+','+this.period3+')';};};YFC.OverlayBollinger_TYPE='bollinger';YFC.OverlayBollinger=function(p,s)
{this.type=YFC.OverlayBollinger_TYPE;this.ind=YFC.INDICATOR_OVERLAY;this.period=p;this.nstddev=s;this.numColor=1;this.setParamsByVars=function(s)
{var a=s.split(',');this.period=Number(a[0]);this.nstddev=Number(a[1]);};this.toVars=function(){return this.type+'('+this.period+','+this.nstddev+')';};};YFC.OverlayPSAR_TYPE='psar';YFC.OverlayPSAR=function(n,m)
{this.type=YFC.OverlayPSAR_TYPE;this.ind=YFC.INDICATOR_OVERLAY;this.nmin=n;this.nmax=m;this.numColor=1;this.setParamsByVars=function(s)
{var a=s.split(',');this.nmin=Number(a[0]);this.nmax=Number(a[1]);};this.toVars=function(){return this.type+'('+this.nmin+','+this.nmax+')';};};YFC.OverlaySplits_TYPE="split";YFC.OverlaySplits=function(p)
{this.type=YFC.OverlaySplits_TYPE;this.ind=YFC.INDICATOR_OVERLAY;this.numColor=1;this.setParamsByVars=function(s){};this.toVars=function(){return this.type;};};YFC.OverlayDividends_TYPE="dividend";YFC.OverlayDividends=function(p)
{this.type=YFC.OverlayDividends_TYPE;this.ind=YFC.INDICATOR_OVERLAY;this.numColor=1;this.setParamsByVars=function(s){};this.toVars=function(){return this.type;};};

// File: chartstate.js (1.27)

YAHOO.Finance.Charts.ChartState=function()
{this.state="";this.symbol='';this.period='1y';this.main={};this.main.chartType='line';this.log=true;this.crosshair='on';this.update=function(str,cookieflag)
{this.compares=[];this.technicals=[];this.overlays=[];this.state=str;this.source="delayed";this.parse(cookieflag);};};YAHOO.Finance.Charts.ChartState.prototype.parse=function(cookieflag)
{var s=this.state.split(';');for(i=0;i<s.length;i++){this.parseVar(s[i],cookieflag);}};YAHOO.Finance.Charts.ChartState.prototype.toVars=function()
{var vars='symbol='+this.symbol;vars+=';range='+this.period;var str;var ind;if(this.compares.length>0){str='';for(var i=0;i<this.compares.length;i++){ind=this.compares[i];if(str===''){str+=ind.symbol;}
else{str+='+'+ind.symbol;}}
vars+=';compare='+str;}
if(this.overlays.length+this.technicals.length>0){str='';for(i=0;i<this.overlays.length;i++){ind=this.overlays[i];if(str===''){str+=ind.toVars();}
else{str+='+'+ind.toVars();}}
for(i=0;i<this.technicals.length;i++){ind=this.technicals[i];if(str===''){str+=ind.toVars();}
else{str+='+'+ind.toVars();}}
vars+=';indicator='+str;}
var m=this.main.chartType;vars+=';charttype='+m;vars+=';crosshair='+this.crosshair;if(this.log){vars+=';logscale=on';}
else{vars+=';logscale=off';}
return vars;};YAHOO.Finance.Charts.ChartState.prototype.parseVar=function(str,cookieflag)
{var n=str.indexOf('=');var key;var val;var DEFAULT_SYM="^dji";var DEFAULT_IND="volume";if(n==-1){key=str;val='';}
else{key=str.substr(0,n);val=str.substr(n+1);}
if(key=='symbol'&&cookieflag==='false'){val=(decodeURIComponent(val)).toLowerCase();val=val.replace(/[^\^\-\.\=a-zA-Z0-9]/g,'');if(val===""){val=DEFAULT_SYM;}
this.symbol=val;}
else if(key=='range'&&cookieflag==='false'){val=val.toLowerCase();val=val.replace(/[^0-9a-z,]/g,'');if(val===""){val="1y";}
this.period=val;}
else if(key=='crosshair'){val=val.toLowerCase();val=val.replace(/[^a-z]/g,'');if(val==""){val="on";}
this.crosshair=val;}
else if(key=='logscale'){this.log=(val=='off')?false:true;}
else if(key=='charttype'){val=val.toLowerCase();val=val.replace(/[^a-z]/g,'');if(val==""){val="line";}
this.main.chartType=val;}
else if(key=='source'){this.source=val;}
else if(key=='compare'||key=='indicator'){val=val.toLowerCase();var vals=val.split('+');for(var i=0;i<vals.length;i++){var ind=null;if(key=='compare'){vals[i]=vals[i].replace(/[^\^\-\.\=a-zA-Z0-9]/g,'');if(vals[i]){ind=new YAHOO.Finance.Charts.Compare(vals[i]);}}
else if(key=='indicator'){vals[i]=vals[i].replace(/[^\(\)\,\.a-zA-Z0-9]/g,'');if(vals[i]===""){vals[i]=DEFAULT_IND;}
ind=YAHOO.Finance.Charts.createIndicatorByVars(vals[i]);}
if(ind!==null){this.addIndicator(ind);}}}
if(this.symbol===""){this.symbol=DEFAULT_SYM;}};YAHOO.Finance.Charts.ChartState.prototype.addIndicator=function(ind)
{if(ind===null){return;}
if(ind.ind==YAHOO.Finance.Charts.INDICATOR_OVERLAY){this.overlays.push(ind);}
else if(ind.ind==YAHOO.Finance.Charts.INDICATOR_TECHNICAL){this.technicals.push(ind);}
else if(ind.ind==YAHOO.Finance.Charts.INDICATOR_COMPARE){this.compares.push(ind);}};YAHOO.Finance.Charts.ChartState.prototype.getCompares=function(){return this.compares;};YAHOO.Finance.Charts.ChartState.prototype.addCompares=function(newComps){for(var j=0;j<newComps.length;j++){this.compares.push(new YAHOO.Finance.Charts.Compare(newComps[j]));}};YAHOO.Finance.Charts.ChartState.prototype.removeCompare=function(comp){var updatedCompares=[];var compObj=new YAHOO.Finance.Charts.Compare(comp);while(this.compares.length){var c=this.compares.shift();if(c.toVars()!=compObj.toVars()){updatedCompares.push(c);}}
this.compares=updatedCompares;};

