
var CAPTION_FILING='Filing';var CAPTION_FILINGS='Filings';var CAPTION_GLOBAL_REPORT='Global Report';var CAPTION_GLOBAL_REPORTS='Global Reports';var CAPTION_HEADLINE='Headline';var CAPTION_INSIDER_TRANSACTION='Insider Transaction';var CAPTION_INSIDER_TRANSACTIONS='Insider Transactions';var CAPTION_NEWS_SOURCE='News Source';var CAPTION_PUB_DATE='Pub Date';var CAPTION_PUBLICATION_DATE='Publication Date';var CAPTION_STORY='News';var CAPTION_STORIES='News';var CHART_DURATION_INTRADAY='2-11-2-0-0-009301600';var CHART_DURATION_7_DAY='2-2-18-0-0-77';var CHART_DURATION_1_MONTH='2-2-18-0-0-51';var CHART_DURATION_3_MONTH='2-2-18-0-0-53';var CHART_DURATION_6_MONTH='2-2-18-0-0-56';var CHART_DURATION_9_MONTH='2-2-18-0-0-59';var CHART_DURATION_12_MONTH='2-2-18-0-0-512';var CHART_DURATION_24_MONTH='2-2-18-0-0-524';var CHART_DURATION_36_MONTH='2-2-18-0-0-536';var CHART_DURATION_48_MONTH='2-2-18-0-0-548';var CHART_DURATION_60_MONTH='2-2-18-0-0-560';var CHART_DURATION_DEFAULT=CHART_DURATION_3_MONTH;var CHART_DURATION_CAP_INTRADAY='Intraday';var CHART_DURATION_CAP_7_DAY='7 Day';var CHART_DURATION_CAP_1_MONTH='1 Mon';var CHART_DURATION_CAP_3_MONTH='3 Mon';var CHART_DURATION_CAP_6_MONTH='6 Mon';var CHART_DURATION_CAP_9_MONTH='9 Mon';var CHART_DURATION_CAP_12_MONTH='12 Mon';var CHART_DURATION_CAP_24_MONTH='24 Mon';var CHART_DURATION_CAP_36_MONTH='36 Mon';var CHART_DURATION_CAP_48_MONTH='48 Mon';var CHART_DURATION_CAP_60_MONTH='60 Mon';var CHART_TYPE_AREA='area';var CHART_TYPE_MOUNTAIN='mountain';var CHART_TYPE_LINE='line';var CHART_TYPE_CANDLESTICK='candlestick';var CHART_TYPE_OHLC='ohlc';var TECH_IND_VOLUME='volume';var TECH_IND_VOLATILITY='volatility';var TECH_IND_RATE_OF_CHANGE='roc';var TECH_IND_MACD='macd';var TECH_IND_WILLIAMS_R='williamsr';var TECH_IND_RSI='rsi';var TECH_IND_MONEY_FLOW_INDEX='mfi';var TECH_IND_ACCUMULATION_DIST='accumDist';var MOVING_AVG_SIMPLE='simple';var MOVING_AVG_WEIGHTED='weighted';var MOVING_AVG_EXPONENTIAL='exponential';var MA_BAND_TYPE_NORMAL='1';var MA_BAND_TYPE_ENVELOPE='2';var MA_BAND_TYPE_BOLLINGER='3';var EXCHANGE_NASDAQ_OTC='5';var FUNCTION_OPEN_EDGAR_NEWS='openEdgNews';var PARAM_CODE_TYPE='CodeType';var PARAM_COMPANY_ID='CompanyID';var PARAM_DURATION='Duration';var PARAM_END_ROW='EndRow';var PARAM_FILING_ID='FilingID';var PARAM_FORM_GROUP_ID='FormGroupID';var PARAM_FORM_TYPE_ID='FormTypeID';var PARAM_GR_FILING_ID='GRFilingID';var PARAM_ID='ID';var PARAM_ISSUE_ID='IssueID';var PARAM_ISSUE_SYMBOL='IssueTicker';var PARAM_NEWS_SOURCE_ID='SourceID';var PARAM_PASSWORD='Password';var PARAM_RESULT_SELECT_ID='ResultSelectID';var PARAM_SESSION_ID='SessionID';var PARAM_SORT_DIR='SortOrder';var PARAM_SORT_ON='SortColumn';var PARAM_START_ROW='StartRow';var PARAM_STORY_ID='StoryID';var PARAM_SYMBOL='Ticker';var PARAM_USERNAME='Username';var SORT_NONE='0';var SORT_ASCENDING='A';var SORT_DESCENDING='D';var SORT_SEARCH_FILINGS_BY_FILING_DATE='101';var SORT_SEARCH_FILINGS_BY_RECEIVED_DATE='102';var SORT_SEARCH_FILINGS_BY_NAME='103';var SORT_SEARCH_FILINGS_BY_FORM_TYPE='104';var SORT_SEARCH_FILINGS_BY_PERIOD_END_DATE='105';var SORT_SEARCH_FILINGS_DEFAULT='102';var SORT_SEARCH_INSIDER_TRANS_BY_ID='1';var SORT_SEARCH_INSIDER_TRANS_BY_ISSUE_ID='2';var SORT_SEARCH_INSIDER_TRANS_BY_ISSUER='3';var SORT_SEARCH_INSIDER_TRANS_BY_TRANS_DATE='4';var SORT_SEARCH_INSIDER_TRANS_BY_FILER='5';var SORT_SEARCH_INSIDER_TRANS_DEFAULT='1';var SORT_SEARCH_STORY_BY_PUB_DATE='1';var SORT_SEARCH_STORY_DEFAULT='1';

function EdgarChartFilter(symbol,isIntraday,durationDays,durationMonths,startDate,endDate,compareTo,typeId,showSplits,showDividends,showSpinOffs,movingAverageTypeId,movingAverageDays,movingAverageBandType,movingAverageDeviation,techIndId,techIndHints)
{this.symbol=symbol;this.isIntraday=isIntraday;this.durationDays=durationDays;this.durationMonths=durationMonths;this.startDate=startDate;this.endDate=endDate;this.compareTo=compareTo;this.typeId=typeId;this.showSplits=showSplits;this.showDividends=showDividends;this.showSpinOffs=showSpinOffs;this.movingAverageTypeId=movingAverageTypeId;this.movingAverageDays=movingAverageDays;this.movingAverageBandType=movingAverageBandType;this.movingAverageDeviation=movingAverageDeviation;this.techIndId=techIndId;this.techIndHints=techIndHints;}
function EdgarDashboardPageInfo(symbol,companyId,formGroupOptions,formTypeOptions,newsSourceOptions)
{this.symbol=symbol;this.companyId=companyId;this.formGroupOptions=formGroupOptions;this.formTypeOptions=formTypeOptions;this.newsSourceOptions=newsSourceOptions;}

function PinkEdgarCalls(rootPath)
{this.rootPath=rootPath;if(undefined==this.rootPath)
this.rootPath='/edgar';this.servicePath=this.rootPath+'/ajax';}
PinkEdgarCalls.prototype=new AjaxHelper();PinkEdgarCalls.prototype.emailChart=function(filter)
{return this.synchPostMap(this.servicePath+'/EmailChart.json',filter);}
PinkEdgarCalls.prototype.getAdvancedChartUrl=function(filter,callback)
{if(undefined==callback)
return this.synchPostMap(this.servicePath+'/GetAdvancedChartUrl.json',filter);this.asynchPostMap(this.servicePath+'/GetAdvancedChartUrl.json',filter,callback);}
PinkEdgarCalls.prototype.getChartUrl=function(filter,callback)
{this.asynchPostMap(this.servicePath+'/GetChartUrl.json',filter,callback);}
PinkEdgarCalls.prototype.getCompanyBySymbol=function(symbol,callback)
{var url=this.servicePath+'/GetCompany.json?'+FIELD_SYMBOL+'='+symbol;if(!callback)
return this.synchCall(url);this.asynchCall(url,callback);}
PinkEdgarCalls.prototype.getFilings=function(criteria,callback)
{this.asynchPostMap(this.servicePath+'/GetFilings.json',criteria,callback);}
PinkEdgarCalls.prototype.getGlobalReports=function(criteria,callback)
{this.asynchPostMap(this.servicePath+'/GetGlobalReports.json',criteria,callback);}
PinkEdgarCalls.prototype.getInsiderSummary=function(criteria,callback)
{this.asynchPostMap(this.servicePath+'/GetInsiderSummary.json',criteria,callback);}
PinkEdgarCalls.prototype.getInsiderTrans=function(criteria,callback)
{this.asynchPostMap(this.servicePath+'/GetInsiderTrans.json',criteria,callback);}
PinkEdgarCalls.prototype.getStockQuote=function(symbol)
{return this.synchPostMap(this.servicePath+'/GetStockQuote.json',{symbol:symbol});}
PinkEdgarCalls.prototype.getStories=function(criteria,callback)
{this.asynchPostMap(this.servicePath+'/GetStories.json',criteria,callback);}
PinkEdgarCalls.prototype.getStoryContents=function(id,callback)
{this.asynchPostMap(this.servicePath+'/GetStoryContents.json',{id:id},callback);}
PinkEdgarCalls.prototype.getTradeStats=function(filter,callback)
{if(undefined==callback)
return this.synchPostMap(this.servicePath+'/GetTradeStats.json',filter);this.asynchPostMap(this.servicePath+'/GetTradeStats.json',filter,callback);}
PinkEdgarCalls.prototype.openTradeStatsExcel=function(filter)
{var form=document.createElement('form');var inputField=new InputField();form.action=this.servicePath+'/GetTradeStatsExcel.xls';form.target='_new';form.method='POST';for(var id in filter)
if(filter[id])
form.appendChild(inputField.genHidden(id,filter[id]));form.style.width=0;form.style.height=0;form.style.visibility='hidden';document.body.appendChild(form);form.submit();document.body.removeChild(form);}
PinkEdgarCalls.prototype.isSymbolValid=function(symbol)
{return this.synchPostMap(this.servicePath+'/IsSymbolValid.json',{symbol:symbol}).payload;}
PinkEdgarCalls.prototype.getChartDurationsAsListItems=function()
{return this.synchCall(this.servicePath+'/GetChartDurationsAsListItems');}
PinkEdgarCalls.prototype.getFormGroupsAsListItems=function()
{return this.synchCall(this.servicePath+'/GetFormGroupsAsListItems');}
PinkEdgarCalls.prototype.getFormTypesAsListItems=function()
{return this.synchCall(this.servicePath+'/GetFormTypesAsListItems');}
PinkEdgarCalls.prototype.getNewsSourcesAsListItems=function()
{return this.synchCall(this.servicePath+'/GetNewsSourcesAsListItems');}

function EdgarAppNav(rootPath)
{this.rootPath=rootPath;if(undefined==this.rootPath)
this.rootPath='/edgar';}
EdgarAppNav.prototype.openFilingPdf=function(id)
{return window.open(this.rootPath+'/GetFilingPdf?'+PARAM_FILING_ID+'='+id);}
EdgarAppNav.prototype.openFilingRtf=function(id)
{return window.open(this.rootPath+'/GetFilingRtf?'+PARAM_FILING_ID+'='+id);}
EdgarAppNav.prototype.openFilingExcel=function(id)
{return window.open(this.rootPath+'/GetFilingExcel?'+PARAM_FILING_ID+'='+id);}
EdgarAppNav.prototype.openFilingHtml=function(id)
{return window.open(this.rootPath+'/GetFilingHtml?'+PARAM_FILING_ID+'='+id);}
EdgarAppNav.prototype.openGlobalReportPdf=function(id)
{return window.open(this.rootPath+'/GetGlobalReportPdf?'+PARAM_FILING_ID+'='+id);}

function EdgarChartHtml(imagesPath)
{this.imagesPath=imagesPath;}
EdgarChartHtml.prototype.generate=function(value,callback)
{var output=document.createElement('div');output.className='widgetPackage';output.style.textAlign='center';var anchorList=new FancyAnchorList();var anchorCriteria=new AnchorListCriteria(value.durationOptions,value.criteria.duration,this);anchorCriteria.myCallback=callback;anchorCriteria.myValue=value;var elem=document.createElement('div');elem.className='anchorContainer';anchorList.run(anchorCriteria,elem);output.appendChild(elem);elem=value.image=document.createElement('img');elem.border=0;elem.src=value.url;output.appendChild(document.createElement('br'));output.appendChild(document.createElement('br'));output.appendChild(elem);return output;}
EdgarChartHtml.prototype.handleAnchorSelect=function(id,caption,criteria)
{criteria.myCallback.changeDuration(criteria.myValue,id);return false;}

function EdgarChartAdvancedDOM(imagesPath,defaults)
{this.imagesPath=imagesPath;this.inputField=new InputField();this.selectList=new SelectListDOM();this.anchorList=new FancyAnchorList();this.anchorList.CSS_MAIN='powerAnchorList';this.defaults=(undefined==defaults)?this.DEFAULTS:defaults;var list=this.DEVIATION_LIST;this.deviationList={ids:list,values:list};this.contentWindow=new ContentWindow('menubar=no,toolbar=no,status=no,width=800px,height=500px,resizable=no,scrollbars=no');}
EdgarChartAdvancedDOM.prototype.DURATION_LIST={ids:[{isIntraday:true},{days:5},{months:1},{months:3},{months:6},{isYTD:true},{months:12},{months:60},{months:120}],values:['1d','5d','1m','3m','6m','YTD','1y','5y','10y']};EdgarChartAdvancedDOM.prototype.SNAPSHOT_DURATION_LIST={ids:[{isIntraday:true},{days:5},{months:3},{months:6},{months:12},{months:24},{months:60}],values:['1d','5d','3m','6m','1y','2y','5y']};EdgarChartAdvancedDOM.prototype.COMPARE_TITLES=['S&P 500','NASDAQ Composite','DJIA'];EdgarChartAdvancedDOM.prototype.COMPARE_SYMBOLS=['SPX','COMP','.INDU'];EdgarChartAdvancedDOM.prototype.CAPTION_ENTER_SYMBOL='Enter Symbol';EdgarChartAdvancedDOM.prototype.DEFAULTS={volatility:10,rateOfChange:30,macd:[26,12,26],williamsR:14,rsi:30,moneyFlowIndex:14,accumDist:14,simpleMovingAvg:[10],weightedMovingAvg:[10],exponentialMovingAvg:[10]};EdgarChartAdvancedDOM.prototype.DEVIATION_LIST=[1,2,3,4,5,6,7,8,9,10];EdgarChartAdvancedDOM.prototype.generate=function(value,callback)
{var criteria=value.criteria;var anchorListCriteria=new AnchorListCriteria(this.DURATION_LIST,this.DURATION_LIST.ids[3],this);anchorListCriteria.myCallback=callback;anchorListCriteria.myValue=value;var a,elem,elem2,section,output=document.createElement('div');output.className='widgetPackage';output.style.width='100%';output.style.textAlign='left';var table=document.createElement('table');table.className='chartDateFields';table.cellSpacing=0;var tr,td,rows=0;tr=table.insertRow(rows++);tr.className='chartDateFields';td=tr.insertCell(0);td.className='chartIntervals';elem=document.createElement('div');this.anchorList.run(anchorListCriteria,elem);td.appendChild(elem);td=tr.insertCell(1);td.className='chartDateFields';td.appendChild(this.genDateFields(value,callback));output.appendChild(table);output.appendChild(document.createElement('br'));output.appendChild(section=criteria.chartSection=document.createElement('div'));section.className='widgetPackage';section.id='chartContainer';section.appendChild(elem2=criteria.viewChartData=document.createElement('div'));elem2.style.textAlign='right';elem2.appendChild(a=this.createAnchor(document.createTextNode('View Chart Data'),this.img_onClick,value,callback));a.myViewer=this;section.appendChild(a=document.createElement('a'));a.style.padding=0;a.href='javascript:void(null)';a.myValue=value;a.myCallback=callback;a.myViewer=this;a.onclick=this.img_onClick;a.appendChild(elem=criteria.image=document.createElement('img'));elem.src=value.url;elem.border=0;elem.title='Click to view data.';elem.myViewChartDataSection=elem2;elem.onload=this.img_onLoad;section.appendChild(document.createElement('br'));section.appendChild(document.createElement('br'));table=document.createElement('table');table.cellSpacing=0;table.className='chartOptions';tr=table.insertRow(0);td=tr.insertCell(0);td.className='right';elem=document.createElement('div');elem.className='subTabberBox';td.appendChild(elem);var elem2=document.createElement('div');elem2.className='subTabberTopLeft';elem.appendChild(elem2);elem=document.createElement('div');elem.className='subTabberTopRight';elem2.appendChild(elem);elem2=document.createElement('div');elem2.className='subTabberBottomLeft';elem.appendChild(elem2);elem=document.createElement('div');elem.className='subTabberBottomRight';elem2.appendChild(elem);elem2=document.createElement('div');elem2.className='subTabberPackage';elem.appendChild(elem2);var tabbers=criteria.tabbers=new Tabbers(new EdgarChartAdvancedDOMTabberOpts(value,callback,this));tabbers.CSS_MAIN='subTabber'
tabbers.CSS_BODY='subTabberBody';tabbers.run(elem2);td=tr.insertCell(1);td.className='left';td.appendChild(this.genOtherActions(value,callback));section.appendChild(table);output.appendChild(section=criteria.listingSection=document.createElement('div'));section.className='widgetPackage';section.style.display='none';section.appendChild(this.createAnchor(document.createTextNode('<< Back to Chart'),this.backToChart_onClick,value,callback));section.appendChild(document.createElement('br'));section.appendChild(table=document.createElement('table'));table.cellSpacing=0;table.border=0;table.cellPadding=0;table.style.width='100%';tr=table.insertRow(0);td=tr.insertCell(0);td.className='h2';td.appendChild(document.createTextNode('Historical Chart Data'));td=tr.insertCell(1);td.style.textAlign='right';td.appendChild(this.createAnchor(document.createTextNode('Download Spreadsheet'),this.downloadSpreadsheet_onClick,value,callback));section.appendChild(elem=criteria.listingBody=document.createElement('div'));table.style.padding=elem.style.padding='5px 3px';elem.style.overflow='auto';return output;}
EdgarChartAdvancedDOM.prototype.generateSnapShot=function(value,callback)
{var output=document.createElement('div');output.className='widgetPackage';output.style.textAlign='center';var elem=value.criteria.image=document.createElement('img');elem.border=0;elem.src=value.url;if(value.isLink!=undefined&&value.isLink==true){var a=document.createElement('a');a.innerHTML='';a.href='javascript:void(null);';a.onclick=function(ev){callback.openChart();};a.appendChild(elem);output.appendChild(a);}
else{output.appendChild(elem);}
var anchorList=new FancyAnchorList();var anchorCriteria=new AnchorListCriteria(this.SNAPSHOT_DURATION_LIST,this.SNAPSHOT_DURATION_LIST.ids[3],this);anchorCriteria.myCallback=callback;anchorCriteria.myValue=value;elem=document.createElement('div');elem.className='anchorContainer';anchorList.run(anchorCriteria,elem);output.appendChild(elem);return output;}
EdgarChartAdvancedDOM.prototype.genDateFields=function(value,callback)
{var date=new Date();date.setMonth(date.getMonth()-3);var elem;var output=document.createElement('form');output.onsubmit=function(ev){return false;};output.className='widgetPackage';output.appendChild(elem=this.inputField.genTextBox('startDate',10,12));elem.value=formatInputDate(date);elem.className='calendarField';elem.myCallback=this;elem.onfocus=this.openCalendar;value.criteria.startDateField=elem;output.appendChild(this.createSpan('&nbsp; to &nbsp;'));output.appendChild(elem=this.inputField.genTextBox('endDate',10,12));elem.value=formatInputDate(new Date());elem.className='calendarField';elem.myCallback=this;elem.onfocus=this.openCalendar;value.criteria.endDateField=elem;output.appendChild(this.createSpan('&nbsp;&nbsp;'));output.appendChild(elem=this.inputField.genSubmitX('ok','Go','actionGo'));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.dateForm_onClick;return output;}
EdgarChartAdvancedDOM.prototype.genOtherActions=function(value,callback)
{var elem,output=document.createElement('div');output.className='widgetPackage';output.appendChild(elem=this.inputField.genButtonX('reset','Reset',this.reset_onClick,'buttonReset'));elem.myCallback=callback;elem.myValue=value;output.appendChild(document.createElement('br'));output.appendChild(document.createElement('br'));output.appendChild(elem=this.inputField.genButtonX('print','Print',this.print_onClick,'buttonPrint'));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;output.appendChild(document.createElement('br'));output.appendChild(document.createElement('br'));output.appendChild(elem=this.inputField.genButtonX('email','Email',this.email_onClick,'buttonEmail'));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;return output;}
EdgarChartAdvancedDOM.prototype.doCompare=function(body,options)
{var callback=options.callback;var value=options.value;var output=document.createElement('form');output.className='widgetPackage';output.onsubmit=function(ev){return false;}
var table=document.createElement('table');table.cellSpacing=0;table.className='chartCompareSymbols';var tr=table.insertRow(0);var elem;var tr1,td1,table1=document.createElement('table');table1.className='chartSettings';table1.cellSpacing=0;for(var i=0;i<this.COMPARE_TITLES.length;i++)
{tr1=table1.insertRow(i);td1=tr1.insertCell(0);td1.className='field';var title=this.COMPARE_TITLES[i];td1.appendChild(elem=this.inputField.genCheckBox(title,this.COMPARE_SYMBOLS[i],false));td1=tr1.insertCell(1);td1.className='caption';td1.appendChild(document.createTextNode(title));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.compareSymbol_onClick;}
var td=tr.insertCell(0);td.appendChild(table1);table1=document.createElement('table');table1.className='chartSettings';table1.cellSpacing=0;tr1=table1.insertRow(0);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genTextBox('symbol',15,15));elem.autocomplete='off';elem.value=this.CAPTION_ENTER_SYMBOL;elem.myCallback=this;elem.onfocus=function(ev){if(this.value==this.myCallback.CAPTION_ENTER_SYMBOL)this.value='';};td1=tr1.insertCell(1);td1.className='caption';td1.appendChild(elem=this.inputField.genSubmitX('addSymbol','Add','actionAdd'));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.addSymbol_onClick;tr1=table1.insertRow(1);td1=tr1.insertCell(0);td1.colSpan=2;elem.myTable=document.createElement('table');elem.myTable.cellSpacing=0;elem.myTable.className='chartCompareSymbols';td1.appendChild(document.createElement('br'));td1.appendChild(elem.myTable);td=tr.insertCell(1);td.appendChild(table1);td=tr.insertCell(2);var elem=document.createElement('div');elem.appendChild(document.createTextNode('Including index selections, the symbol comparison max = '+callback.MAX_COMPARISONS));elem.className='notes';td.appendChild(elem);output.appendChild(table);body.innerHTML='';body.appendChild(output);}
EdgarChartAdvancedDOM.prototype.doSettings=function(body,options)
{var callback=options.callback;var value=options.value;var output=document.createElement('form');output.className='widgetPackage';value.criteria.mySettingsForm=output;var table=document.createElement('table');table.className='chartSettings';table.cellSpacing=0;var sub=table.createTHead();var tr=sub.insertRow(0);var td=tr.insertCell(0);td.colSpan=2;td.appendChild(document.createTextNode('Chart Type'));var td=tr.insertCell(1);td.colSpan=2;td.appendChild(document.createTextNode('Display'));var sub=document.createElement('tbody');table.appendChild(sub);tr=sub.insertRow(0);var elem,isIntraday=value.criteria.filter.isIntraday;var table1=document.createElement('table');table1.cellSpacing=0;var tr1=table1.insertRow(0);var td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('chartType',CHART_TYPE_AREA,isIntraday));td1=elem.myCaption=tr1.insertCell(1);td1.appendChild(document.createTextNode('Area'));elem.disabled=!isIntraday;elem.canDoIntraday=true;elem.canDoMultiday=false;elem.myCallback=callback;elem.myValue=value;elem.onclick=this.chartType_onClick;elem.myCaption.className=elem.disabled?'disabled':'caption';tr1=table1.insertRow(1);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('chartType',CHART_TYPE_MOUNTAIN,!isIntraday));td1=elem.myCaption=tr1.insertCell(1);td1.appendChild(document.createTextNode('Mountain'));elem.canDoIntraday=true;elem.canDoMultiday=true;elem.myCallback=callback;elem.myValue=value;elem.onclick=this.chartType_onClick;elem.myCaption.className=elem.disabled?'disabled':'caption';tr1=table1.insertRow(2);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('chartType',CHART_TYPE_LINE,false));td1=elem.myCaption=tr1.insertCell(1);td1.appendChild(document.createTextNode('Line'));elem.canDoIntraday=true;elem.canDoMultiday=true;elem.myCallback=callback;elem.myValue=value;elem.onclick=this.chartType_onClick;elem.myCaption.className=elem.disabled?'disabled':'caption';td=tr.insertCell(0);td.appendChild(table1);table1=document.createElement('table');table1.cellSpacing=0;tr1=table1.insertRow(0);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('chartType',CHART_TYPE_CANDLESTICK,false));elem.disabled=isIntraday;elem.canDoIntraday=false;elem.canDoMultiday=true;elem.myCallback=callback;elem.myValue=value;elem.onclick=this.chartType_onClick;td1=elem.myCaption=tr1.insertCell(1);td1.className=elem.disabled?'disabled':'caption';td1.appendChild(document.createTextNode('Candlestick'));tr1=table1.insertRow(1);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('chartType',CHART_TYPE_OHLC,false));elem.disabled=isIntraday;elem.canDoIntraday=false;elem.canDoMultiday=true;elem.myCallback=callback;elem.myValue=value;elem.onclick=this.chartType_onClick;td1=elem.myCaption=tr1.insertCell(1);td1.className=elem.disabled?'disabled':'caption';td1.appendChild(document.createTextNode('Open High Low Close'));td=tr.insertCell(1);td.appendChild(table1);table1=document.createElement('table');table1.cellSpacing=0;tr1=table1.insertRow(0);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genCheckBox('splits','splits',false));td1=elem.myCaption=tr1.insertCell(1);td1.appendChild(document.createTextNode('Splits'));elem.disabled=isIntraday;elem.myCallback=callback;elem.myValue=value;elem.onclick=this.splits_onClick;elem.myCaption.className=elem.disabled?'disabled':'caption';tr1=table1.insertRow(1);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genCheckBox('dividends','dividends',false));td1=elem.myCaption=tr1.insertCell(1);td1.appendChild(document.createTextNode('Dividends'));elem.disabled=isIntraday;elem.myCallback=callback;elem.myValue=value;elem.onclick=this.dividends_onClick;elem.myCaption.className=elem.disabled?'disabled':'caption';td=tr.insertCell(2);td.appendChild(table1);table1=document.createElement('table');table1.cellSpacing=0;tr1=table1.insertRow(0);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genCheckBox('spinoffs','spinoffs',false));td1=elem.myCaption=tr1.insertCell(1);td1.appendChild(document.createTextNode('Spin-offs'));elem.disabled=isIntraday;elem.myCallback=callback;elem.myValue=value;elem.onclick=this.spinoffs_onClick;elem.myCaption.className=elem.disabled?'disabled':'caption';td=tr.insertCell(3);td.appendChild(table1);output.appendChild(table);body.innerHTML='';body.appendChild(output);}
EdgarChartAdvancedDOM.prototype.doIndicators=function(body,options)
{var callback=options.callback;var value=options.value;var output=value.criteria.myIndicatorsForm=document.createElement('form');output.className='widgetPackage';var table=document.createElement('table');table.className='chartSettings';table.cellSpacing=0;var sub=table.createTHead();var tr=sub.insertRow(0);var td=tr.insertCell(0);td.colSpan=2;td.appendChild(document.createTextNode('Indicators'));var td=tr.insertCell(1);td.appendChild(document.createTextNode('Moving Averages'));var sub=document.createElement('tbody');table.appendChild(sub);tr=sub.insertRow(0);var isIntraday=value.criteria.filter.isIntraday
var elem,rows=0;var table1=document.createElement('table');var tr1=table1.insertRow(rows++);var td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('techInd',TECH_IND_VOLUME,true));elem.myCallback=callback;elem.myValue=value;elem.onclick=this.volume_onClick;td1=tr1.insertCell(1);td1.className='caption';td1.appendChild(document.createTextNode('Volume'));tr1=table1.insertRow(rows++);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('techInd',TECH_IND_VOLATILITY,false));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.techInd_onClick;elem.myCaption='Volatility';elem.myDefaults=this.defaults.volatility;elem.disabled=isIntraday;td1=elem.myLabel=tr1.insertCell(1);td1.className=isIntraday?'disabled':'caption';td1.appendChild(document.createTextNode(elem.myCaption));tr1=table1.insertRow(rows++);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('techInd',TECH_IND_RATE_OF_CHANGE,false));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.techInd_onClick;elem.myCaption='Rate of Change';elem.myDefaults=this.defaults.rateOfChange;elem.disabled=isIntraday;td1=elem.myLabel=tr1.insertCell(1);td1.className=isIntraday?'disabled':'caption';td1.appendChild(document.createTextNode(elem.myCaption));tr1=table1.insertRow(rows++);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('techInd',TECH_IND_MACD,false));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.macd_onClick;elem.myCaption='Moving Average Convergence Divergence (MACD)';elem.myDefaults=this.defaults.macd;elem.disabled=isIntraday;td1=elem.myLabel=tr1.insertCell(1);td1.className=isIntraday?'disabled':'caption';td1.appendChild(document.createTextNode('MACD'));td=tr.insertCell(0);td.appendChild(table1);rows=0;table1=document.createElement('table');tr1=table1.insertRow(rows++);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('techInd',TECH_IND_WILLIAMS_R,false));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.techInd_onClick;elem.myCaption='Williams %R';elem.myDefaults=this.defaults.williamsR;elem.disabled=isIntraday;td1=elem.myLabel=tr1.insertCell(1);td1.className=isIntraday?'disabled':'caption';td1.appendChild(document.createTextNode(elem.myCaption));tr1=table1.insertRow(rows++);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('techInd',TECH_IND_RSI,false));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.techInd_onClick;elem.myCaption='Relative Strength Index';elem.myDefaults=this.defaults.rsi;elem.disabled=isIntraday;td1=elem.myLabel=tr1.insertCell(1);td1.className=isIntraday?'disabled':'caption';td1.appendChild(document.createTextNode(elem.myCaption));tr1=table1.insertRow(rows++);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('techInd',TECH_IND_MONEY_FLOW_INDEX,false));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.techInd_onClick;elem.myCaption='Money Flow Index';elem.myDefaults=this.defaults.moneyFlowIndex;elem.disabled=isIntraday;td1=elem.myLabel=tr1.insertCell(1);td1.className=isIntraday?'disabled':'caption';td1.appendChild(document.createTextNode(elem.myCaption));tr1=table1.insertRow(rows++);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('techInd',TECH_IND_ACCUMULATION_DIST,false));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.techInd_onClick;elem.myCaption='Accumulation/Distribution';elem.myDefaults=this.defaults.accumDist;elem.disabled=isIntraday;td1=elem.myLabel=tr1.insertCell(1);td1.className=isIntraday?'disabled':'caption';td1.appendChild(document.createTextNode(elem.myCaption));td=tr.insertCell(1);td.appendChild(table1);output.myMovingAverages=new Array();var criteria=value.criteria;var disabled=isIntraday||((undefined!=criteria.filter.compareTo)&&(0<criteria.filter.compareTo.length));rows=0;table1=document.createElement('table');tr1=table1.insertRow(rows++);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('movingAvg','',true));elem.myCallback=callback;elem.myValue=value;elem.onclick=this.movingAvg_onClick;elem.myCaption='No Selection';elem.disabled=disabled;td1=elem.myLabel=tr1.insertCell(1);td1.className=disabled?'disabled':'caption';td1.appendChild(document.createTextNode(elem.myCaption));output.myMovingAverages[output.myMovingAverages.length]=elem;tr1=table1.insertRow(rows++);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('movingAvg',MOVING_AVG_SIMPLE,false));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.movingAvg_onClick;elem.myCaption='Simple Moving Average';elem.myDefaults=this.defaults.simpleMovingAvg;elem.disabled=disabled;td1=elem.myLabel=tr1.insertCell(1);td1.className=disabled?'disabled':'caption';td1.appendChild(document.createTextNode(elem.myCaption));output.myMovingAverages[output.myMovingAverages.length]=elem;tr1=table1.insertRow(rows++);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('movingAvg',MOVING_AVG_WEIGHTED,false));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.movingAvg_onClick;elem.myCaption='Weighted Moving Average';elem.myDefaults=this.defaults.weightedMovingAvg;elem.disabled=disabled;td1=elem.myLabel=tr1.insertCell(1);td1.className=disabled?'disabled':'caption';td1.appendChild(document.createTextNode(elem.myCaption));output.myMovingAverages[output.myMovingAverages.length]=elem;tr1=table1.insertRow(rows++);td1=tr1.insertCell(0);td1.className='field';td1.appendChild(elem=this.inputField.genRadio('movingAvg',MOVING_AVG_EXPONENTIAL,false));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.movingAvg_onClick;elem.myCaption='Exponential Moving Average';elem.myDefaults=this.defaults.exponentialMovingAvg;elem.disabled=disabled;td1=elem.myLabel=tr1.insertCell(1);td1.className=disabled?'disabled':'caption';td1.appendChild(document.createTextNode(elem.myCaption));output.myMovingAverages[output.myMovingAverages.length]=elem;td=tr.insertCell(2);td.appendChild(table1);output.appendChild(table);body.innerHTML='';body.appendChild(output);}
EdgarChartAdvancedDOM.prototype.createSpan=function(value)
{var output=document.createElement('span');output.innerHTML=value;return output;}
EdgarChartAdvancedDOM.prototype.createAnchor=function(elem,onClick,value,callback,extra)
{var output=document.createElement('a');output.href='javascript:void(null);';output.onclick=onClick;output.myCallback=callback;output.myValue=value;output.myExtra=extra;output.appendChild(elem);return output;}
EdgarChartAdvancedDOM.prototype.handleCalendarSelect=function(newDate,elem)
{if(undefined==newDate)
elem.value='';else
elem.value=formatInputDate(newDate);}
EdgarChartAdvancedDOM.prototype.openCalendar=function(ev)
{var me=this.myCallback;if(undefined==me.calendar)
{var popup=me.getPopup();popup.className='calendarContainer';me.calendar=new Calendar(popup,me);}
if(0==this.value.length)
me.calendar.doNow(this);else
me.calendar.doString(this.value,this);}
EdgarChartAdvancedDOM.prototype.openTechInd=function(value,callback,id,caption,defaults)
{var firstField,filter=value.criteria.filter;var output=this.createPopup(value,callback,id,caption,this.techInd_onPeriodSet,callback.getTechIndNotes(id));var table=output.myTable;if((id==filter.techIndId)&&(undefined!=filter.techIndHints))
defaults=filter.techIndHints;var tr=table.insertRow(0);var td=tr.insertCell(0);td.className='caption';td.appendChild(document.createTextNode('Period'));td=tr.insertCell(1);td.className='field';td.appendChild(firstField=this.inputField.genTextBox('period',3,3));firstField.value=defaults;td.appendChild(this.createSpan('&nbsp;Days'));ModalDialog.open(caption,output);firstField.focus();}
EdgarChartAdvancedDOM.prototype.openMACD=function(value,callback,id,caption,defaults)
{var elem,firstField,filter=value.criteria.filter;var output=this.createPopup(value,callback,id,caption,this.macd_onPeriodSet,callback.getTechIndNotes(id));var table=output.myTable;if((id==filter.techIndId)&&(undefined!=filter.techIndHints)&&(2<filter.techIndHints.length))
defaults=filter.techIndHints;var rows=0;var tr=table.insertRow(rows++);var td=tr.insertCell(0);td.className='caption';td.appendChild(document.createTextNode('Slow Period'));td=tr.insertCell(1);td.className='field';td.appendChild(firstField=this.inputField.genTextBox('slowPeriod',3,3));firstField.value=defaults[0];td.appendChild(this.createSpan('&nbsp;Days'));tr=table.insertRow(rows++);td=tr.insertCell(0);td.className='caption';td.appendChild(document.createTextNode('Fast Period'));td=tr.insertCell(1);td.className='field';td.appendChild(elem=this.inputField.genTextBox('fastPeriod',3,3));elem.value=defaults[1];td.appendChild(this.createSpan('&nbsp;Days'));tr=table.insertRow(rows++);td=tr.insertCell(0);td.className='caption';td.appendChild(document.createTextNode('Trigger Period'));td=tr.insertCell(1);td.className='field';td.appendChild(elem=this.inputField.genTextBox('triggerPeriod',3,3));elem.value=defaults[2];td.appendChild(this.createSpan('&nbsp;Days'));ModalDialog.open(caption,output);firstField.focus();}
EdgarChartAdvancedDOM.prototype.openMovingAvg=function(value,callback,id,caption,defaults)
{var elem,firstField,filter=value.criteria.filter;var output=this.createPopup(value,callback,id,caption,this.movingAvg_onPeriodSet,callback.getMovingAvgNotes(id));var table=output.myTable;if((id==filter.movingAverageTypeId)&&(undefined!=filter.movingAverageDays)&&(0<filter.movingAverageDays.length))
defaults=filter.movingAverageDays;var rows=0;var tr=table.insertRow(rows++);var td=tr.insertCell(0);td.className='caption';td.appendChild(document.createTextNode('First Period'));td=tr.insertCell(1);td.className='field';td.appendChild(firstField=this.inputField.genTextBox('period1',3,3));firstField.value=defaults[0];td.appendChild(this.createSpan('&nbsp;Days'));tr=table.insertRow(rows++);td=tr.insertCell(0);td.className='caption';td.appendChild(document.createTextNode('Second Period'));td=tr.insertCell(1);td.className='field';td.appendChild(elem=this.inputField.genTextBox('period2',3,3));elem.value=(2>defaults.length)?'':defaults[1];td.appendChild(this.createSpan('&nbsp;Days'));tr=table.insertRow(rows++);td=tr.insertCell(0);td.className='caption';td.appendChild(document.createTextNode('Third Period'));td=tr.insertCell(1);td.className='field';td.appendChild(elem=this.inputField.genTextBox('period3',3,3));elem.value=(3>defaults.length)?'':defaults[2];td.appendChild(this.createSpan('&nbsp;Days'));tr=table.insertRow(rows++);td=tr.insertCell(0);td.className='caption';td.appendChild(document.createTextNode('Band Type'));td=tr.insertCell(1);td.className='field';td.appendChild(elem=this.inputField.genRadio('bandType',MA_BAND_TYPE_NORMAL,true));elem.hasDeviation=false;elem.onclick=this.bandType_onClick;td.appendChild(this.createSpan('&nbsp;Normal&nbsp;&nbsp;'));td.appendChild(elem=this.inputField.genRadio('bandType',MA_BAND_TYPE_ENVELOPE,false));elem.hasDeviation=true;elem.deviationCaption='% Deviance from Moving Avg.';elem.deviationDefault=3;elem.onclick=this.bandType_onClick;td.appendChild(this.createSpan('&nbsp;% Envelope&nbsp;&nbsp;'));td.appendChild(elem=this.inputField.genRadio('bandType',MA_BAND_TYPE_BOLLINGER,false));elem.hasDeviation=true;elem.deviationCaption='Standard Deviations';elem.deviationDefault=2;elem.onclick=this.bandType_onClick;td.appendChild(this.createSpan('&nbsp;Bollinger Bands'));var myForm=output;div=document.createElement('div');div.style.display='none';div.appendChild(myForm.deviationCaption=this.createSpan('Standard Deviations'));div.appendChild(this.createSpan('&nbsp;&nbsp;'));div.appendChild(this.selectList.generate('deviation',this.deviationList));td.appendChild(div);myForm.myBandType=MA_BAND_TYPE_NORMAL;myForm.myDeviation=div;myForm.hasDeviation=false;ModalDialog.open(caption,output);firstField.focus();}
EdgarChartAdvancedDOM.prototype.openEmail=function(value,callback)
{var elem,firstField,output=document.createElement('form');output.className='widgetPackage';output.onsubmit=function(ev){return false;};var table=document.createElement('table');table.cellSpacing=0;table.className='modalForm';var rows=0;var tr=table.insertRow(rows++);var td=tr.insertCell(0);td.className='caption';td.appendChild(document.createTextNode('Recipient Emails'));td=tr.insertCell(1);td.className='field';td.appendChild(firstField=this.inputField.genTextBox('to',500,50));tr=table.insertRow(rows++);td=tr.insertCell(0);td=tr.insertCell(1);td.appendChild(document.createTextNode('Separate multiple addresses with a semi-colon (;).'));tr=table.insertRow(rows++);td=tr.insertCell(0);td.className='caption';td.appendChild(document.createTextNode('Your Name'));td=tr.insertCell(1);td.className='field';td.appendChild(this.inputField.genTextBox('fromName',50,50));tr=table.insertRow(rows++);td=tr.insertCell(0);td.className='caption';td.appendChild(document.createTextNode('Your Email'));td=tr.insertCell(1);td.className='field';td.appendChild(this.inputField.genTextBox('fromEmail',100,50));tr=table.insertRow(rows++);td=tr.insertCell(0);td=tr.insertCell(1);td.appendChild(this.inputField.genCheckBox('includeSelf','1',false));td.appendChild(document.createTextNode(' Copy Yourself'));tr=table.insertRow(rows++);td=tr.insertCell(0);td.className='caption';td.appendChild(document.createTextNode('Add a personal message'));td=tr.insertCell(1);td.className='field';td.appendChild(this.inputField.genTextArea('comments',40,10));tr=table.insertRow(rows++);td=tr.insertCell(0);td.colSpan=2;td.className='actions';td.appendChild(elem=this.inputField.genSubmitX('ok','Send','actionSend'));elem.myCallback=callback;elem.myValue=value;elem.myViewer=this;elem.onclick=this.email_send;td.appendChild(this.createSpan('&nbsp;&nbsp;'));td.appendChild(elem=this.inputField.genButtonX('cancel','Cancel',function(ev){ModalDialog.close();},'actionCancel'));output.appendChild(table);ModalDialog.open('Pink OTC Markets Chart - Email',output);firstField.focus();}
EdgarChartAdvancedDOM.prototype.createPopup=function(value,callback,id,caption,onclick,notes)
{var elem,firstField;var output=document.createElement('form');output.className='widgetPackage';output.onsubmit=function(ev){return false;};var table=document.createElement('table');table.className='modalForm chartPopup';table.cellSpacing=0;var rows=0;var tr=table.insertRow(rows++);tr=table.insertRow(rows++);td=tr.insertCell(0);td.colSpan=2;td.appendChild(document.createTextNode(' '));tr=table.insertRow(rows++);td=tr.insertCell(0);td.className='actions';td.colSpan=2;td.appendChild(elem=this.inputField.genSubmitX('ok','Draw','actionDraw'));elem.myCallback=callback;elem.myValue=value;elem.myId=id;elem.onclick=onclick;elem.myViewer=this;td.appendChild(this.createSpan('&nbsp;&nbsp;'));td.appendChild(elem=this.inputField.genButtonX('cancel','Cancel',function(ev){ModalDialog.close();},'actionCancel'));tr=table.insertRow(rows++);td=tr.insertCell(0);td.colSpan=2;td.appendChild(document.createTextNode(' '));if(undefined!=notes)
{tr=table.insertRow(rows++);td=tr.insertCell(0);td.colSpan=2;td.appendChild(document.createTextNode('Technical Indicator Help'));td.className='header';tr=table.insertRow(rows++);td=tr.insertCell(0);td.colSpan=2;var div=document.createElement('div');div.className='notes';td.appendChild(div);div.innerHTML=notes;}
output.appendChild(table);output.myTable=table;return output;}
EdgarChartAdvancedDOM.prototype.handleAnchorSelect=function(id,caption,criteria)
{var callback=criteria.myCallback;var value=criteria.myValue;var date=undefined;if(id.isIntraday)
{callback.toIntraday(value);}
else if(id.isYTD)
{date=this.getYTD();callback.changeDates(value,date.getTime());}
else if(undefined!=id.days)
{date=new Date();date.setDate(date.getDate()-id.days);callback.changeDays(value,id.days);}
else
{date=new Date();date.setMonth(date.getMonth()-id.months);callback.changeMonths(value,id.months);}
var endDate='';if(undefined==date)
date='';else
{date=formatInputDate(date);endDate=formatInputDate(new Date());}
if(value.criteria.startDateField)
value.criteria.startDateField.value=date;if(value.criteria.endDateField)
value.criteria.endDateField.value=endDate;this.setIntraday(value);}
EdgarChartAdvancedDOM.prototype.setIntraday=function(value)
{var criteria=value.criteria;var isIntraday=value.criteria.filter.isIntraday;var css=isIntraday?'disabled':'caption';var theForm=criteria.mySettingsForm;if(undefined!=theForm)
{theForm.splits.disabled=isIntraday;theForm.splits.myCaption.className=css;theForm.dividends.disabled=isIntraday;theForm.dividends.myCaption.className=css;theForm.spinoffs.disabled=isIntraday;theForm.spinoffs.myCaption.className=css;for(var i=0;i<theForm.chartType.length;i++)
{var elem=theForm.chartType[i];elem.disabled=((isIntraday&&!elem.canDoIntraday)||(!isIntraday&&!elem.canDoMultiday))
elem.myCaption.className=elem.disabled?'disabled':'caption';}}
theForm=criteria.myIndicatorsForm;if(undefined!=theForm)
{for(var i=0;i<theForm.elements.length;i++)
{var elem=theForm.elements[i];if(undefined==elem.myLabel)
continue;elem.disabled=isIntraday;elem.myLabel.className=css;}}
if(!isIntraday)
this.setCompare(value);}
EdgarChartAdvancedDOM.prototype.setCompare=function(value)
{var criteria=value.criteria;var disabled=((undefined!=criteria.filter.compareTo)&&(0<criteria.filter.compareTo.length));var css=disabled?'disabled':'caption';theForm=criteria.myIndicatorsForm;if(undefined!=theForm)
{var elems=theForm.myMovingAverages;for(var i=0;i<elems.length;i++)
{var elem=elems[i];if(undefined==elem.myLabel)
continue;elem.disabled=disabled;elem.myLabel.className=css;}}}
EdgarChartAdvancedDOM.prototype.dateForm_onClick=function(ev)
{var theForm=this.form;var value=this.myValue;var viewer=this.myViewer;if(this.myCallback.changeDates(value,viewer.getDate(theForm.startDate),viewer.getDate(theForm.endDate)))
this.myViewer.setIntraday(value);else
theForm.startDate.focus();return false;}
EdgarChartAdvancedDOM.prototype.img_onLoad=function(ev)
{var elem=this.myViewChartDataSection;if(undefined!=elem.mySizeSet)
return;elem.mySizeSet=true;elem.style.width=this.offsetWidth+'px';}
EdgarChartAdvancedDOM.prototype.img_onClick=function(ev)
{var value=this.myValue;var criteria=value.criteria;this.myCallback.openListing(value,criteria.listingBody);criteria.chartSection.style.display='none';criteria.listingSection.style.display='block';}
EdgarChartAdvancedDOM.prototype.backToChart_onClick=function(ev)
{var criteria=this.myValue.criteria;criteria.listingCriteria=undefined;criteria.chartSection.style.display='block';criteria.listingSection.style.display='none';}
EdgarChartAdvancedDOM.prototype.downloadSpreadsheet_onClick=function(ev)
{this.myCallback.openExcel(this.myValue);}
EdgarChartAdvancedDOM.prototype.compareSymbol_onClick=function(ev)
{var me=this.myCallback;var value=this.myValue;try
{var symbol=this.value;if(this.checked)
me.addCompare(value,symbol);else
me.removeCompare(value,symbol);this.myViewer.setCompare(value);}
catch(error){window.alert(error);this.checked=false;}}
EdgarChartAdvancedDOM.prototype.addSymbol_onClick=function(ev)
{var me=this.myCallback;var value=this.myValue;var viewer=this.myViewer;var symbol_=this.form.symbol;var symbol=symbol_.value;if(0==symbol.length)
{window.alert('Please provide a '+CAPTION_SYMBOL+'.');symbol_.focus();return false;}
symbol=symbol.toUpperCase();try
{me.validateSymbol(symbol);if(!me.addCompare(value,symbol))
return false;}
catch(error){window.alert(error);return false;}
viewer.setCompare(value);var parent=this.myTable;var elem,tr,td=undefined,rows=parent.rows;if(0<parent.rows.length)
{tr=rows[rows.length-1];td=tr.cells[0];}
if((undefined!=td)&&(2==td.colSpan))
{td.colSpan=1;td=tr.insertCell(1);}
else
{tr=parent.insertRow(rows.length);td=tr.insertCell(0);td.colSpan=2;}
td.appendChild(elem=viewer.inputField.genCheckBox('addedSymbol',symbol,true));td.appendChild(viewer.createSpan('&nbsp;'));td.appendChild(document.createTextNode(symbol));elem.myCallback=me;elem.myValue=value;elem.myViewer=viewer;elem.onclick=viewer.compareSymbol_onClick;symbol_.value='';symbol_.focus();return false;}
EdgarChartAdvancedDOM.prototype.chartType_onClick=function(ev)
{this.myCallback.changeType(this.myValue,this.value);}
EdgarChartAdvancedDOM.prototype.splits_onClick=function(ev)
{this.myCallback.showSplits(this.myValue,this.checked);}
EdgarChartAdvancedDOM.prototype.dividends_onClick=function(ev)
{this.myCallback.showDividends(this.myValue,this.checked);}
EdgarChartAdvancedDOM.prototype.spinoffs_onClick=function(ev)
{this.myCallback.showSpinOffs(this.myValue,this.checked);}
EdgarChartAdvancedDOM.prototype.volume_onClick=function(ev)
{this.myCallback.changeTechInd(this.myValue,this.value);}
EdgarChartAdvancedDOM.prototype.techInd_onClick=function(ev)
{this.myViewer.openTechInd(this.myValue,this.myCallback,this.value,this.myCaption,this.myDefaults);}
EdgarChartAdvancedDOM.prototype.techInd_onPeriodSet=function(ev)
{var me=this.myViewer;var field=this.form.period;var value=field.value;try
{me.valHint(value,'Period');this.myCallback.changeTechInd(this.myValue,this.myId,value);ModalDialog.close();}
catch(error)
{window.alert(error);field.focus();}}
EdgarChartAdvancedDOM.prototype.macd_onClick=function(ev)
{this.myViewer.openMACD(this.myValue,this.myCallback,this.value,this.myCaption,this.myDefaults);}
EdgarChartAdvancedDOM.prototype.macd_onPeriodSet=function(ev)
{var me=this.myViewer;var field,value,hints=new Array();try
{field=this.form.slowPeriod;value=field.value;me.valHint(value,'Slow Period');hints[hints.length]=value;field=this.form.fastPeriod;value=field.value;me.valHint(value,'Fast Period');hints[hints.length]=value;field=this.form.triggerPeriod;value=field.value;me.valHint(value,'Trigger Period');hints[hints.length]=value;this.myCallback.changeTechInd(this.myValue,this.myId,hints);ModalDialog.close();}
catch(error)
{window.alert(error);field.focus();}}
EdgarChartAdvancedDOM.prototype.movingAvg_onClick=function(ev)
{var callback=this.myCallback;var value=this.myValue;if(''==this.value)
callback.removeMovingAvg(value);else
this.myViewer.openMovingAvg(value,callback,this.value,this.myCaption,this.myDefaults);}
EdgarChartAdvancedDOM.prototype.bandType_onClick=function(ev)
{var myForm=this.form;myForm.myBandType=this.value;myForm.hasDeviation=this.hasDeviation;if(!this.hasDeviation)
myForm.myDeviation.style.display='none';else
{myForm.deviationCaption.innerHTML=this.deviationCaption;myForm.deviation.value=this.deviationDefault;myForm.myDeviation.style.display='block';}}
EdgarChartAdvancedDOM.prototype.movingAvg_onPeriodSet=function(ev)
{var me=this.myViewer;var field,value,days=new Array();try
{var theForm=this.form;field=theForm.period1;value=field.value;me.valHint(value,'First Period');days[days.length]=value;field=theForm.period2;value=field.value;if(0<value.length)
{me.valHint(value,'Second Period');days[days.length]=value;}
field=theForm.period3;value=field.value;if(0<value.length)
{me.valHint(value,'Third Period');days[days.length]=value;}
var deviation=undefined;if(theForm.hasDeviation)
{field=theForm.deviation;deviation=theForm.deviation.value;me.valHint(deviation,'Standard Deviation');}
this.myCallback.changeMovingAvg(this.myValue,this.myId,days,theForm.myBandType,deviation);ModalDialog.close();}
catch(error)
{window.alert(error);field.focus();}}
EdgarChartAdvancedDOM.prototype.reset_onClick=function(ev)
{var criteria=this.myValue.criteria;this.myCallback.doSymbol(criteria.filter.symbol,criteria.body);}
EdgarChartAdvancedDOM.prototype.print_onClick=function(ev)
{var me=this.myViewer;if(undefined==me.printCriteria)
{var output='<html><head><title>Pink OTC Markets Chart - Print</title>';output+='<style media="print">.noprint { display: none; }</style>';output+='</head><body class="chartPrint" style="text-align: center; padding: 5px;">';output+='<img src="'+this.myValue.criteria.image.src+'" /><br /><br />';output+='<div id="buttons"></div>';output+='</body></html>';me.printCriteria=new ContentWindowInfo('Pink OTC Markets Chart - Print',output);}
var opened=me.contentWindow.run(me.printCriteria);var body=opened.document.getElementById('buttons');var output='';if(isSafari)
output+='<input type="button" value="Print" onclick="window.print();" class="noprint" />';else
output+='<input type="button" value="" onclick="window.print();" class="actionPrint noprint" />';output+='&nbsp;&nbsp;&nbsp;&nbsp;';if(isSafari)
output+='<input type="button" value="Cancel" onclick="window.close();" class="noprint" />';else
output+='<input type="button" value="" onclick="window.close();" class="actionCancel noprint" />';body.innerHTML=output;}
EdgarChartAdvancedDOM.prototype.email_onClick=function(ev)
{this.myViewer.openEmail(this.myValue,this.myCallback);}
EdgarChartAdvancedDOM.prototype.email_send=function(ev)
{var myForm=this.form;var value=this.myValue;var filter=value.criteria.filter;filter.tos=myForm.to.value;filter.fromName=myForm.fromName.value;filter.fromEmail=myForm.fromEmail.value;filter.includeSelf=myForm.includeSelf.checked;filter.comments=myForm.comments.value;try{this.myCallback.sendEmail(value);}
catch(error)
{window.alert(error);if(error.isError&&error.field)
myForm[error.field].focus();return false;}
ModalDialog.close();}
EdgarChartAdvancedDOM.prototype.getDate=function(field)
{if(0==field.value.length)
return undefined;return parseInputDate(field.value).getTime();}
EdgarChartAdvancedDOM.prototype.getYTD=function()
{var value=new Date();value.setHours(0,0,0,0);value.setMonth(0,1);return value;}
EdgarChartAdvancedDOM.prototype.valHint=function(value,caption)
{if(0==value.length)
throw new String('Please provide a '+caption+' value.');else if(isNaN(parseInt(value)))
throw new String(caption+' must be numeric.');}
EdgarChartAdvancedDOM.prototype.getPopup=function()
{if(undefined==this.popup)
{this.popup=document.createElement('div');this.popup.style.display='none';this.popup.style.position='absolute';this.popup.style.zIndex=100;document.body.insertBefore(this.popup,document.body.firstChild);}
return this.popup;}
function EdgarChartAdvancedDOMTabberOpts(value,callback,viewer)
{this.value=value;this.callback=callback;this.viewer=viewer;this.defaultTab=0;}
EdgarChartAdvancedDOMTabberOpts.prototype.titles=['Compare','Chart Settings','Technical Indicators'];EdgarChartAdvancedDOMTabberOpts.prototype.calls=['doCompare','doSettings','doIndicators'];EdgarChartAdvancedDOMTabberOpts.prototype.onClick=function(args)
{if(args.tab.isPopulated)
return;this.viewer[this.calls[args.index]](args.tab.body,this);args.tab.isPopulated=true;}
EdgarChartAdvancedDOMTabberOpts.prototype.onLoad=function(args){this.onClick(args);}

function EdgarListsBase()
{}
EdgarListsBase.prototype.getSortDirIconImg=function(fieldName,sortedOn,sortedDir,isSubListing)
{var source=this.getSortDirIconSource(fieldName,sortedOn,sortedDir,isSubListing);if(undefined==source)
return'';return'<span class="'+source+'">&nbsp;&nbsp;&nbsp;</span>';}
EdgarListsBase.prototype.getSortDirIconSource=function(fieldName,sortedOn,sortedDir,isSubListing)
{if(fieldName!=sortedOn)
return undefined;if(SORT_ASCENDING==sortedDir)
return isSubListing?'ascendingIconSub':'ascendingIcon';return isSubListing?'descendingIconSub':'descendingIcon';}
EdgarListsBase.prototype.createHeaderCell=function(row,index,caption,sortOn,sortDefaultDir,value,callback)
{var output=row.insertCell(index);output.className='listingHeader';output.style.whiteSpace='nowrap';if(undefined==sortOn)
{output.appendChild(document.createTextNode(caption));return output;}
var anchor=document.createElement('a');anchor.className='listingHeader';anchor.myCallback=callback;anchor.myRecord=value;anchor.mySortOn=sortOn;anchor.mySortDefaultDir=sortDefaultDir;anchor.appendChild(document.createTextNode(caption));anchor.onclick=callback.handleSort;anchor.href='javascript:void(null);';output.appendChild(anchor);if(value.sortOn==sortOn)
{output.appendChild(document.createTextNode(' '));var elem=document.createElement('span');elem.className=(SORT_ASCENDING==value.sortDir)?'ascendingIcon':'descendingIcon';elem.innerHTML='&nbsp;&nbsp;&nbsp;';output.appendChild(elem);}
return output;}
EdgarListsBase.prototype.createDetailCell=function(row,index,value)
{var output=row.insertCell(index);output.className=row.className;output.appendChild(document.createTextNode(value));return output;}
EdgarListsBase.prototype.createNoDataMessage=function(caption)
{var output=document.createElement('div');output.className='tabNoData';output.appendChild(document.createTextNode('No '+caption+' found.'));return output;}

function InsiderSummaryDOM(){}
InsiderSummaryDOM.prototype=new WorklistDOM();InsiderSummaryDOM.prototype.generate=function(value,callback)
{if(0==value.numberOfTransactions)
return this.createNoDataFound(value,callback);var output=document.createElement('table');output.cellSpacing=0;output.className=this.CSS_TABLE;var tr,td,rows=0;tr=output.insertRow(rows++);tr.className=this.getRowCss(rows);this.createHeaderCell(tr,0,'Number of Buy/Sell Transactions');this.createDetailCell(tr,1,value.numberOfTransactions);this.createHeaderCell(tr,2,'Gross Shares Bought/Sold');this.createDetailCell(tr,3,value.grossShares);tr=output.insertRow(rows++);tr.className=this.getRowCss(rows);this.createHeaderCell(tr,0,'Number of Buys');this.createDetailCell(tr,1,value.numberOfBuys);this.createHeaderCell(tr,2,'Shares Bought');this.createDetailCell(tr,3,value.sharesBought);tr=output.insertRow(rows++);tr.className=this.getRowCss(rows);this.createHeaderCell(tr,0,'Number of Sells');this.createDetailCell(tr,1,value.numberOfSells);this.createHeaderCell(tr,2,'Shares Sold');this.createDetailCell(tr,3,value.sharesSold);tr=output.insertRow(rows++);tr.className=this.getRowCss(rows);this.createHeaderCell(tr,0);this.createDetailCell(tr,1);this.createHeaderCell(tr,2,'Net Shares');this.createDetailCell(tr,3,value.netShares);return output;}
InsiderSummaryDOM.prototype.createHeaderCell=function(tr,index,value)
{var elem,output=tr.insertCell(index);output.className=tr.className;if(!value)
return output;output.appendChild(elem=document.createElement('b'));elem.appendChild(document.createTextNode(value));return output;}
InsiderSummaryDOM.prototype.createDetailCell=function(tr,index,value)
{var output=tr.insertCell(index);output.className=tr.className;if(!value)
return output;output.appendChild(document.createTextNode(Formatter.toVolume(value)));return output;}

function ListEdgarNewsMini(){}
ListEdgarNewsMini.prototype=new WorklistDOM();ListEdgarNewsMini.prototype.generate=function(value,callback)
{var records=value.records;if((undefined==records)||(0==records.length))
return this.createNoDataFound(value,callback);var row,cell,rows=0,table,elem;table=document.createElement('table');table.className=this.CSS_TABLE;row=table.insertRow(rows++);row.className=this.CSS_HEADER;this.createHeaderCell(row,0,CAPTION_PUB_DATE,SORT_SEARCH_STORY_BY_PUB_DATE,FIELD_DESCENDING,value,callback);this.createHeaderCell(row,1,'Headline');for(var i=0;i<records.length;i++)
{var record=records[i];row=table.insertRow(rows++);row.className=this.getRowCss(i);this.createDetailCell(row,0,Formatter.toSimpleDate(record.pubDate)).style.width='15%';cell=this.createDetailCell(row,1,'');elem=document.createElement('strong');var a=document.createElement('a');a.className='normal';a.href='javascript:void(null);';a.onclick=callback.handleOpen;a.myCallback=callback;a.myRecord=record;a.myValue=value;a.appendChild(document.createTextNode(record.headline));elem.appendChild(a);cell.appendChild(elem);}
var output=document.createElement('div');output.className='widgetPackage';output.appendChild(table);output.appendChild((new PagingLinksDOM()).generate(value,callback));return output;}
ListEdgarNewsMini.prototype.genStory=function(record,value,callback)
{var output=document.createElement('div');output.className='widgetPackage';output.appendChild(this.createBackButton(record,value,callback));output.appendChild(document.createElement('br'));var elem=document.createElement('div');elem.className='newsContainer';var inner=document.createElement('div');inner.className='innerdiv';var p=document.createElement('span');p.innerHTML=record.contents;inner.appendChild(p);elem.appendChild(inner);output.appendChild(elem);output.appendChild(this.createBackButton(record,value,callback));return output;}
ListEdgarNewsMini.prototype.createBackButton=function(record,value,callback)
{var output=document.createElement('div');output.className='newsBack';var a=document.createElement('a');a.href='javascript:void(null);';a.onclick=callback.reopen;a.myCallback=callback;a.myRecord=record;a.myValue=value;a.psDecorated=true;a.innerHTML='&lt; Back';output.appendChild(a);return output;}

function ListFilingsMini(){}
ListFilingsMini.prototype=new WorklistDOM();ListFilingsMini.prototype.generate=function(value,callback)
{var records=value.records;if((undefined==records)||(0==records.length))
return this.createNoDataFound(value,callback);var table=document.createElement('table');table.className=this.CSS_TABLE;var rows=0;var row=table.insertRow(rows++);var cell_=0;var cell;row.className=this.CSS_HEADER;this.createHeaderCell(row,cell_++,'Form Type',SORT_SEARCH_FILINGS_BY_FORM_TYPE,FIELD_ASCENDING,value,callback);this.createHeaderCell(row,cell_++,'Received',SORT_SEARCH_FILINGS_BY_RECEIVED_DATE,FIELD_DESCENDING,value,callback);this.createHeaderCell(row,cell_++,'Period Ending',SORT_SEARCH_FILINGS_BY_PERIOD_END_DATE,FIELD_DESCENDING,value,callback);this.createHeaderCell(row,cell_++,'Size');this.createHeaderCell(row,cell_++,'Report');for(var i=0;i<records.length;i++)
{var record=records[i];row=table.insertRow(rows++);row.className=this.getRowCss(i);cell_=0;var name=(undefined==record.filedAsName)?record.companyName:record.filedAsName;var hasReport=((0<record.sizeOfFiling)&&!record.paperOnly);var pdf='PDF';if(hasReport)
{cell=row.insertCell(cell_++);cell.className=row.className;cell.appendChild(this.createAnchor(record,callback,record.formTypeCode,undefined,'openFilingHtml'));}
else
this.createDetailCell(row,cell_++,record.formTypeCode);this.createDetailCell(row,cell_++,Formatter.toSimpleDate(record.receivedDate));this.createDetailCell(row,cell_++,Formatter.toDisplayable(Formatter.toSimpleDate(record.periodEndDate)));this.createDetailCell(row,cell_++,Formatter.toFileSize(record.sizeOfFiling));cell=this.createDetailCell(row,cell_++,'');if(hasReport)
{cell.appendChild(this.createAnchor(record,callback,'PDF',this.createImage('/otcqx/img/file_acrobat1.gif','PDF'),'openFilingPdf'));cell.appendChild(this.createSpace());cell.appendChild(this.createAnchor(record,callback,'RTF',this.createImage('/otcqx/img/file_rtf.gif','RTF'),'openFilingRtf'));cell.appendChild(this.createSpace());cell.appendChild(this.createAnchor(record,callback,'HTML',this.createImage('/otcqx/img/file_html.gif','HTML'),'openFilingHtml'));cell.appendChild(this.createSpace());if(record.hasExcel)
cell.appendChild(this.createAnchor(record,callback,'XLS',this.createImage('/otcqx/img/file_xls.gif','Excel'),'openFilingExcel'));}}
var output=document.createElement('div');output.className='widgetPackage';output.appendChild(table);output.appendChild((new PagingLinksDOM()).generate(value,callback));return output;}
ListFilingsMini.prototype.createSpace=function()
{var output=document.createElement('span');output.innerHTML='&nbsp;&nbsp;&nbsp;';return output;}
ListFilingsMini.prototype.createImage=function(src,title)
{var output=document.createElement('img');output.src=src;output.title=title;output.className='bullet';return output;}
ListFilingsMini.prototype.createAnchor=function(record,callback,caption,img,method)
{var output=document.createElement('a');output.myRecord=record;output.myCallback=callback;output.href='javascript:void(null);';output.className='normal';output.onclick=callback[method];if(undefined!=img)
{output.appendChild(img);output.appendChild(document.createTextNode(' '));}
output.appendChild(document.createTextNode(caption));return output;}

function ListInsiderTransMini(){}
ListInsiderTransMini.prototype=new WorklistDOM();ListInsiderTransMini.prototype.generate=function(value,callback)
{var records=value.records;if((undefined==records)||(0==records.length))
return this.createNoDataFound(value,callback);var table=document.createElement('table');table.className=this.CSS_TABLE;var row_=0;var row=table.insertRow(row_++);var cell_=0;var cell;row.className=this.CSS_HEADER;this.createHeaderCell(row,cell_++,'Trans Date',SORT_SEARCH_INSIDER_TRANS_BY_ID,FIELD_DESCENDING,value,callback);this.createHeaderCell(row,cell_++,'Filer',SORT_SEARCH_INSIDER_TRANS_BY_FILER,FIELD_ASCENDING,value,callback);this.createHeaderCell(row,cell_++,'Ownership');this.createHeaderCell(row,cell_++,'Type');this.createHeaderCell(row,cell_++,'Price');this.createHeaderCell(row,cell_++,'Shares');for(var i=0;i<value.records.length;i++)
{var record=value.records[i];row=table.insertRow(row_++);row.className=this.getRowCss(i);cell_=0;this.createDetailCell(row,cell_++,Formatter.toSimpleDate(record.transDate));cell=this.createDetailCell(row,cell_++,record.filerName);if(undefined!=record.relationshipName)
{cell.appendChild(document.createElement('br'));cell.appendChild(document.createTextNode(record.relationshipName));}
this.createDetailCell(row,cell_++,Formatter.toDisplayable(record.ownershipTypeName));this.createDetailCell(row,cell_++,Formatter.toDisplayable(record.typeName));var price;if((undefined==record.priceFrom)&&(undefined==record.priceTo))
price=this.priceToDisplayable();else if(undefined==record.priceTo)
price=Formatter.toPrice(record.priceFrom);else if(undefined==record.priceFrom)
price=Formatter.toPrice(record.priceTo);else
price=Formatter.toPrice(record.priceFrom)+' to '+Formatter.toPrice(record.priceTo);this.createDetailCell(row,cell_++,price);this.createDetailCell(row,cell_++,Formatter.toDisplayable(Formatter.toVolume(record.numberOfShares)));}
var output=document.createElement('div');output.className='widgetPackage';output.appendChild(table);output.appendChild((new PagingLinksDOM()).generate(value,callback));return output;}
ListInsiderTransMini.prototype.priceToDisplayable=function(value)
{if(undefined==value)
return'NA';return value;}

function ListEdgarTradeStatsDOM(){}
ListEdgarTradeStatsDOM.prototype=new WorklistDOM();ListEdgarTradeStatsDOM.prototype.generate=function(value,callback)
{var records=value.records;if((undefined==records)||(0==records.length))
return this.createNoDataFound(value,callback);var filter=value.criteria.filter;var start=0,end=records.length,showPager=(records.length>filter.pageSize);if(showPager)
{start=(value.currentPage-1)*filter.pageSize;end=start+filter.pageSize;if(end>records.length)
end=records.length;value.pageSize=filter.pageSize;value.pages=Math.ceil(records.length/value.pageSize);}
var output=document.createElement('div');output.className='widgetPackage';var table=document.createElement('table');table.cellSpacing=0;table.className='listing';output.appendChild(table);var row,cells,rows=0;row=table.insertRow(rows++);row.className='listingHeader';cells=0;this.createHeaderCell(row,cells++,'Date','date',1,value,callback);this.createHeaderCell(row,cells++,'Open');this.createHeaderCell(row,cells++,'High');this.createHeaderCell(row,cells++,'Low');this.createHeaderCell(row,cells++,'Close');this.createHeaderCell(row,cells++,'Volume');var formatter=value.isIntraday?'toTime':'toFullDate';for(var i=start;i!=end;i++)
{var record=records[i];cells=0;row=table.insertRow(rows++);row.className=this.getRowCss(i);this.createDetailCell(row,cells++,Formatter.toDisplayable(Formatter[formatter](record.closeDate)));this.createDetailCell(row,cells++,Formatter.toDisplayable(Formatter.toPrice(record.openPrice)));this.createDetailCell(row,cells++,Formatter.toDisplayable(Formatter.toPrice(record.highPrice)));this.createDetailCell(row,cells++,Formatter.toDisplayable(Formatter.toPrice(record.lowPrice)));this.createDetailCell(row,cells++,Formatter.toDisplayable(Formatter.toPrice(record.closePrice)));this.createDetailCell(row,cells++,Formatter.toDisplayable(Formatter.toVolume(record.volume)));}
if(showPager)
{var pager=new PagingLinksDOM();output.appendChild(pager.generate(value,callback));}
return output;}

function EdgarChartSimple(caller,viewer,body,pager)
{this.caller=caller;this.viewer=viewer;this.body=body;this.pager=pager;}
EdgarChartSimple.prototype.setBody=function(value){this.body=value;}
EdgarChartSimple.prototype.doSymbol=function(symbol,body)
{this.run({symbol:symbol},body);}
EdgarChartSimple.prototype.run=function(criteria,body)
{if(undefined!=body)
criteria.body=body;else if(undefined==criteria.body)
criteria.body=this.body;if(undefined==criteria.duration)
criteria.duration=CHART_DURATION_3_MONTH;if(undefined==this.durationOptions)
this.durationOptions=this.caller.getChartDurationsAsListItems();criteria.durationOptions=this.durationOptions;this.caller.getChartUrl(criteria,new AjaxDataHandler(this,criteria));}
EdgarChartSimple.prototype.doValue=function(value)
{var criteria=value.criteria;var body=criteria.body;value.durationOptions=criteria.durationOptions;criteria.durationOptions=undefined;body.innerHTML='';body.appendChild(this.viewer.generate(value,this));}
EdgarChartSimple.prototype.changeDuration=function(value,duration)
{var criteria=value.criteria;criteria.duration=duration;this.caller.getChartUrl(criteria,{handleRequestData:function(newValue){value.url=newValue.url;value.image.src=newValue.url;}});return false;}

function EdgarChartAdvancedSimple(caller,viewer,body,callback,contentCaller,listingHandler)
{this.caller=caller;this.viewer=viewer;this.body=body;this.callback=callback;this.contentCaller=contentCaller;this.notes=new Object();this.listingHandler=(undefined!=listingHandler)?listingHandler:new ListEdgarTradeStatsSimple(this.caller,new ListEdgarTradeStatsDOM(),PAGE_SIZE_SUBLISTING);}
EdgarChartAdvancedSimple.prototype.MAX_COMPARISONS=5;EdgarChartAdvancedSimple.prototype.MAX_COMPARISONS_INTRADAY=3;EdgarChartAdvancedSimple.prototype.CMS_NOTES_TECH_IND='/chart/techInd/notes/';EdgarChartAdvancedSimple.prototype.CMS_NOTES_MOVING_AVG='/chart/movingAvg/notes/';EdgarChartAdvancedSimple.prototype.setBody=function(value){this.body=value;}
EdgarChartAdvancedSimple.prototype.doSymbol=function(symbol,body)
{this.run(new EdgarChartAdvancedCriteria(new EdgarChartFilter(symbol,false,undefined,3),body));}
EdgarChartAdvancedSimple.prototype.doSymbolSnapShot=function(symbol,body,appId)
{var filter=new EdgarChartFilter(symbol,false,undefined,3);filter.isSnapShot=true;filter.appId=appId;this.run(new EdgarChartAdvancedCriteria(filter,body));}
EdgarChartAdvancedSimple.prototype.doLinkedSymbolSnapShot=function(symbol,body,appId)
{var filter=new EdgarChartFilter(symbol,false,undefined,3);filter.isSnapShot=true;filter.appId=appId;filter.isLink=true;this.run(new EdgarChartAdvancedCriteria(filter,body));}
EdgarChartAdvancedSimple.prototype.openChart=function(){this.callback.openChart();}
EdgarChartAdvancedSimple.prototype.run=function(criteria,body)
{if(undefined!=body)
criteria.body=body;else if(undefined==criteria.body)
criteria.body=this.body;this.caller.getAdvancedChartUrl(criteria.filter,new AjaxDataHandler(this,criteria));}
EdgarChartAdvancedSimple.prototype.doValue=function(value)
{var criteria=value.criteria;if(undefined==criteria.image)
{if(criteria.filter.isSnapShot){criteria.body.innerHTML='';if(criteria.filter.isLink!=undefined){value.isLink=criteria.filter.isLink;}
criteria.body.appendChild(this.viewer.generateSnapShot(value,this));}
else{criteria.body.innerHTML='';criteria.body.appendChild(this.viewer.generate(value,this));}}
else
criteria.image.src=value.url;}
EdgarChartAdvancedSimple.prototype.imgLoad=function(ev)
{if(document.readyState);}
EdgarChartAdvancedSimple.prototype.openListing=function(value,body)
{var criteria=value.criteria;criteria.listingCriteria=this.listingHandler.doFilter(criteria.filter,body);}
EdgarChartAdvancedSimple.prototype.openExcel=function(value)
{this.caller.openTradeStatsExcel(value.criteria.filter);}
EdgarChartAdvancedSimple.prototype.changeDuration=function(criteria,isIntraday,durationDays,durationMonths,startDate,endDate)
{var filter=criteria.filter;filter.isIntraday=isIntraday;filter.durationDays=durationDays;filter.durationMonths=durationMonths;filter.startDate=startDate;filter.endDate=endDate;if(undefined!=criteria.listingCriteria)
this.listingHandler.run(criteria.listingCriteria);this.run(criteria);}
EdgarChartAdvancedSimple.prototype.toIntraday=function(value)
{this.changeDuration(value.criteria,true);}
EdgarChartAdvancedSimple.prototype.changeDays=function(value,days)
{this.changeDuration(value.criteria,false,days);}
EdgarChartAdvancedSimple.prototype.changeMonths=function(value,months)
{this.changeDuration(value.criteria,false,undefined,months);}
EdgarChartAdvancedSimple.prototype.changeDates=function(value,startDate,endDate)
{var months=undefined;if(undefined==startDate)
months=3;else if((undefined!=endDate)&&(startDate>=endDate))
{window.alert('The start date cannot be later than the end date.');return false;}
this.changeDuration(value.criteria,false,undefined,months,startDate,endDate);return true;}
EdgarChartAdvancedSimple.prototype.addCompare=function(value,symbol)
{var criteria=value.criteria;var filter=criteria.filter;var compareTo=filter.compareTo;var max=filter.isIntraday?this.MAX_COMPARISONS_INTRADAY:this.MAX_COMPARISONS;if(undefined==filter.compareTo)
{filter.compareTo=[symbol];criteria.compareTo=new Array();criteria.compareTo[symbol]=0;}
else if(max<=filter.compareTo.length)
throw'Too many symbols.';else if(undefined==criteria.compareTo[symbol])
{criteria.compareTo[symbol]=filter.compareTo.length;filter.compareTo[filter.compareTo.length]=symbol;}
else
return false;this.run(criteria);return true;}
EdgarChartAdvancedSimple.prototype.validateSymbol=function(symbol)
{if(!this.caller.isSymbolValid(symbol))
throw CAPTION_SYMBOL+', '+symbol+', is not valid.';}
EdgarChartAdvancedSimple.prototype.removeCompare=function(value,symbol)
{var criteria=value.criteria;var filter=criteria.filter;var index=criteria.compareTo[symbol];if(undefined!=index)
{filter.compareTo.splice(index,1);criteria.compareTo[symbol]=undefined;for(var id in criteria.compareTo)
{var i=criteria.compareTo[id];if(index<i)
criteria.compareTo[id]=i-1;}}
else
return false;this.run(criteria);return true;}
EdgarChartAdvancedSimple.prototype.changeType=function(value,typeId)
{value.criteria.filter.typeId=typeId;this.run(value.criteria);}
EdgarChartAdvancedSimple.prototype.showSplits=function(value,yesNo)
{value.criteria.filter.showSplits=yesNo;this.run(value.criteria);}
EdgarChartAdvancedSimple.prototype.showDividends=function(value,yesNo)
{value.criteria.filter.showDividends=yesNo;this.run(value.criteria);}
EdgarChartAdvancedSimple.prototype.showSpinOffs=function(value,yesNo)
{value.criteria.filter.showSpinOffs=yesNo;this.run(value.criteria);}
EdgarChartAdvancedSimple.prototype.changeTechInd=function(value,id,hints)
{var filter=value.criteria.filter;filter.techIndId=id;filter.techIndHints=hints;this.run(value.criteria);}
EdgarChartAdvancedSimple.prototype.changeMovingAvg=function(value,id,days,bandType,deviation)
{var filter=value.criteria.filter;filter.movingAverageTypeId=id;filter.movingAverageDays=days;filter.movingAverageBandType=bandType;filter.movingAverageDeviation=deviation;this.run(value.criteria);}
EdgarChartAdvancedSimple.prototype.removeMovingAvg=function(value)
{var filter=value.criteria.filter;filter.movingAverageTypeId=undefined;filter.movingAverageDays=undefined;filter.movingAverageBandType=undefined;filter.movingAverageDeviation=undefined;this.run(value.criteria);}
EdgarChartAdvancedSimple.prototype.getTechIndNotes=function(name)
{return this.getNotes(this.CMS_NOTES_TECH_IND+name);}
EdgarChartAdvancedSimple.prototype.getMovingAvgNotes=function(name)
{return this.getNotes(this.CMS_NOTES_MOVING_AVG+name);}
EdgarChartAdvancedSimple.prototype.sendEmail=function(value)
{if(this.caller.emailChart(value.criteria.filter))
window.alert('Your e-mail has been sent successfully.');}
EdgarChartAdvancedSimple.prototype.getNotes=function(name)
{var value=this.notes[name];if(undefined==value)
{var record=this.contentCaller.getPageText(undefined,name);if(undefined==record)
this.notes[name]=false;else
value=this.notes[name]=record.contents;}
else if(false==value)
return undefined;return value;}
function EdgarChartAdvancedCriteria(filter,body)
{this.filter=filter;this.body=body;}

function InsiderSummarySimple(caller,viewer,body,callback)
{this.caller=caller;this.viewer=viewer;this.body=body;this.callback=callback;}
InsiderSummarySimple.prototype=new WorklistSimple();InsiderSummarySimple.prototype.doSymbol=function(symbol,body)
{this.run({symbol:symbol},body);}
InsiderSummarySimple.prototype.makeCall=function(criteria,dataHandler)
{this.caller.getInsiderSummary(criteria,dataHandler);}

function ListEdgarNewsSimple(caller,viewer,pageSize,body)
{this.caller=caller;this.viewer=viewer;this.pageSize=pageSize;this.body=body;this.contentWindow=new ContentWindow();}
ListEdgarNewsSimple.prototype=new WorklistSimple();ListEdgarNewsSimple.prototype.setBody=function(value){this.body=value;}
ListEdgarNewsSimple.prototype.doSymbol=function(symbol,body)
{var me=this;this.caller.getCompanyBySymbol(symbol,{handleRequestData:function(value){if(undefined==value)
{throw{message:'ListEdgarNewsSimple: '+CAPTION_SYMBOL+', '+symbol+', is not a valid Edgar company.',isInvalidEdgarSymbol:true,isInvalidSymbol:true};}
me.doCompany(value.id,body);}});}
ListEdgarNewsSimple.prototype.doCompany=function(companyId,body)
{this.run(new ListEdgarNewsSimpleCriteria(companyId),body);}
ListEdgarNewsSimple.prototype.makeCall=function(criteria,dataHandler)
{this.caller.getStories(criteria,dataHandler);}
ListEdgarNewsSimple.prototype.handleOpen=function(ev)
{var me=this.myCallback;var record=this.myRecord;var value=this.myValue;var criteria=value.criteria;if(undefined==record.contents)
{me.caller.getStoryContents(record.id,{handleRequestData:function(story){if(!story)
return;record.contents=story.contents;me.contentWindow.runInline(new ContentWindowInfo(record.headline,me.viewer.genStory(record,value,me),criteria.body));}});}}
ListEdgarNewsSimple.prototype.reopen=function(ev)
{var me=this.myCallback;me.run(this.myValue.criteria);}
ListEdgarNewsSimple.prototype.changeSource=function(ev)
{var criteria=this.myValue.criteria;var sourceId=this.value;if((undefined!=sourceId)&&(0==sourceId.length))
sourceId=undefined;criteria.newsSourceId=sourceId;this.myCallback.run(criteria);}
function ListEdgarNewsSimpleCriteria(companyId,newsSourceId)
{this.companyId=companyId;this.newsSourceId=newsSourceId;}

function ListFilingsSimple(caller,viewer,pageSize,body,pager)
{this.caller=caller;this.viewer=viewer;this.pageSize=pageSize;this.body=body;this.pager=pager;}
ListFilingsSimple.prototype=new WorklistSimple();ListFilingsSimple.prototype.setBody=function(value){this.body=value;}
ListFilingsSimple.prototype.doSymbol=function(symbol,body)
{this.run(new ListFilingsSimpleCriteria(symbol),body);}
ListFilingsSimple.prototype.makeCall=function(criteria,dataHandler)
{this.caller.getFilings(criteria,dataHandler);}
ListFilingsSimple.prototype.handleFormGroupChange=function(value,elem)
{var criteria=value.criteria;criteria.formGroupId=(0<elem.selectedIndex)?elem.value:undefined;if(undefined!=criteria.formGroupId)
criteria.formTypeId=undefined;criteria.page=undefined;this.run(criteria);}
ListFilingsSimple.prototype.handleFormTypeChange=function(value,elem)
{var criteria=value.criteria;criteria.formTypeId=(0<elem.selectedIndex)?elem.value:undefined;if(undefined!=criteria.formTypeId)
criteria.formGroupId=undefined;criteria.page=undefined;this.run(criteria);}
ListFilingsSimple.prototype.openFilingPdf=function(ev)
{this.myCallback.pager.openFilingPdf(this.myRecord.id);}
ListFilingsSimple.prototype.openFilingRtf=function(ev)
{this.myCallback.pager.openFilingRtf(this.myRecord.id);}
ListFilingsSimple.prototype.openFilingExcel=function(ev)
{this.myCallback.pager.openFilingExcel(this.myRecord.id);}
ListFilingsSimple.prototype.openFilingHtml=function(ev)
{this.myCallback.pager.openFilingHtml(this.myRecord.id);}
function ListFilingsSimpleCriteria(symbol,formGroupId,formTypeId,page,sortOn,sortDir)
{this.symbol=symbol;this.formGroupId=formGroupId;this.formTypeId=formTypeId;this.page=page;this.sortOn=sortOn;this.sortDir=sortDir;}

function ListInsiderTransSimple(caller,viewer,pageSize,body)
{this.caller=caller;this.viewer=viewer;this.pageSize=pageSize;this.body=body;}
ListInsiderTransSimple.prototype=new WorklistSimple();ListInsiderTransSimple.prototype.setBody=function(value){this.body=value;}
ListInsiderTransSimple.prototype.doSymbol=function(symbol,body)
{this.run(new ListInsiderTransSimpleCriteria(symbol),body);}
ListInsiderTransSimple.prototype.makeCall=function(criteria,dataHandler)
{this.caller.getInsiderTrans(criteria,dataHandler);}
function ListInsiderTransSimpleCriteria(symbol,page,sortOn,sortDir)
{this.symbol=symbol;this.page=page;this.sortOn=sortOn;this.sortDir=sortDir;}

function ListEdgarTradeStatsSimple(caller,viewer,pageSize,body)
{this.caller=caller;this.viewer=viewer;this.pageSize=pageSize;this.body=body;}
ListEdgarTradeStatsSimple.prototype=new WorklistSimple();ListEdgarTradeStatsSimple.prototype.doFilter=function(filter,body)
{var criteria={filter:filter};this.run(criteria,body);return criteria;}
ListEdgarTradeStatsSimple.prototype.makeCall=function(filter,dataHandler)
{this.caller.getTradeStats(filter,dataHandler);}
ListEdgarTradeStatsSimple.prototype.handlePaging=function(ev)
{var me=this.myCallback;var value=this.myRecord;if(undefined!=this.pagingDir)
value.currentPage+=this.pagingDir;else
value.currentPage=this.selectedIndex+1;me.doValue(value);}
ListEdgarTradeStatsSimple.prototype.handleSort=function(ev)
{var me=this.myCallback;var value=this.myValue;value.records.reverse();value.sortDir=(value.sortDir==FIELD_ASCENDING)?FIELD_DESCENDING:FIELD_ASCENDING;me.doValue(value);}
