var RegisterWindow;var EDITING_WALL=0;var new_email='';var new_firstname='';var new_lastname='';var new_alias='';var new_you_symbol='';var new_password='';var new_port_name='';var c_text='';var c_image='';var search_highlight=0;var fundFinder;var EDITING_FIND_TAGS=0;var sharesKeyPressed=0;var tradeShares=new Object();var YFMinShares;var sharesChart;var tradePlanCPS;var tradePlanMin;var tradePlanBandQuant;var symbolColors=new Object();var lastUsedColors=new Object();var IS_MONTH_VOTE_PAGE=0;document.observe('q:loaded',function(){Q.set({image_path:"/images/q"});Informer=new Q.Informer();setupFundFinder();new Q.Tooltip({delay:0.1,style:'notice'});});function genericRegister(portid,type,anchorDiv)
{pendURL.push('/cgi-perl/swarm/autotrade.mpl?rm=genericRegisterPopup&reason=fromPortPage&type='+type+'&portID='+portid+'&anchorDiv='+anchorDiv);}
function genericRegisterFront(portid,type,anchorDiv)
{pendURL.push('/cgi-perl/swarm/autotrade.mpl?rm=genericRegisterPopup&reason=fromFrontPage&type='+type+'&portID='+portid+'&anchorDiv='+anchorDiv);}
function startRegister(type,error_text)
{var Take='Register';var why_text='<a style="font-size:90%;float:right;margin:0px 3px 0 0;" onclick="Effect.Fade(\'genericPopup\');startLogin();return false;" href="#">Already have a YoutualFund or Collective2 account? <u>Log in here</u>.</a><br/><p>';if(!error_text){error_text='';}
if(type=='change_name')
{why_text+='Before you can change the name of your Youtual Fund, you must register your fund.  ';}
else if(type=='change_alias')
{why_text+='Before you can change your YoutualFund alias, you must register your fund.  ';}
else if(type=='change_desc')
{why_text+='Before you can change your Youtual Fund description, you must register your fund.  ';}
else if(type=='comment')
{why_text+='Before you can write notes, you must register your fund.  ';}
else if(type=='change_avatar')
{why_text+='Before you can change your Youtual Fund Icon, you must register your fund.  ';}
else if(type=='change_symbol')
{why_text+='Before you can set your YoutualFund symbol, you must register your fund.  ';}
else if(type=='like')
{why_text+='Before you can publicly &quot;like&quot; a note, you must register your fund.  ';}
else if(type=='dislike')
{why_text+='Before you can publicly &quot;dislike&quot;, you must register your fund.  ';}
else if(type=='share_fb')
{why_text+='Before you can share your fund on Facebook or Twitter, you must register your fund.  ';}
else
{Take='Register';}
var main_text='<p>'+why_text+"<p><h1>What does it mean to &quot;register your fund?&quot;</h1><p>Registering a fund gives you full rights and privileges to manage your fund and interact with the YoutualFunds.com site. Once you register your fund, you will be able to manage your fund from any web browser. (Right now, you are tied to this computer.) You'll be able to publish your trades, comment on other people's funds, and generally be a pain in the ass.</p>";main_text+="<h1>It's completely free.</h1><p>Hey, it's the web, baby. &quot;Web&quot; means everything is free. Including this. So relax.</p>";main_text+="<h1>We hate spam, too.</h1><p>That's why we make a promise: we never give your email address to anyone. Period. Ever. We don't rent it. We don't sell it. We don't give it away. Never. <i>Ever.</i> You can unsubscribe from any type of email we ever send you. You have our word. Our reputation is too valuable to waste on spam nonsense. Okay?</p>";main_text+="<div style='margin-top:4px;font-size:80%;color:#666;'>* required field</div>";main_text+="<div style='padding-left:40px;padding-right:15px;'><form><table id='signuppopup'><tr><td>Your email address <i>*</i></td><td><input type='text' id='new_email'/></td</tr><tr><td>Choose a password <i>*</i></td><td><input type='password' id='new_password'/></td</tr><tr><td>Your first name <i>*</i></td><td><input type='text' id='new_firstname'/></td></tr><tr><td>Your last name <i>*</i></td><td><input type='text' id='new_lastname'/></td></tr><tr><td>Want&nbsp;an&nbsp;alias?&nbsp;<i>(shown&nbsp;instead&nbsp;of&nbsp;your&nbsp;name)</i></td><td><input type='text' id='new_alias'/></td></tr><tr><td>Name your Fund</td><td><input type='text' id='new_port_name'/></td></tr>";main_text+="<tr><td>Choose a YoutualFund Symbol <i>*</i></td><td><input type='text' id='new_you_symbol' onKeyUp='makeSymOK(this);lengthCheck(this,5,\"YoutualFund Symbol\");return false;' /></td></tr>";main_text+="<tr><td><br/><div style='float:left'><img id='CImage'/></div><div style='margin-left:12px;float:left;'><img src='/images/icon_reload_grey.gif' style='vertical-align:10px;' alt='Load different image' onclick=\"pendURL.push('/cgi-perl/utility/ajax_util.mpl?rm=GetCAPTCHA')\"/></div><div style='clear:both'></div></td><td><input type='text' id='c_text'/></td></tr><tr><td colspan=\"2\"><span style=\"color:#666\">Type these characters in field on right (this proves to us that you are human being, and not an evil spam robot)</span></td></tr></table></form></div>";main_text+="<div id='errorOut'>"+error_text+"</div>";main_text='<div style="float:left;font-size:90%;margin:-22px 0 0 0;">Use your Facebook account instead: &nbsp;<a href="/cgi-perl/user/facebook.mpl"><img style="vertical-align:-7px" src="/images/fb_connect.gif"/></a></div><br/><div class="headline">'+Take+' your <span style="color:#666;">You</span>tual Fund.</div>'+main_text;main_text+='<br/><br/><table><tr><td><div id="signupcancel"><a class="grayButton" href="#" onclick="Effect.Fade(\'genericPopup\');return false;">Cancel</a></div></td><td><div style="float:left;margin-left:290px;"><a class="greenButton" href="#" onclick="checkRegister( \''+type+'\' );return false;">Register</a></div></td></tr></table><div style="clear:both;"></div>';var p=document.getElementById('genericPopup');var needgrow=1;if(p)
{p.style.display='none';document.body.removeChild(p);needgrow=0;}
p=document.createElement('div');p.style.display='none';p.setAttribute('id','genericPopup');p.style.zIndex='999999999';document.body.appendChild(p);moveEl1ToLocEl2('genericPopup','topBar',145,110);p.innerHTML='<div id="innerGenericPopup"><div class="rightX"><a href="#" onclick="Effect.Fade(\'genericPopup\');return false;">X</a></div><div style="clear:both;"></div>'+main_text+'</div>';document.getElementById("innerGenericPopup").className="signupPopClass";if(p.style.display!='block')
{if(needgrow==0)
{p.style.display='block';}
else
{Effect.Grow('genericPopup');}}
pendURL.push('/cgi-perl/utility/ajax_util.mpl?rm=GetCAPTCHA');if(your_you_symbol&&(!new_you_symbol))
{setTimeout("$('new_you_symbol').value = your_you_symbol",100);}
else
{setTimeout("$('new_you_symbol').value =new_you_symbol",100);}
setTimeout("$('new_email').value = new_email;$('new_firstname').value = new_firstname;$('new_lastname').value = new_lastname;$('new_alias').value = new_alias;$('new_port_name').value = new_port_name;$('new_password').value = new_password;",100);}
function checkRegister(type)
{new_email=$('new_email').value;new_firstname=$('new_firstname').value;new_lastname=$('new_lastname').value;new_alias=$('new_alias').value;new_you_symbol=$('new_you_symbol').value;new_port_name=$('new_port_name').value;new_password=$('new_password').value;c_text=$('c_text').value;if((!new_email)||(!new_firstname)||(!new_lastname)||(!new_password)||(!c_text)||(!new_you_symbol))
{startRegister(type,'Please enter information into all required fields');}
else if(!echeck(new_email))
{startRegister(type,'Invalid email address, please re-enter');}
else
{if(your_you_symbol&&(new_you_symbol==your_you_symbol))
{var url='/cgi-perl/utility/ajax_util.mpl?rm=CheckCAPTCHA&img='+c_image+'&code='+c_text+'&type='+type;}
else
{var url='/cgi-perl/utility/ajax_util.mpl?rm=CheckCAPAndYouSym&img='+c_image+'&code='+c_text+'&type='+type+'&you_symbol='+new_you_symbol;}
pendURL.push(url);}}
function doRegister()
{var url=SITE_BASE_SSL+'/cgi-perl/swarm/portfolio.mpl?rm=doRegister&email='+new_email+'&password='+new_password+'&firstname='+new_firstname+'&lastname='+new_lastname+'&alias='+new_alias+'&you_symbol='+new_you_symbol+'&portname='+new_port_name+'&code='+c_text+'&img='+c_image;document.location.href=url;}
function getTaggedFunds(tag_id,near_div,label)
{pendURL_push('/cgi-perl/swarm/utils.mpl?rm=getTaggedFunds&tag_id='+tag_id+'&near_div='+near_div+'&ignore_fund='+thisPortID+'&label='+encodeURIComponent(label));}
function getFundsTradingSymbol(symbol,direction,near_div,label)
{var ignore_fund=(typeof thisPortID!='undefined')?thisPortID:'';pendURL_push('/cgi-perl/swarm/utils.mpl?rm=getFundsTradingSymbol&symbol='+symbol+'&direction='+direction+'&near_div='+near_div+'&ignore_fund='+ignore_fund+'&label='+encodeURIComponent(label));}
function getFundsBuyingSymbol(symbol,near_div,label)
{var ignore_fund=(typeof thisPortID!='undefined')?thisPortID:'';pendURL_push('/cgi-perl/swarm/utils.mpl?rm=getFundsTradingSymbol&symbol='+symbol+'&buy_or_sell=buy&near_div='+near_div+'&ignore_fund='+ignore_fund+'&label='+encodeURIComponent(label));}
function getFundsSellingSymbol(symbol,near_div,label)
{var ignore_fund=(typeof thisPortID!='undefined')?thisPortID:'';pendURL_push('/cgi-perl/swarm/utils.mpl?rm=getFundsTradingSymbol&symbol='+symbol+'&buy_or_sell=sell&near_div='+near_div+'&ignore_fund='+ignore_fund+'&label='+encodeURIComponent(label));}
function getCompetitionPopup(comp_id,mode,div)
{var url='/cgi-perl/swarm/competitions.mpl?rm=showCompetitions&single_comp_id='+comp_id+'&tab='+mode+'&requesting_div='+div;pendURL_push(url);}
function pendURL_push(url)
{if((typeof thisPortID!='undefined')&&url.match('portfolio.mpl')&&(!url.match('port_id='))&&(!url.match('port_symbol=')))
{url=url+'&port_id='+thisPortID;}
var R=Math.random();url=url+'&RANDOMSTR='+R;pendURL.push(url);}
function changeWallOption(option_name,option_value)
{option_value=option_value?0:1;url=CGIAPP+'?rm=changeWallOption&option='+option_name+'&value='+option_value;pendURL_push(url);}
function showNote(note_id,asking_div_id)
{var elementPos=$(asking_div_id).cumulativeOffset();var xpos=elementPos[0];var ypos=elementPos[1];url='/cgi-perl/swarm/portfolio.mpl?rm=showNote&note_id='+note_id+"&elemX="+xpos+"&elemY="+ypos;pendURL_push(url);}
function loadNoteReplies(parent_note_id,offset,limit)
{url='/cgi-perl/swarm/portfolio.mpl?rm=getNoteReplies&parent_note_id='+parent_note_id+'&limit='+limit+'&offset='+offset;pendURL_push(url);}
function showAlloc(alloc_id,asking_note_id)
{var elementPos=$('note'+asking_note_id).cumulativeOffset();var xpos=elementPos[0];var ypos=elementPos[1];url='/cgi-perl/swarm/portfolio.mpl?rm=showAlloc&alloc_id='+alloc_id+"&elemX="+xpos+"&elemY="+ypos;pendURL_push(url);}
function updateWall(update_interval)
{if(!EDITING_WALL)
{url=CGIAPP+'?rm=updateWall&update_interval'+update_interval;pendURL_push(url);}
else
{setTimeout('updateWall();',5000);}}
function getWatchList(type,div,exclude_id)
{type=type?type:'';div=div?div:'';exclude_id=exclude_id?exclude_id:'';var url='/cgi-perl/swarm/watchlist.mpl?rm=getWatchList&type='+type+'&div='+div+'&exclude_id='+exclude_id;pendURL_push(url);}
function addToWatchList(port_id)
{var url='/cgi-perl/swarm/watchlist.mpl?rm=addToWatchList&port_id='+port_id;pendURL_push(url);}
function removeFromWatchList(port_id)
{var url='/cgi-perl/swarm/watchlist.mpl?rm=removeFromWatchList&port_id='+port_id;pendURL_push(url);}
function qAlert(title,message)
{new Q.Alert(title,message);}
function submitUserSettings()
{$('statusMessage').innerHTML='<img style="vertical-align:-4px;" src="/images/loadsmall.gif" /> Please wait...';var req=$('userSettings').serialize();var url='/cgi-perl/swarm/account.mpl?rm=saveSettings&'+req;pendURL_push(url);}
function submitFundSettings()
{$('fundStatusMessage').innerHTML='<img style="vertical-align:-4px;" src="/images/loadsmall.gif" /> Please wait...';var req=$('fundSettings').serialize();var url='/cgi-perl/swarm/account.mpl?rm=saveFundSettings&'+req;pendURL_push(url);}
function lengthCheck(str,max,what)
{if((str.value.length>max)&&!ALERT_SHOWING)
{ALERT_SHOWING=1;new Q.Alert(what+" too long",'Sorry, the maximum length of your '+what+' is '+max+' characters.',{onHide:function(){ALERT_SHOWING=0;str.value=str.value.substr(0,max);}});}}
function makeSymOK(str)
{if(str.value.length)
{str.value=str.value.replace(/[^a-zA-Z]/g,'');str.value=str.value.toUpperCase();}}
function resetPortfolio(port_symbol)
{port_symbol=port_symbol||'';var fPortSym=port_symbol?(" ^"+port_symbol):'';new Q.Confirm("Reset your Fund?","Are you SURE you want to reset your Youtual Fund"+fPortSym+"?<br/><br/>  All trade history will be removed, and all your positions will be closed for you and anyone who is holding your Fund.  This fund will no longer be eligible for the current month's performance bonus.  Please be sure this is REALLY what you want to do!",{onConfirm:function(){var url='/cgi-perl/swarm/portfolio.mpl?rm=resetPortfolio&port_symbol='+port_symbol;pendURL_push(url);},style:'warning'});}
function confirmOK(form_id,action)
{if(!action)
{action='Submit and Continue'}
new Q.Confirm("Really "+action+"?","Are you SURE you want to "+action+"? This action cannot be undone.  Please be sure this is REALLY what you want to do!",{onConfirm:function(){$(form_id).submit();},style:'warning'});}
function showEarningsPopup(who)
{var text=$('earnings_popup').innerHTML;q_window('info','current_portfolio','How did '+who+' earn money?',text,400,'','earningsPopup');}
function explainYActual()
{q_window('info','fundfinder_filter','YActual Trading Costs','YActual Trading Costs are an estimate of the <b>daily</b> costs you would incur trading a YoutualFund, including brokerage costs.  The YoutualFunds Finder uses estimated brokerage costs of a $10,000 account at MB Trading when calculating the YActual Trading Cost.  You can customize this by broker and account size on each Youtual Fund page.');}
function takePublicWindow(symbol,days,near_div)
{var title=days?'Extend ^'+symbol+'\'s public listing':'Take ^'+symbol+' public';var content;if(days)
{content='<div style="float:left;width:270px;padding:10px;font-size:13px;"><p>In less than '+days+' days, ^'+symbol+' will be de-listed from the <b>YoutualFunds Exchange</b>, unless you take steps to extend your listing.</p><p>Being listed on the YoutualFunds Exchange means that ^'+symbol+' will continue to be exposed to thousands of investors around the world as a <b>public</b> fund.  These investors will be able to trade ^'+symbol+' in their real-life brokerage account (with our trade mirroring technology).  And when that happens, you will <b>earn money</b>.</p><p><a href="'+SITE_BASE_SSL+'/fund'+symbol+'?rm=showPublicForm&extend=1">Extend your listing today.</a></p></div><div style="float:right;padding-top:10px;"><img src="/images/exchange_ticker.jpg"/></div>';q_window('info','actionBar',title,content,550);}
else
{url='/cgi-perl/swarm/portfolio.mpl?rm=goPublicInfo&port_symbol='+symbol;if(near_div)
{url+='&near_div='+near_div;}
pendURL_push(url);}}
function simpleTradeYFMessage(near_div)
{content='<div class="tutorial"><p>Found a good YoutualFund? Want to "buy shares" of this YoutualFund at your broker? As a premium member of the YoutualFunds Exchange, you can! It\'s easy.</p><p>You\'ll use our amazing "trade-mirroring" technology. Trade mirroring works like this. Let\'s say you love the YoutualFund with the symbol: ^JOHN. When ^JOHN buys a stock, your brokerage account will buy the stock. When ^JOHN sells, your brokerage account will sell.</p><p>This means that the performance of your brokerage account will come pretty darn close to matching the performance of ^JOHN. You can make your trades as big or small as you like by choosing the number of "shares" you\'d like to buy of ^JOHN.</p><p>Currently, brokerage accounts at MB Trading, OptionsXpress, and OpenECry are suppported.  We hope to add more brokers soon.</p></div>';q_window('plain',near_div,'"Buying" YoutualFunds at your real-life broker',content,550);}
function simplePublicYFMessage(near_div)
{content='<div class="tutorial"><ul style="padding-left:3em;padding-right:3em;font-size:14px;"><li>Public funds gain instant exposure to thousands of investors, worldwide.</li><li>Public funds are listed on the YoutualFunds Exchange and featured on the YoutualFunds site.</li><li>Public funds are eligible for management bonuses, including a $1,000 monthly performance bonus.</li><li>Managers of public funds earn money when their fund is traded or subscribed to.</li><li>Public funds can be mirrored in other YoutualFunds - and when <i>those</i> funds are traded, you earn money.</li></ul></div>';q_window('plain',near_div,'Why take a YoutualFund public on the YoutualFunds Exchange?',content,500);}
function YFSubOptions(sym,div,port_id)
{var text='<p style="font-size:14px">You currently have an email-only subscription to ^'+sym+'.</p><p><ul><li><a style="font-size:14px" href="#" onclick="qUtilWin[\'subOptions\'].hide();tradeCostWindow(0,\'^'+sym+'\',0);return false;">Mirror ^'+sym+'\'s trades at your broker</a></li><li><a href="#" style="font-size:14px" onclick="YFUnsub(\''+sym+'\'';if(port_id)
{text+=',\''+port_id+'\'';}
text+=');return false;">Unsubscribe</a></li></ul></p>';q_window('plain',div,'Your Subscription to ^'+sym,text,420,'','subOptions');}
function YFUnsub(sym,port_id)
{qUtilWin['subOptions'].hide();var url='/cgi-perl/swarm/portfolio.mpl?rm=stopSubscribe';if(port_id)
{url=url+'&port_id='+port_id;}
var content='Are you <b>sure</b> you want to unsubscribe from ^'+sym+'?  You will no longer receive real-time trading advice.';new Q.Confirm("Confirm Unsubscribe",content,{onConfirm:function(){pendURL_push(url);},style:'warning',width:'380'});}
function handleSearchKeypress(e)
{var key_pressed=(document.all)?e.keyCode:e.which;if(key_pressed=="38"||key_pressed=="40")
{return highlightSearchItem(key_pressed);}
else if(key_pressed=="13")
{if(search_highlight)
{$('dyns_'+search_highlight).simulate('click');return;}
else if($('bottom_search').value)
{return;}}
gLastKeyPressDate=new Date();if(gUnprocKeypress==0)
{gUnprocKeypress=1;setTimeout('checkPendingSearchKeypress();',10);}}
function highlightSearchItem(key_pressed)
{var to_highlight;if(key_pressed=="40")
{to_highlight=search_highlight?search_highlight-1:0;to_remove=search_highlight?search_highlight:0;}
else
{to_highlight=search_highlight?search_highlight+1:1;to_remove=search_highlight?search_highlight:0;}
if(to_highlight)
{var h_div='dyns_'+to_highlight;if($(h_div)!=undefined)
{$(h_div).style.color='#debf35';}
else if(key_pressed=="38")
{to_remove=0;to_highlight--;}}
search_highlight=to_highlight;if(to_remove)
{var h_div='dyns_'+to_remove;if($(h_div)!=undefined)
{$(h_div).style.color='#444';}}}
function clearBottomDynamicSearch()
{var doThis="document.getElementById('bottomDynamicResults').innerHTML='';$('bottomDynamicResults').style.display='none';"
setTimeout(doThis,200);search_highlight=0;}
function updateBottomDynamicResults(content,offset_div)
{var elementPos=$(offset_div).cumulativeOffset();var xpos=elementPos[0]+2;var ypos=-4;$('bottomDynamicResults').innerHTML=content;$('bottomDynamicResults').style.bottom=ypos+"px";$('bottomDynamicResults').style.left=xpos+"px";$('bottomDynamicResults').style.display='block';search_highlight=0;}
function checkPendingSearchKeypress()
{if(gUnprocKeypress)
{var end=new Date();var msSinceKeyPress=end.getTime()-gLastKeyPressDate.getTime();if((msSinceKeyPress>150)&&$('bottom_search'))
{var s=$('bottom_search').value;if(s.length>0)
{url='/cgi-perl/swarm/utils.mpl?rm=bottomSearch&string='+s;pendURL_push(url);checkURLstack();gUnprocKeypress=0;}
else
{clearBottomDynamicSearch();gUnprocKeypress=0;}}
else
{setTimeout('checkPendingSearchKeypress();',10);}}}
function setupFundFinder(near_div)
{if(qUtilWin['fund_finder'])
{qUtilWin['fund_finder'].remove();}
q_window('plain','','<font style="font-size:16px;font-weight:normal">YoutualFunds Exchange</font>','',934,'finderHTML','fund_finder',1);var docHeight=document.viewport.getHeight();var numToShow=10;if(docHeight>800)
{numToShow=15;}
var useURL="/cgi-perl/swarm/fund_finder.mpl";var dParts=document.domain.split('.');fundFinder=$j('#fundfinder').dataTable({"bProcessing":true,"bServerSide":true,"bStateSave":true,"bLengthChange":true,"iDisplayLength":numToShow,"aLengthMenu":[5,10,15,20],"aaSorting":[[10,'desc']],"sCookiePrefix":"youtualfunds_datatable_","sCookieDomain":dParts[dParts.length-2]+"."+dParts[dParts.length-1],"aoColumnDefs":[{"bSortable":false,"aTargets":[0,6,11,9]}],"fnRowCallback":function(nRow,aData,iDisplayIndex,iDisplayIndexFull){var splitVar=aData[11].split("-");var row_html='<div style="width:100px"><a href="#" onclick="addToWatchList('+splitVar[0]+');return false;">Add to Watchlist</a>';if((typeof isO!="undefined")&&isO)
{row_html+='<br/><a href="#" onclick="editChart();doSymSelect(\'^'+splitVar[1]+'\');return false;">Add to Allocation</a>';}
row_html+='</div>';$j('td:eq(11)',nRow).html(row_html);return nRow;},"fnServerData":function(sSource,aoData,fnCallback){var tag_count=0;for(t in finder_tags_selected)
{if(finder_tags_selected[t]==1)
{aoData.push({"name":"bTagSelected_"+tag_count,"value":finder_tags[t]});tag_count++;}}
aoData.push({"name":"iTagsSelected","value":tag_count});aoData.push({"name":"sFindTagType","value":finder_tag_type});$j.getJSON(sSource,aoData,function(json){fnCallback(json)});},"fnStateSaveCallback":function(oSettings,sValue){var tag_count=0;var tag_string='';for(t in finder_tags_selected)
{if(finder_tags_selected[t]==1)
{if(tag_string){tag_string+=', '}
tag_string+='"'+finder_tags[t]+'"';tag_count++;}}
sValue+=',"aSelectedTags": ['+tag_string+']';sValue+=',"sFindTagType": "'+finder_tag_type+'"';sValue+=',"iTagsSelected": "'+tag_count+'"';return sValue;},"fnStateLoadCallback":function(oSettings,oData){finder_tag_type=oData.sFindTagType;$j("[name=tag_search_type]").filter("[value="+finder_tag_type+"]").attr("checked","checked");if(oData.iTagsSelected>0)
{for(i=0;i<oData.iTagsSelected;i++)
{setTimeout("toggleFinderTag( 'finder_tag_' + "+finder_tag_counters[oData.aSelectedTags[i]]+", 1);",200);}
setTimeout("fundFinder.fnDraw();",200);}
return true;},"sPaginationType":"full_numbers","sAjaxSource":useURL});$j('#explainScore').tipsy({gravity:'w'});$j('#explainYactual').tipsy({gravity:'w'});$j('#explainPrize').tipsy({gravity:'w'});$j('#explainPrizeNonPub').tipsy({gravity:'w'});}
function openFundFinder(near_div)
{qUtilWin['fund_finder'].show();}
function toggleFinderTag(which,no_finder_draw)
{if(finder_tags_selected[which])
{finder_tags_selected[which]=0;$(which).style.border="1px solid #fff";}
else
{finder_tags_selected[which]=1;$(which).style.border="1px solid #e33";}
drawFinderTagString();if(!no_finder_draw)
{fundFinder.fnDraw();}}
function clearFinderTags(no_finder_draw)
{for(t in finder_tags_selected)
{if(finder_tags_selected[t]==1)
{toggleFinderTag(t,1);}}
if(!no_finder_draw)
{fundFinder.fnDraw();}}
function drawFinderTagString()
{var tags=new Array;for(t in finder_tags_selected)
{if(finder_tags_selected[t]==1)
{tags.push(finder_tag_titles[t]);}}
tag_string=tags.length?'Tags: <b>'+tags.join('</b> '+finder_tag_type+' <b>')+'</b>':'No Tag Filters';tag_string+=EDITING_FIND_TAGS?' (click to stop selecting)':' (click to change selection)';$('add_search_tag').innerHTML=tag_string;}
function finderTagType(type)
{finder_tag_type=type;fundFinder.fnDraw();drawFinderTagString();}
function showFinderTags()
{Effect.BlindDown('finder_tag_panel',{duration:.2});EDITING_FIND_TAGS=1;drawFinderTagString();$('add_search_tag').onclick=function(){hideFinderTags();return false;};}
function hideFinderTags()
{Effect.BlindUp('finder_tag_panel',{duration:.2});EDITING_FIND_TAGS=0;drawFinderTagString();$('add_search_tag').onclick=function(){showFinderTags();return false;};}
function hsvToRgb(h,s,v){var r,g,b;var i=Math.floor(h*6);var f=h*6-i;var p=v*(1-s);var q=v*(1-f*s);var t=v*(1-(1-f)*s);switch(i%6){case 0:r=v,g=t,b=p;break;case 1:r=q,g=v,b=p;break;case 2:r=p,g=v,b=t;break;case 3:r=p,g=q,b=v;break;case 4:r=t,g=p,b=v;break;case 5:r=v,g=p,b=q;break;}
return"rgb("+Math.round(r*255)+","+Math.round(g*255)+","+Math.round(b*255)+")";}
function stopFlashing(el)
{var id='yfflash'+el;gFlashDivUntil[id]=0;}
function flashImage(el,whichImage,woffset,hoffset,howlong)
{var id='yfflash'+el;var p=document.createElement('div');p.setAttribute('id',id);$('page').appendChild(p);$(id).innerHTML='<img src="'+whichImage+'">';var divx=findPosX($(el));var divy=findPosY($(el));var xoffset=divx+woffset;var yoffset=divy+hoffset;$(id).style.position="absolute";$(id).style.top=yoffset+'px';$(id).style.left=xoffset+'px';if(howlong==-1)
{gFlashDivUntil[id]=-1;}
else
{var nowtime=new Date();var flashUntilTime=nowtime.getTime()+howlong*1000;gFlashDivUntil[id]=flashUntilTime;}
setTimeout('flash0(\''+id+'\');',600);}
function flash0(id)
{new Effect.Opacity(id,{duration:.3,from:1,to:0});setTimeout('flash1(\''+id+'\');',600);}
function flash1(id)
{if(gFlashDivUntil[id]!=-1)
{var nowtime=new Date();if(nowtime.getTime()>gFlashDivUntil[id])
{gFlashDivUntil[id]=0;}}
if(gFlashDivUntil[id]!=0)
{new Effect.Opacity(id,{duration:.3,from:0,to:1});setTimeout('flash0(\''+id+'\');',600);}}
function makeSwarmDropDown(anchorDivID,onOff)
{var menuID='swarmDropContent'+anchorDivID;if(onOff)
{var divx=findPosX($(anchorDivID));var divy=findPosY($(anchorDivID));var woffset=-1;var hoffset=27;var ie7=(document.all&&!window.opera&&window.XMLHttpRequest);if(ie7)
{woffset=woffset-40;}
var xoffset=divx+woffset;var yoffset=divy+hoffset;$(menuID).style.position="absolute";$(menuID).style.top=yoffset+'px';$(menuID).style.left=xoffset+'px';clearTimeout(gMenuTimeoutID[menuID]);turnOffMenuOtherThanThis(menuID);gDropDownMenuOn[menuID]=1;$(menuID).style.zIndex=99999;$(menuID).style.display='block';}
else
{var timeoutId=setTimeout("turnOffThisMenu('"+menuID+"')",1000);gMenuTimeoutID[menuID]=timeoutId;}}
function turnOffThisMenu(menuID)
{gDropDownMenuOn[menuID]=0;$(menuID).style.display='none';}
function turnOffMenuOtherThanThis(menuID)
{for(var k in gDropDownMenuOn)
{if(gDropDownMenuOn[k]==1)
{if(k!==menuID)
{$(k).style.display='none';}}}}
function startNewFund(nearDiv)
{nearDiv=nearDiv||'swarmDropContentdivDrop_Funds';pendURL_push('/cgi-perl/swarm/utils.mpl?rm=startNewFund&nearDiv='+nearDiv);}
function newFundForm()
{var URL=SITE_BASE_SSL+'/cgi-perl/swarm/utils.mpl?rm=showFundForm';document.getElementById('genericPopup').innerHTML='<div id="redirectMsg"><p align="center"><h1>Redirecting to secure server...</h1></p><p align="center"><img src="/images/loading.gif"></p></div>';setTimeout('document.location.href="'+URL+'";',2000);}
function verifyCCForMoreFunds()
{var req=$('moreFunds').serialize();var url='/cgi-perl/swarm/utils.mpl?rm=verifyMoreFundForm&'+req;pendURL_push(url);}
function verifyCCForPublicFund(symbol)
{var req=$('takePublic').serialize();var url=SITE_BASE_SSL+'/fund'+symbol+'?rm=verifyPublicForm&'+req;pendURL_push(url);}
function startClaimEarnings()
{qUtilWin['earningsPopup'].hide();pendURL_push('/cgi-perl/swarm/account.mpl?rm=startClaimBalance');}
function doClaimEarnings()
{if(validateEmail($('pp_email').value))
{qUtilWin['claimForm'].hide();pendURL_push('/cgi-perl/swarm/account.mpl?rm=doClaimBalance&pp_email='+$('pp_email').value);}
else
{q_inform('warning','Please enter a valid email address associated with your PayPal account');}}
function changeFBTWPreview(type,val,extra)
{var sym=$('current_symbol_a').innerHTML;sym=sym.replace('^','');var fb_text="Check out the investment fund I am managing!";var tw_text="Check out the <span class='tw_link'>#investment</span> <span class='tw_link'>#fund</span> I manage, ^"+sym+". <br/>This <span class='tw_link'>#YoutualFund</span> ";var change_word=(val>0)?'Gains of':'Lost';var tw_change_word=(val>0)?'gained':'lost';if((type=='inception')||(type=='last_7')||(type=='last_30')||(type=='last_90'))
{var when_string;if(type=='inception')
{when_string='since inception';$('recurring_options').style.display='none';}
else if(type=='last_7')
{when_string='in the past 7 days';$('recurring_options').style.display='block';$('only_pos_recurring').style.display='block';$('recurring_freq').innerHTML='once every 7 days';}
else if(type=='last_30')
{when_string='in the past 30 days';$('recurring_options').style.display='block';$('only_pos_recurring').style.display='block';$('recurring_freq').innerHTML='once every 30 days';}
else if(type=='last_90')
{when_string='in the past 90 days';$('recurring_options').style.display='block';$('only_pos_recurring').style.display='block';$('recurring_freq').innerHTML='once every 90 days';}
fb_text+="<br/>"+change_word+" "+val+"% "+when_string+".";tw_text+=" has "+tw_change_word+" "+val+"% "+when_string+".";}
else if(type=='closed_sym')
{fb_text+="<br/>Recently closed a position in "+val+" for a gain in fund value of "+extra;tw_text+=" closed a trade of "+val+", gaining "+extra;$('recurring_options').style.display='none';}
else if(type=='simple')
{tw_text+=" can be traded at your brokerage!";$('recurring_options').style.display='none';}
else if(type=='started_comp')
{fb_text="Just a friendly competition...<br/>Think you've got what it takes to beat me trading stocks?<br/>Join in!";tw_text="Think you have the skills to beat me <span class='tw_link'>#trading</span> <span class='tw_link'>#stocks</span>?<br/>Join my <span class='tw_link'>#YoutualFund</span> competition, starting soon!";$('recurring_options').style.display='block';$('pos_recurring').style.display='none';$('recurring_freq').innerHTML='whenever I start a public competition with this fund';}
tw_text+="<br/><span class='tw_link'>http://"+sym+".youtualfunds.com</span>";if(type!='started_comp')
{fb_text+="<br/>Follow my stock trades in your brokerage account.";}
var fb_right_text="<div class='fb_link'>YoutualFunds.com | "+$('current_portfolio_a').innerHTML+" (^"+sym+")</div>";fb_right_text+="<div class='fb_subtle'>"+sym+".youtualfunds.com</div>";fb_right_text+="<br/><div style='margin-top:5px;' class='fb_subtle'>YoutualFunds: People-powered investing</div>";$('fb_preview_text').innerHTML=fb_text;$('fb_preview_right').innerHTML=fb_right_text;$('fb_name').innerHTML=$('current_alias_a').innerHTML;$('tw_name').innerHTML=$('current_alias_a').innerHTML;$('tw_preview_text').innerHTML=tw_text;}
function createPost(which)
{var recur=0;var recur_pos=0;var type=$j("input[name='share_type']:checked").val();if((type=="started_comp")||(type=="last_7")||(type=="last_30")||(type=="last_90"))
{if($('make_recurring').checked==true)
{recur=1;if($('only_pos_recurring').checked==true)
{recur_pos=1;}}}
var url="/cgi-perl/swarm/portfolio.mpl?rm=createSharePost&to="+which+"&type="+type+"&recur="+recur+"&recur_only_pos="+recur_pos;pendURL_push(url);}
function validateEmail(id)
{var emailPattern=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$/;return emailPattern.test(id);}
function cancelYFSubProcess()
{if(qUtilWin['ATShares'])
{qUtilWin['ATShares'].close();}}
function cancelYFBrokerProcess()
{if(qUtilWin['ATShares'])
{qUtilWin['ATShares'].close();}
var url='/cgi-perl/swarm/utils.mpl?rm=cancelBrokerProcess';pendURL_push(url);}
function startYFATSetup()
{var url='/cgi-perl/swarm/utils.mpl?rm=startATSetup';pendURL_push(url);}
function startSubscribeSetup()
{var url='/cgi-perl/swarm/portfolio.mpl?rm=startSubscribeSetup';pendURL_push(url);}
function startVote(port_id)
{var url='/cgi-perl/swarm/portfolio.mpl?rm=startVote&port_id='+port_id;pendURL_push(url);}
function castVote(port_id,notes)
{var url='/cgi-perl/swarm/portfolio.mpl?rm=castVote&port_id='+port_id;if(notes)
{url+='&comment='+notes;}
pendURL_push(url);if(IS_MONTH_VOTE_PAGE)
{setTimeout('updateBonusTable();',2000);}}
function updateBonusTable()
{var url='/cgi-perl/swarm/monthly_bonus.mpl?rm=getPrizeList';pendURL_push(url);if(IS_MONTH_VOTE_PAGE)
{setTimeout('updateBonusTable();',25000);}}
function secureFundPage(sym)
{var url=SITE_BASE_SSL+"/fund"+sym;q_inform('info','Redirecting to Secure Site...');document.location.href=url;}
function recalcTradeShares(shares,price,cash,orig_time,fundsymbol)
{var cTime=new Date;if(sharesKeyPressed&&(sharesKeyPressed.getTime()<(cTime.getTime()-1000)))
{sharesKeyPressed=0;shares=parseInt(shares)||YFMinShares;if(shares<YFMinShares)
{shares=YFMinShares;$('sharesMessage').innerHTML="Minimum purchase of "+YFMinShares+" shares.";}
else
{$('sharesMessage').innerHTML="";}
$('num_shares_select').value=shares;var dollars=sprintf("%.2f",(shares*price));$('dollars_invested').innerHTML='$'+commatize(dollars);drawSharesChart(shares,price,cash,fundsymbol);}
else if(sharesKeyPressed)
{if(orig_time&&(orig_time<sharesKeyPressed.getTime()))
{}
else
{if(!orig_time)
{sharesKeyPressed=cTime;orig_time=cTime.getTime();}
'recalcTradeShares("'+shares+'", '+price+','+cash+','+orig_time+',"'+fundsymbol+'" );'
setTimeout('recalcTradeShares("'+shares+'", '+price+','+cash+','+orig_time+',"'+fundsymbol+'" );',100);}}
else
{sharesKeyPressed=cTime;setTimeout('recalcTradeShares("'+shares+'", '+price+','+cash+','+sharesKeyPressed.getTime()+',"'+fundsymbol+'" );',100);}}
function drawSharesChart(fundShares,fundPrice,fundCash,fundsymbol)
{var scaling=(fundShares*fundPrice)/(fundPrice*1000);var pieData=new Array();if(fundCash)
{var scaledCash=parseInt(fundCash*scaling);if((scaledCash/(fundShares*fundPrice))>.01)
{pieData.push({name:'Unallocated',data:'',y:scaledCash});}}
var totalComm=0;for(sym in tradeShares)
{var numShares=parseInt(tradeShares[sym]['shares']*scaling);if(numShares)
{var brokerCost;if(tradePlanBandQuant)
{brokerCost=(numShares<=tradePlanBandQuant)?tradePlanMin:(tradePlanMin+(tradePlanCPS*(numShares-tradePlanBandQuant)));}
else
{brokerCost=numShares*tradePlanCPS;brokerCost=(brokerCost<tradePlanMin)?tradePlanMin:brokerCost;}
totalComm+=brokerCost;pieData.push({name:sym,data:tradeShares[sym]['name'],shares:numShares,direction:tradeShares[sym]['direction'],brokerCost:sprintf("%.2f",brokerCost),y:parseInt(numShares*tradeShares[sym]['price'])});}}
try{document.getElementById('commholder').innerHTML='Broker will charge $'+commatize(sprintf("%.2f",totalComm))+' in commissions to open these positions';}
catch(err){}
sharesChart=new Highcharts.Chart({chart:{renderTo:'sharesChartContainer',plotBackgroundColor:null,backgroundColor:null,plotBorderWidth:null,plotShadow:false},credits:{enabled:false},title:{text:'<b>If you buy '+commatize(fundShares)+' shares of '+fundsymbol+', your account will open these positions...</b>',style:{fontSize:'12px',color:'black'}},subtitle:{text:'(mouse over for details)',style:{fontSize:'11px',color:'#777777'}},tooltip:{formatter:function(){if(this.point.name=='Unallocated')
{return"'Unallocated' means that this amount of cash is going<br/> to remain unspent at first, but it may be used later,<br/> to open new positions that this Youtual Fund opens";}
else
{var s='s';if(this.point.data==1){s='';}
return this.point.data+' ('+this.point.name+')<br/>$'+commatize(this.y)+' investment<br/>'+this.point.shares+' '+this.point.direction+' share'+s+'<br/>$'+commatize(this.point.brokerCost)+' in broker fees';}}},plotOptions:{pie:{allowPointSelect:false,cursor:'pointer',dataLabels:{enabled:true,color:'#000000',style:{fontFamily:'Arial, sans-serif'},connectorColor:'#999999',distance:20,formatter:function(){if(this.point.name=='Unallocated')
{return'<b>'+this.point.name+'</b>: $'+commatize(this.y);}
else
{var s='s';if(this.point.shares==1){s='';}
return'<b>'+this.point.name+'</b>: '+this.point.shares+' share'+s+' for $'+commatize(this.y);}}}}},series:[{type:'pie',name:'Actual number of shares to purchase',data:pieData}]});}
function getPieColors(number,offset,rgb)
{var start=offset?offset:0;number=offset?number+offset:number;var hues=[.63,.18,.45,1,0,.54,.36,.72,.91,.09,.81];var colors=new Array();for(var i=start;i<number;i++)
{if(i<hues.length)
{var v=(i%2)?.5:.75;var s=(i%2)?.6:1;if(rgb)
{colors.push(hsvToRgb(hues[i],s,v));}
else
{colors.push("hsb("+hues[i]+", "+s+","+v+")");}}
else
{var hue=(hues[i-hues.length]!=null)?hues[i-hues.length]:hues[i-(hues.length*2)];var v=(i%2)?.4:.85;var s=(i%2)?.75:.9;if(rgb)
{colors.push(hsvToRgb(hue,s,v));}
else
{colors.push("hsb("+hue+", "+s+","+v+")");}}}
return colors;}
function calcYFMinShares(current_price)
{var shares_needed=1;var num_shares_found=0;while(!num_shares_found)
{var scaling=(shares_needed*current_price)/(current_price*1000);var found_positions=0;var total_positions=0;for(sym in tradeShares)
{total_positions++;var numShares=parseInt(tradeShares[sym]['shares']*scaling);if(numShares)
{found_positions++;}}
if(!total_positions)
{shares_needed=10;num_shares_found=1;}
else if((found_positions/total_positions)>=.75)
{num_shares_found=1;}
else
{shares_needed++;}}
return shares_needed;}
function showYFBrokerOptions(port_symbol)
{if(!qUtilWin['trade_guar'])
{q_window('plain','topBar','Trade ^'+port_symbol+' at your broker','',475,'','trade_guar');}
var url='/cgi-perl/swarm/portfolio.mpl?rm=showBrokerOptions';if(port_symbol)
{url+='&port_symbol='+port_symbol;}
pendURL_push(url);qUtilWin['trade_guar'].update('<img style="vertical-align:-4px;" src="/images/loadsmall.gif" /> Please wait...');qUtilWin['trade_guar'].show();pendURL.push('/cgi-perl/swarm/utils.mpl?rm=trackClick&item=yf_broker_options&data='+thisPortID);}
function selectYFBrokerNew(plan_id,new_account,port_symbol)
{new_account=new_account?1:0;var url='/cgi-perl/swarm/portfolio.mpl?rm=selectNewBroker&plan_id='+plan_id+'&new_account='+new_account;if(port_symbol)
{url+='&port_symbol='+port_symbol;}
pendURL_push(url);qUtilWin['trade_guar'].update('<br/><br/><p align="center"><img style="vertical-align:-4px;" src="/images/circularLoad.gif" /><br/>Redirecting to secure server,<br/>please wait...</p>');}
function showYFSubscribeForm(port_symbol)
{var url='/cgi-perl/swarm/portfolio.mpl?rm=showSubscribeForm';if(port_symbol)
{url+='&port_symbol='+port_symbol;}
pendURL_push(url);if(qUtilWin['trade_guar'])
{qUtilWin['trade_guar'].update('<br/<br/><img style="vertical-align:-4px;" src="/images/loadsmall.gif" /> Redirecting to secure server, please wait...');}
pendURL.push('/cgi-perl/swarm/utils.mpl?rm=trackClick&item=yf_subscribe_form&data='+thisPortID);}
function handleCCSub(has_card)
{$('quantButtHolder').style.display='none';$('feedback').innerHTML='<img style="vertical-align:-4px;" src="/images/loadsmall.gif" /> Please wait...';has_card=has_card||0;pendURL_push('/cgi-perl/swarm/portfolio.mpl?rm=trySubscribe&has_card='+has_card+'&cc='+$('cardnum').value+'&exp='+$('expiration').value+$('cvv').value+'&cctype='+$('cctype').value+'&use_email='+$('use_email').value+'&sms_carrier='+encodeURIComponent($('carrier').value)+'&sms_number='+$('wireless_number').value);}
function handleYFSub()
{$('quantButtHolder').style.display='none';$('feedback').innerHTML='<img style="vertical-align:-4px;" src="/images/loadsmall.gif" /> Please wait...';pendURL_push('/cgi-perl/swarm/portfolio.mpl?rm=trySubscribe&use_email='+$('use_email').value+'&sms_carrier='+encodeURIComponent($('carrier').value)+'&sms_number='+$('wireless_number').value);}
function brokerRequestHelp(port_sym)
{var url='/cgi-perl/swarm/autotrade.mpl?rm=humanHelp&port_symbol='+port_sym;pendURL_push(url);}
function submitBrokerHelpRequest(port_sym)
{if((!$('contactEmail').value)&&(!$('contactPhone').value))
{$('feedback').innerHTML='Please enter either your email address or phone number';return;}
var req=$('helpRequest').serialize();var tz=0-(new Date().getTimezoneOffset()/60);var url='/cgi-perl/swarm/utils.mpl?rm=brokerHelpRequest&'+req+'&port_sym='+port_sym+'&tz='+tz;pendURL_push(url);qUtilWin['trade_guar'].update('<p>Thank you.  Your help request was submitted and our broker account specialist will be in touch with you shortly.</p><p><a href="#" onclick="qUtilWin[\'trade_guar\'].close();return false;">Close this window</a>');}
function validateAndSubmitGenericSignUpNoAutoTrade(portID,symbol,anchorDiv,promo)
{_validateAndSubmitGenericSignUp(portID,symbol,anchorDiv,0,promo);}
function validateAndSubmitGenericSignUp(portID,symbol,anchorDiv,promo)
{_validateAndSubmitGenericSignUp(portID,symbol,anchorDiv,1,promo);}
function _validateAndSubmitGenericSignUp(portID,symbol,anchorDiv,doAutoTrade,promo)
{var proceed=0;if((!document.getElementById('firstname').value.length)||(!document.getElementById('lastname').value.length))
{document.getElementById('errorStatus').innerHTML='Enter your first and last name.';}
else if(!document.getElementById('email').value.length)
{document.getElementById('errorStatus').innerHTML='Enter valid email address.';}
else if(!document.getElementById('password').value.length)
{document.getElementById('errorStatus').innerHTML='Enter the password you want to use for your account.';}
else
{document.getElementById('errorStatus').innerHTML='';proceed=1;}
var c_text=$('c_text')?$('c_text').value:'';if(proceed)
{var url='/cgi-perl/swarm/autotrade.mpl?rm=autotradeRegister'
+'&fn='+encodeURIComponent(document.getElementById('firstname').value)
+'&ln='+encodeURIComponent(document.getElementById('lastname').value)
+'&pw='+encodeURIComponent(document.getElementById('password').value)
+'&promo='+(promo?encodeURIComponent(promo):'')
+'&img='+c_image
+'&code='+c_text
+'&email='+encodeURIComponent(document.getElementById('email').value)
+'&fromPortID='+portID
+'&anchorDiv='+encodeURIComponent(anchorDiv)
+'&doAutoTrade='+doAutoTrade;document.getElementById('donebutt').innerHTML='Wait...';pendURL.push(url);}}
function YFC2Publish(port_symbol)
{var url='/cgi-perl/swarm/portfolio.mpl?rm=showC2PubForm';if(port_symbol)
{url+='&port_symbol='+port_symbol;}
pendURL_push(url);}
function verifyC2Pub(name_needed)
{if((!$('sub_rate').value)||($('sub_rate').value<=0))
{$('error_here').innerHTML='Please enter a subscription rate';setTimeout('qUtilWin["yfc2_pubwin"].show();',100);return false;}
if(name_needed&&(!$('system_name').value))
{$('error_here').innerHTML='Please enter a name for your fund';setTimeout('qUtilWin["yfc2_pubwin"].show();',100);return false;}
var req=$('c2_pub_info').serialize();var url=((typeof $('update_only')!='undefined')?SITE_BASE:SITE_BASE_SSL)+'/cgi-perl/swarm/portfolio.mpl?'+req;pendURL_push(url);}
function extendC2Pub(symbol)
{qUtilWin['yfc2_pubwin'].close();qUtilWin['yfc2_pubwin'].remove();var url='/cgi-perl/swarm/portfolio.mpl?rm=publishOnC2';pendURL_push(url);}
function verifyC2Extend()
{var req=$('c2_extend_info').serialize();var url=SITE_BASE_SSL+'/cgi-perl/swarm/portfolio.mpl?'+req;pendURL_push(url);}
function showExtendC2Form(symbol)
{qUtilWin['yfc2_pubwin'].close();qUtilWin['yfc2_pubwin'].remove();var url='/cgi-perl/swarm/portfolio.mpl?rm=showC2PubForm&only_extend=1';pendURL_push(url);}
function tradeCostWindow(pid_on_page_draw,symbol,whichBroker,acctNum,bc)
{if(!document.getElementById('registeredSincePageDraw'))
{window.location='/cgi-perl/swarm/portfolio.mpl?port_symbol='+symbol+'&launchMirror=1';return;}
if((document.getElementById('registeredSincePageDraw').value==1)&&(pid_on_page_draw==0))
{window.location='/cgi-perl/swarm/portfolio.mpl?port_symbol='+symbol+'&launchMirror=1';return;}
if(!tradeCostText)
{tradeCostText=$('trade_guarantee').innerHTML;$('trade_guarantee').remove();}
else
{qUtilWin['trade_guar'].remove();}
if(symbol.length>0)
{q_window('plain','','<b>Mirror '+symbol+' in your brokerage account</b>',tradeCostText,525,'','trade_guar');}
else
{q_window('plain','','<b>Mirror in your brokerage account</b>',tradeCostText,525,'','trade_guar');}
pendURL.push('/cgi-perl/swarm/utils.mpl?rm=trackClick&item=trade_cost_window&data='+thisPortID);if(whichBroker)
{if(acctNum.length)
{$('accountnum').value=acctNum;}
if(bc)
{choosebrokernew(whichBroker,bc,whichBroker);}}}
function delistFund(sym)
{content='Are you SURE you want to de-list ^'+sym+' from the YoutualFunds Exchange?  Others will no longer be able to find or receive trading advice from your fund, and it will no longer be eligible for management bonuses.';qWin['delistFund']=new Q.Confirm("De-list ^"+sym+'?',content,{onConfirm:function(){pendURL_push('/cgi-perl/swarm/portfolio.mpl?rm=changePublicStatus&action=delist');},style:'warning',width:'380'});}
function listFund(sym)
{pendURL_push('/cgi-perl/swarm/portfolio.mpl?rm=changePublicStatus&action=list');}
