
var iconExpand=new Image();iconExpand.src=commonImagesPath+ICON_EXPAND;var iconCollapse=new Image();iconCollapse.src=commonImagesPath+ICON_COLLAPSE;var iconDelete=new Image();iconDelete.src=commonImagesPath+ICON_DELETE;var iconCalendar=new Image();iconCalendar.src=commonImagesPath+ICON_CALENDAR;var iconDeactivate=new Image();iconDeactivate.src=commonImagesPath+ICON_DEACTIVATE;var iconIssueCorrection=new Image();iconIssueCorrection.src=commonImagesPath+ICON_ISSUE_CORRECTION;var iconPlaceholder=new Image();iconPlaceholder.src=commonImagesPath+ICON_PLACEHOLDER;var statusOptions={ids:[STATUS_ID_ACTIVE,STATUS_ID_INACTIVE],values:[CAPTION_ACTIVE,CAPTION_INACTIVE]};var pageHandler=undefined;var pageHistory=new DhtmlHistory();function initPage()
{resetFavicon();}
function paintPage()
{var commonCaller=new PinkCommonCalls();var edgarCaller=new PinkEdgarCalls();var otciqCaller=new OtcIQCalls();var forumsCaller=undefined;var contentCaller=new PinkContentCalls();pageHandler=new QuotePage(edgarCaller,new EdgarAppNav(),otciqCaller,new OtcIQAppNav(),forumsCaller,'/forums/images',commonCaller,window.document.getElementById('tabber'),PAGE_SIZE_SUBLISTING,contentCaller);if(undefined!=initNewsId)
{pageHandler.tabValue=pageHandler.TAB_INDEX_NEWS;pageHandler.initNewsId=initNewsId;}
else
pageHandler.tabValue=tabValue;pageHistory.start();pageHandler.doSecurity(security);}
CompanyProfileHtml.prototype.appendServiceProviderName=function(output,value,typeId)
{if(!value.isPublic||!typeId)
Elements.addText(output,value.name);else
output.appendChild(Elements.genLink(value.name,'javascript:appNav.gotoServiceProvider(\''+typeId+'\', \''+value.id+'\')'));if(value.isProhibited)
{Elements.addText(output,' [');output.appendChild(Elements.genLink('Prohibited Service Provider','javascript:appNav.gotoProhibitedAttorneys()'));Elements.addText(output,']');}
Elements.addBreak(output);}
CompanyProfileHtml.prototype.createDadPalName=function(value)
{if(!value.isPublic)
return document.createTextNode(value.name);var a=document.createElement('a');a.innerHTML=value.name;a.href='javascript:appNav.gotoServiceProvider(\'DAD\', \''+value.id+'\')';return a;}
function QuotePage(edgarCaller,edgarPager,otciqCaller,otciqPager,forumsCaller,forumsImagesPath,commonCaller,body,pageSize,contentCaller)
{this.edgarCaller=edgarCaller;this.edgarPager=edgarPager;this.otciqCaller=otciqCaller;this.otciqPager=otciqPager;this.forumsCaller=forumsCaller;this.commonCaller=commonCaller;this.contentCaller=contentCaller;this.body=body;this.pageSize=pageSize;this.tabValue=undefined;this.haveCheckedQuoteBlock=false;this.haveFetchNoFRMsg=false;this.quoteBlock=undefined;this.isBankrupt=false;this.history=pageHistory;this.tabberOptions={'ids':undefined,'defaultTab':0,'onClick':function(args){var call=this.calls[args.index];restartPageServices('/quote/'+call+'?symbol='+this.callback.symbol);if(!args.tab.isEmpty)
return true;try{this.callback[call](args.tab.body);}
catch(error){window.alert(error);return false;}
resetFavicon();this.callback.history.add(call,this.callback,'changeTab',args.index);args.tab.isEmpty=false;return true;},'onLoad':function(args){this.onClick(args);},'tabParam':'tabValue'}
this.tabberOptions.callback=this;this.glossaryDecorator=new GlossaryDecorator(this.contentCaller);this.quotePage=new QuoteSimple(this.otciqCaller,this.edgarCaller,this.commonCaller,new QuoteHtml(),undefined,new InsideHtml(),new MontageHtml(),new TradeHtml(),new SnapshotTradeHtml(),APPLICATION_ID_PINKSHEETS);this.quotePage.showMotleyFool=true;this.chart=new EdgarChartAdvancedSimple(this.edgarCaller,new EdgarChartAdvancedDOM(),undefined,this,this.contentCaller);this.newsHandler=new ListNewsReleaseSimple(this.otciqCaller,new ListNewsReleaseHtml(),this.pageSize,undefined,this.otciqPager);this.companyProfile=new CompanyProfileSimple(commonCaller,new CompanyProfileHtml());this.financialReports=new ListFinancialReportSimple(this.otciqCaller,new ListFinancialReportHtml(),this.pageSize,undefined,new FinancialStatementHtml(),this.otciqPager);this.edgarFilings=new ListFilingsSimple(this.edgarCaller,new ListFilingsMini(),this.pageSize,undefined,this.edgarPager);this.edgarNews=new ListEdgarNewsSimple(this.edgarCaller,new ListEdgarNewsMini(),this.pageSize,undefined);this.shoHandler=new ShoHistoryWorklistSimple(commonCaller,new ShoHistoryWorklistDOM(),undefined,this,this.pageSize);this.shortInterestHandler=new ShortInterestWorklistSimple(commonCaller,new ShortInterestWorklistDOM(),undefined,this,this.pageSize);this.insiderSummary=new InsiderSummarySimple(this.edgarCaller,new InsiderSummaryDOM());this.insiderTrans=new ListInsiderTransSimple(this.edgarCaller,new ListInsiderTransMini(),this.pageSize);var me=this;this.resources=new ListResourcesSimple(this.otciqCaller,ListResourcesDOM,this.pageSize,undefined,{handleNews:function(v,r){me.newsHandler.showContents(r,v,me.resources);},handleFR:function(v,r){me.otciqPager.openFinancialReport(r.id);}});this.anchorList=new AnchorList();this.securityDetailsSection=new SecurityDetailsPage(otciqCaller,new SecurityDetailsHtml());this.tierLogoSection=new TierLogo(commonCaller,undefined,new TierLogoHtml(true));}
QuotePage.prototype.TAB_INDEX_QUOTE=0;QuotePage.prototype.TAB_INDEX_NEWS=1;QuotePage.prototype.TAB_INDEX_CHARTS=2;QuotePage.prototype.TAB_INDEX_COMPANY_INFO=3;QuotePage.prototype.TAB_INDEX_FILINGS=4;QuotePage.prototype.TAB_INDEX_RESEARCH_REPORT=5;QuotePage.prototype.TAB_INDEX_SHORT_INTEREST=6;QuotePage.prototype.TAB_INDEX_INSIDER_TRANS=7;QuotePage.prototype.TAB_INDEX_FORUMS=7;QuotePage.prototype.QUOTE_BLOCK_URI='/pinksheets/quoteBlock';QuotePage.prototype.NO_FINANCIAL_REPORTS_MESSAGE_URI='/pinksheets/noFinancialReportsMessage';QuotePage.prototype.NO_RESEARCH_REPORTS_MESSAGE_URI='/pinksheets/noResearchReportsMessage';QuotePage.prototype.TAB_CAPTIONS_EQUITY=['Quote','News','Charts','Company Info','Financials','Research','Short Sales','Insiders'];QuotePage.prototype.TAB_CALLS_EQUITY=['getQuote','getNews','getCharts','getCompanyInfo','getFilings','getResearchReports','getShortInfo','getInsiderTrans'];QuotePage.prototype.TAB_CAPTIONS_DEBT=['Quote','Company Info','Financials','Research','Short Sales'];QuotePage.prototype.TAB_CALLS_DEBT=['getQuote','getCompanyInfo','getFilings','getResearchReports','getShortInfo'];QuotePage.prototype.RSS_ICON='/content/doc/ps/logos/rss/small.gif';QuotePage.prototype.RSS_FR_TITLE='The Pink OTC Markets RSS feed only includes filings published via the OTC Disclosure and News Service.';QuotePage.prototype.RSS_PR_TITLE='The Pink OTC Markets RSS feed only includes news stories published via the OTC Disclosure and News Service.';QuotePage.prototype.INSIDER_TRADING_URL='/otcguide/insider_trading.jsp';QuotePage.prototype.INSIDER_TRADING_IMG='/content/doc/ps/images/insider_trading_warning.gif';QuotePage.prototype.BANKRUPTCY_URL='http://www.sec.gov/investor/pubs/bankrupt.htm';QuotePage.prototype.BANKRUPTCY_IMG='/content/doc/ps/images/bankruptcy_warning.gif';QuotePage.prototype.UNSOLICITED_URL='http://www.sec.gov/answers/unsolicitedquotations.htm';QuotePage.prototype.UNSOLICITED_IMG='/content/doc/ps/images/unsolicited_warning.gif';QuotePage.prototype.NO_RESEARCH_REPORTS_MESSAGE='No Research Reports were found.';QuotePage.prototype.doSymbol=function(symbol)
{var value=this.commonCaller.getSecurityInfo(symbol);if(undefined==value)
return false;this.doSecurity(value);return true;}
QuotePage.prototype.doSecurity=function(security,body)
{this.run(new QuotePageCriteria(security,this.tabValue),body);}
QuotePage.prototype.run=function(criteria,body)
{if(undefined==body)
body=this.body;var security=criteria.security;this.symbol=security.symbol;this.isDebt=((undefined==security.symbol)||(0==security.symbol.length));this.companyId=security.compId;this.securityId=security.secId;this.haveCheckedQuoteBlock=!security.isCaveatEmptor;this.haveFetchNoFRMsg=false;this.haveFetchNoRRMsg=false;this.hasInactiveReports=undefined;this.edgarCompany=undefined;this.precisionIrUrl=security.precisionIrUrl;if(this.isDebt)
{this.noInfo=false;this.isBankrupt=false;this.isUnsolicited=false;this.rssUrl=globalInfo.rssUrl+'?symbol='+security.secId;this.tabberOptions.titles=this.TAB_CAPTIONS_DEBT;this.tabberOptions.calls=this.TAB_CALLS_DEBT;}
else
{this.noInfo=TIER_NO_INFO==security.tierId;this.isBankrupt=((5==this.symbol.length)&&('Q'==this.symbol.substr(4,1)));this.isUnsolicited=this.otciqCaller.isSecurityUnsolicited(this.symbol);this.rssUrl=globalInfo.rssUrl+'?symbol='+security.symbol;this.tabberOptions.titles=this.TAB_CAPTIONS_EQUITY;this.tabberOptions.calls=this.TAB_CALLS_EQUITY;}
this.activityListCriteria=new AnchorListCriteria(statusOptions,STATUS_ID_ACTIVE,this,undefined,' | ');var companyLogo=document.getElementById('companyLogo');if(!security.isCaveatEmptor&&(TIER_NO_INFO>security.tierId)&&this.otciqCaller.hasActiveCompanyLogo(this.companyId))
companyLogo.innerHTML='<img src="'+
this.otciqCaller.getCompanyLogoSrc(this.companyId)+'" />';else
companyLogo.innerHTML='';this.securityDetailsSection.doValue(security,document.getElementById('securityDetails'));this.tierLogoSection.doValue(security,document.getElementById('tierLogo'));if(undefined!=this.initNewsId)
{this.newsHandler.callback=new QuotePage.NewsItemHandler(this.newsHandler,this.initNewsId);this.initNewsId=undefined;}
this.prepareTabs(criteria.tabValue);this.criteria=criteria;}
QuotePage.prototype.getEdgarCompany=function()
{if(undefined==this.edgarCompany)
{try
{this.edgarCompany=this.edgarCaller.getCompanyBySymbol(this.symbol);if(undefined==this.edgarCompany)
this.edgarCompany={isUnavailable:true};}
catch(error){this.edgarCompany={isError:true};}}
return this.edgarCompany;}
QuotePage.prototype.getEdgarCompanyId=function()
{return this.getEdgarCompany().id;}
QuotePage.prototype.changeTab=function(index)
{this.tabber.setActiveTab(index);}
QuotePage.prototype.getQuote=function(body)
{if(!this.haveCheckedQuoteBlock)
{this.quoteBlock=this.commonCaller.getQuoteBlock(this.securityId);if(undefined!=this.quoteBlock)
this.quoteBlock.comments=this.contentCaller.getPageText(undefined,this.QUOTE_BLOCK_URI).contents;this.haveCheckedQuoteBlock=true;}
body.innerHTML='';if(this.isBankrupt)
body=this.createExtraQuoteSection('Bankruptcy Warning',this.BANKRUPTCY_IMG,this.BANKRUPTCY_URL,body,true);else if(this.noInfo)
body=this.createExtraQuoteSection('Insider Trading Warning',this.INSIDER_TRADING_IMG,localContextRoot+this.INSIDER_TRADING_URL,body,false);else if(this.isUnsolicited)
body=this.createExtraQuoteSection('Unsolicited Warning',this.UNSOLICITED_IMG,this.UNSOLICITED_URL,body,true);if(undefined!=this.quoteBlock)
body.innerHTML=this.quoteBlock.comments;else
{this.doQuote(body);if(undefined==this.quoteDaemonId)
{var me=this;this.quoteDaemonId=window.setInterval(function(){QuoteFetchDaemon(me,body);},60000);}}}
QuotePage.prototype.doQuote=function(body)
{if(undefined!=this.symbol)
this.quotePage.doSymbol(this.symbol,body);else
this.quotePage.doSecurity(this.securityId,body);var gd=this.glossaryDecorator;window.setTimeout(function(){gd.doSection(body);},2000);}
QuotePage.prototype.createExtraQuoteSection=function(title,imgSrc,link,body,openNew)
{Elements.addBreak(body);var div=Elements.addDiv(body);div.style.width='100%';div.style.textAlign='center';div.style.padding='0px';var a=document.createElement('a');a.href=link;if(openNew)
a.target='_blank';a.appendChild(Elements.genImage(imgSrc,title));div.appendChild(a);body.appendChild(div);Elements.addBreak(body);Elements.addBreak(body);return Elements.addDiv(body);}
QuotePage.prototype.getNews=function(body)
{body.innerHTML='';var section=this.createSection(TITLE_IQ_SERVICE);var elem,img,tr=section.insertRow(0);var td=tr.insertCell(0);td.style.textAlign='right';td.appendChild(elem=document.createElement('a'));elem.href=this.rssUrl;elem.target='_new';elem.appendChild(document.createTextNode('Subscribe '));elem.appendChild(img=document.createElement('img'));img.src=this.RSS_ICON;img.border=0;img.title=this.RSS_PR_TITLE;this.newsHandler.doCompany(this.companyId,section.myBody);body.appendChild(section);body.appendChild(document.createElement('br'));section=this.createSection('Other News Sources');var edgarCompanyId=this.getEdgarCompanyId();if(undefined!=edgarCompanyId)
this.edgarNews.doCompany(edgarCompanyId,section.myBody);else
section.myBody.innerHTML='No news found.';body.appendChild(section);}
QuotePage.prototype.getCharts=function(body)
{this.chart.doSymbol(this.symbol,body);}
QuotePage.prototype.getCompanyInfo=function(body)
{this.companyProfile.doSecurity(this.securityId,body);var me=this;window.setTimeout(function(){me.appendCompanyInfoDisclaimer(body);},2000);}
QuotePage.prototype.appendCompanyInfoDisclaimer=function(body)
{body.appendChild(document.createTextNode(DISCLAIMER_COMPANY_INFO));body.appendChild(document.createElement('br'));body.appendChild(document.createTextNode('Click '));var a=document.createElement('a');a.href='javascript:appNav.gotoUpdateCompanyProfile();';a.appendChild(document.createTextNode('here'));body.appendChild(a);body.appendChild(document.createTextNode(' to update your company profile.'));}
QuotePage.prototype.getFilings=function(body)
{if(!this.haveFetchNoFRMsg)
{this.financialReports.viewer.NO_RECORDS_FOUND=this.contentCaller.getPageText(undefined,this.NO_FINANCIAL_REPORTS_MESSAGE_URI).contents;this.haveFetchNoFRMsg=true;}
if(undefined==this.hasInactiveReports)
this.hasInactiveReports=this.otciqCaller.hasInactiveReports(this.companyId);body.innerHTML='';var section=this.createSection(TITLE_IQ_SERVICE);var elem,img,tr=section.insertRow(0);var td=tr.insertCell(0);td.style.textAlign='right';if(this.hasInactiveReports)
{td.appendChild(elem=document.createElement('span'));this.anchorList.run(this.activityListCriteria,elem);td.appendChild(document.createTextNode(' | '));}
td.appendChild(elem=document.createElement('a'));elem.href=this.rssUrl;elem.target='_new';elem.appendChild(document.createTextNode('Subscribe '));elem.appendChild(img=document.createElement('img'));img.src=this.RSS_ICON;img.border=0;img.title=this.RSS_FR_TITLE;this.financialReports.doFilings(this.companyId,section.myBody);body.appendChild(section);this.pinkSheetsFilingsBody=section.myBody;if(!this.isDebt)
{body.appendChild(document.createElement('br'));section=this.createSection('SEC Filings');this.edgarFilings.doSymbol(this.symbol,section.myBody);body.appendChild(section);}}
QuotePage.prototype.handleAnchorSelect=function(id,value)
{this.financialReports.doFilingsByStatus(this.companyId,id,this.pinkSheetsFilingsBody);restartPageServices('/quote/getFilings?status='+value);}
QuotePage.prototype.getResearchReports=function(body)
{if(!this.haveFetchNoRRMsg)
{var item=this.contentCaller.getPageText(undefined,this.NO_RESEARCH_REPORTS_MESSAGE_URI);if(undefined!=item)
this.NO_RESEARCH_REPORTS_MESSAGE=item.contents;this.haveFetchNoRRMsg=true;}
var me=this;var callback={callback:me,body:body,handleRequestData:function(value){this.callback.handleResearchReports(value,this.body);}};this.commonCaller.getCompanyProfile(undefined,this.securityId,callback);}
QuotePage.prototype.handleResearchReports=function(profile,body)
{body.innerHTML='';var hasReports=this.otciqCaller.hasResearchReports(this.companyId);var section,reports=profile.researchReports;if(!hasReports&&(undefined==reports))
body.innerHTML=this.NO_RESEARCH_REPORTS_MESSAGE;else
{if(undefined!=reports)
{body.appendChild(section=this.createSection('Issuer Sponsored Research Reports'));section.myBody.appendChild(this.genResearchReports(reports));section.appendChild(document.createElement('br'));}
if(hasReports)
{body.appendChild(section=this.createSection(TITLE_IQ_SERVICE));this.financialReports.doResearchReports(this.companyId,section.myBody);}}}
QuotePage.prototype.genResearchReports=function(values)
{var output=document.createElement('div');output.className='widgetPackage';for(var i=0;i<values.length;i++)
{if(0<i)
output.appendChild(document.createElement('br'));value=values[i];output.appendChild(Formatter.toWebsite(value.url,value.firmName));}
return output;}
QuotePage.prototype.getShortInfo=function(body)
{body.innerHTML='';var section=this.createSection('SHO History');this.shoHandler.doSecurity(this.securityId,section.myBody);body.appendChild(section);body.appendChild(document.createElement('br'));section=this.createSection('Short Interest');this.shortInterestHandler.doSecurity(this.securityId,section.myBody);body.appendChild(section);}
QuotePage.prototype.getInsiderTrans=function(body)
{body.innerHTML='';var section=this.createSection();section.myCaption.innerHTML=TITLE_IQ_SERVICE;this.resources.doInsiderTrans(section.myBody,this.companyId);body.appendChild(section);body.appendChild(document.createElement('br'));var DISPLAY=isIE?'block':'table';var summary=this.createSection();summary.style.display='none';summary.myCaption.innerHTML='SEC Transaction Summary &mdash; Last 6 Months';this.insiderSummary.callback={handlePostLoad:function(value,output){if(0<value.numberOfTransactions)summary.style.display=DISPLAY;}};this.insiderSummary.doSymbol(this.symbol,summary.myBody);body.appendChild(summary);var trans=this.createSection();trans.style.display='none';trans.myCaption.innerHTML='SEC Transactions &mdash; Last 2 Years';this.insiderTrans.callback={handlePostLoad:function(value,output){if(value.records&&(0<value.records.length))trans.style.display=DISPLAY;}};this.insiderTrans.doSymbol(this.symbol,trans.myBody);body.appendChild(trans);}
QuotePage.prototype.createSection=function(caption)
{var tr,output=document.createElement('table');output.className='sectional';output.style.width='100%';output.myCaption=output.createCaption();if(undefined!=caption)
output.myCaption.appendChild(document.createTextNode(caption));tr=output.insertRow(0);output.myBody=tr.insertCell(0);output.myBody.style.paddingTop='6px';return output;}
QuotePage.prototype.prepareTabs=function(tabValue)
{if(tabValue!=null&&tabValue!=undefined)
{this.tabberOptions.defaultTab=tabValue;}
this.tabber=new Tabbers(this.tabberOptions);this.body.innerHTML='';this.tabber.run(this.body);if(this.precisionIrUrl)
{var a;this.body.appendChild(a=document.createElement('a'));a.href=this.precisionIrUrl;a.className='precisionIr';a.innerHTML='Free Annual Report';}}
function QuotePageCriteria(security,tabValue){this.security=security;this.tabValue=tabValue;}
function QuoteFetchDaemon(handler,body)
{handler.doQuote(body);resetFavicon();restartPageServices('/quote/getQuote?symbol='+handler.symbol);}
QuotePage.NewsItemHandler=function(handler,newsId)
{this.handler=handler;this.newsId=newsId;}
QuotePage.NewsItemHandler.prototype.handlePostLoad=function(value,body)
{this.handler.callback=undefined;var records=value.records;if((undefined==records)||(0==records.length))
return;for(var i=0;i<records.length;i++)
{var record=records[i];if(this.newsId==record.id)
{this.handler.showContents(record,value);break;}}}