function showChart(whatSort, which) { setCookie("chartType", whatSort ); setCookie("chartTidm", which ); top.location.reload(); return true; } function getAmountFromPortfolio(index_code) { var portlist=getCookie("portlist"); if ((portlist==null)||(portlist == "")) {return 0} return portFuncs("AMM",portlist,"","",index_code); } function getPaidFromPortfolio(index_code) { var portlist=getCookie("portlist"); if ((portlist==null)||(portlist=="")) {return 0.0} return portFuncs("PID",portlist,"","",index_code); } function setValuesInPortfolio(index_code,newpaid,newamount) { var portlist=getCookie("portlist"); var count=0; objToPass={newlist:""} if ((portlist==null)||(portlist=="")) {return} count=portFuncs("SVI",portlist,objToPass,"",index_code,newpaid,newamount) setCookie("portlist",objToPass.newlist); return; } function outputAsPrice(value) { var strValue=""; var strThousands=""; var strHundreds="000"; var strFractionalbit="00"; var negative=0; var index=0; var thousands=0; var hundreds=0; var fractionalbit=0; var integer=""; var fraction=""; var subfraction=""; with(Math) { if (value<0) { negative=1; value=abs(value); } thousands=floor(value/1000); if (thousands!=0) { strThousands=""+thousands; } if (thousands!=0) { hundreds=floor(value-(thousands*1000)); } else { hundreds=floor(value); } strHundreds=""+hundreds; if (thousands!=0) { if (strHundreds.length==1){strHundreds="00"+hundreds}; if (strHundreds.length==2){strHundreds="0" +hundreds}; } if (strHundreds.length==0){ if (thousands!=0){ strHundreds="000"; } else { strHundreds="0"; } } fractionalbit=(value-abs(floor(value)))*100; if (fractionalbit==0) { strFractionalbit="00"; } else { if (fractionalbit<10) { strFractionalbit="0"+floor(fractionalbit); } else { strFractionalbit=""+fractionalbit; } } if (strFractionalbit.length>2) { strFractionalbit=strFractionalbit.substring(0,2); } if (strFractionalbit.length==0) { strFractionalbit="00"; } else { if (strFractionalbit.length==1) { strFractionalbit=strFractionalbit+"0"; } } if (negative==1) { d("-"); } if (thousands==0) { d(""+strHundreds+"."+strFractionalbit); } else { d(""+strThousands+","+strHundreds+"."+strFractionalbit); } } } function addToTotals(worth,gain) { totalSharesWorth=totalSharesWorth+worth; totalGain=totalGain+gain; } function showUserHeadings() { dln('
| '); dln(''+diObj.diID+''); dln(' | '+diObj.diName+' |