
var osX=0;var osY=0;var intGraphHeight=0;var N;var NetDirectLiq=new Array();var NetAVLiq=new Array();var NetPEALiq=new Array();var TauxImp=new Array();var run="";var loaded=false;var g2_erros="";var abb_cel_AV=30000;var abb_mar_AV=60000;var max_cel_PEA=600000;var max_mar_PEA=1200000;var userchoice="withPEA";var repartmon_p=10;var repartact_p=20;var repartobl_p=70;var repartmon_e=8;var repartact_e=40;var repartobl_e=52;var repartmon_d=5;var repartact_d=70;var repartobl_d=25;var repartmon_a=0;var repartact_a=100;var repartobl_a=0;var profil_pru="Prudent";var profil_equ="Equilibre";var profil_dyn="Dynamique";var profil_abs="100% actions";var tx_frais_CT=1;var tx_imp_CT=26;var tx_rot_CT=50;var tx_frais_PEA=1;var tx_imp2_PEA=32.5;var tx_imp5_PEA=26;var tx_impF_PEA=10;var tx_rot_PEA=0;var tx_min_PEA=65;var tx_frais_AV=0.8;var tx_imp4_AV=45;var tx_imp8_AV=25;var tx_impF_AV=17.5;var tx_impA_AV=10;var valCapitalDepart;var valHorizon;var valRepartMon;var valRepartAct;var valRepartObl;var valRentMon;var valRentAct;var valRentObl;var valRepartTot;var valTxRotCT;var valFraisCT;var valTxRotPEA;var valFraisPEA;var valFraisAV;var calcul_ok=false;function _numToUnits(n,units_prefix,decimal_places,units_suffix)
{if(isOverflow(n))return'<i>numeric overflow</i>'
var isNegative=(n<0)?true:false
var s=''
var d=strToInt(decimal_places)
var x=Math.abs(Math.round(n*Math.pow(10,decimal_places)))
if(x==0)
{var defaultStr='0'
if(d>0)
{defaultStr+=','
for(var i=0;i<d;i++)defaultStr+='0'}
defaultStr=units_prefix+defaultStr+units_suffix
return defaultStr}
if(d==0)
{var tmp=''+x
s=addCommas(tmp)}
else
{var leftTmp=''+x
var rightTmp=''+x
var len=leftTmp.length
for(var i=0;i<d+1-len;i++)
{leftTmp='0'+leftTmp
rightTmp='0'+rightTmp}
len=leftTmp.length
var decimalSplit=len-d
var leftStr=addCommas(leftTmp.substring(0,decimalSplit))
var rightStr=rightTmp.substring(decimalSplit,len)
s=leftStr+','+rightStr}
s=units_prefix+s+units_suffix
if(isNegative)s='-'+s
return s}
function numToFloatbis(n)
{n=n.replace(/ /g,"");if(n.length>0)
{return _numToUnits(n,"",0,"")}}
function putValue(myInput,defInput)
{if(myInput!="")
return numToFloatbis(myInput);else
return numToFloatbis(defInput);}
function putResult(myResult)
{return numToFloatbis(myResult.toString());}
function monav(idname,pic)
{if(document.images&&loaded)
{document.images[idname].src="<msn:Context runat=server key=AssetsUrl/>calcv12/img_capi/"+pic;}}
function userchoicePEA()
{var f=document.allocation2;if(f.choice[0].checked){userchoice="noPEA";}
else{userchoice="withPEA";if(f.Mariage.options[1].selected){f.CapitalDepart.value=max_mar_PEA;}
else{f.CapitalDepart.value=max_cel_PEA;}}}
var curhelp="";function showhelp(formno,qty,helpid)
{if(document.getElementById(formno)&&loaded)
{helpid="help"+formno+"-"+helpid;if(curhelp=="")
{for(n=1;n<=qty;n++)
{document.getElementById("help"+formno+"-"+n).style.display="none";}}
else
{document.getElementById(curhelp).style.display="none";}
if(document.getElementById(helpid))
{document.getElementById(helpid).style.display="";curhelp=helpid;document.getElementById("showall"+formno).style.display="";}}}
function showall(formno,qty)
{for(n=1;n<=qty;n++)
{document.getElementById("help"+formno+"-"+n).style.display="";}
curhelp="";window.focus();}
function jump(pageFrom,pageTo,helpqty)
{g2_erros="";if(ValidatePage(pageFrom))
{if(pageFrom!=pageTo)
{eval("document.allocation"+pageFrom+".style.visibility='hidden';");eval("document.allocation"+pageFrom+".style.display='none';");eval("document.allocation"+pageTo+".style.visibility='visible';");eval("document.allocation"+pageTo+".style.position='static';");eval("document.allocation"+pageTo+".style.display='';");eval("document.allocation"+pageFrom+".style.position='absolute';");}
vtemp=document.allocation6.offsetTop;if(helpqty>0)
{eval("showall("+pageTo+","+helpqty+")");}
if(pageTo==1)
{}
if(pageTo==2)
{}
if(pageTo==3)
{}
if(pageTo==4)
{if(userchoice=="withPEA")
{document.getElementById("divAllocation4WithPea1").style.display="";document.getElementById("divAllocation4WithPea2").style.display="";document.getElementById("divAllocation4WithPea3").style.display="";document.getElementById("divAllocation4WithPea4").style.display="";document.getElementById("divAllocation4WithPea5").style.display="";document.getElementById("divAllocation4WithPea6").style.display="";}
else
{document.getElementById("divAllocation4WithPea1").style.display="none";document.getElementById("divAllocation4WithPea2").style.display="none";document.getElementById("divAllocation4WithPea3").style.display="none";document.getElementById("divAllocation4WithPea4").style.display="none";document.getElementById("divAllocation4WithPea5").style.display="none";document.getElementById("divAllocation4WithPea6").style.display="none";}
if(document.allocation2.Mariage.options[1].selected)
{document.getElementById("tdAllocation4Mariage").innerHTML="<p>"+abb_mar_AV+"&nbsp;&euro;</p>";}
else
{document.getElementById("tdAllocation4Mariage").innerHTML="<p>"+abb_cel_AV+"&nbsp;&euro;</p>";}}
if(pageTo==5)
{calcul_ok=false;calculGestion();if(userchoice=="withPEA")
{document.getElementById("help5-3").style.display='';}
else
{document.getElementById("help5-3").style.display='none';}
DisplayResults();}
if(pageTo==6)
{calcul_ok=false;calculGestion();DisplayGraph();}}
else
{alert("Certaines donn\u00E9es sont erron\u00E9es.\nV\u00E9rifiez ces champs: "+g2_erros)}}
function addError(name)
{g2_erros=g2_erros+"\n"+name;}
function ValidatePage(tmp_current)
{if(tmp_current==2)
{if(!checkInput(2,"CapitalDepart","N"))
{addError("Capital de d\u00E9part");}
if(!checkInput(2,"Horizon","I"))
{addError("Horizon d'investissement");}
if(g2_erros=="")
{CapitalDepart=putDbl(document.allocation2.CapitalDepart.value);if(((CapitalDepart>max_cel_PEA)&&(document.allocation2.Mariage.options[0].selected))||((CapitalDepart>max_mar_PEA)&&(document.allocation2.Mariage.options[1].selected)))
{userchoicePEA();}
else
{userchoice="withPEA"}
if((CapitalDepart>max_cel_PEA)&&(document.allocation2.Mariage.options[0].selected))
{document.getElementById("PEAValueText").innerHTML="<p>Lancer le calcul avec un capital de d&eacute;part de <br>"+max_cel_PEA+"&nbsp;&euro;, auquel cas vous pourrez comparer les 3 enveloppes.</p>";document.getElementById("PEASingle").style.display="";document.getElementById("help2-5").innerHTML="<span class=\"heading4black\">Calcul avec le PEA</span><br><span class=\"smallprompt\">Votre capital de d&eacute;part est r&eacute;duit &agrave; "+max_cel_PEA.toString()+"&nbsp;&euro; pour prendre en compte le PEA. <a href=\"javascript:showfullhelp(2, 5)\" class=\"calchelp\"><i>D&eacute;tail...</i></a></span><br><br>";}
else if((CapitalDepart>max_mar_PEA)&&(document.allocation2.Mariage.options[1].selected))
{document.getElementById("PEAValueText").innerHTML="<p>Lancer le calcul avec un capital de d&eacute;part de <br>"+max_mar_PEA+"&nbsp;&euro;, auquel cas vous pourrez comparer les 3 enveloppes.</p>";document.getElementById("PEASingle").style.display="";document.getElementById("help2-5").innerHTML="<span class=\"heading4black\">Calcul avec le PEA</span><br><span class=\"smallprompt\">Votre capital de d&eacute;part est r&eacute;duit &agrave; <script language=\"javascript\">document.write(max_mar_PEA)</script>&nbsp;&euro; pour prendre en compte le PEA. <a href=\"javascript:showfullhelp(2, 5)\" class=\"calchelp\"><i>D&eacute;tail...</i></a></span><br><br>";}
else
{document.getElementById("PEASingle").style.display="none";document.getElementById("help2-5").innerHTML="<span class=\"heading4black\">Calcul avec le PEA</span><br><span class=\"smallprompt\">Votre capital de d&eacute;part est r&eacute;duit pour prendre en compte le PEA. <a href=\"javascript:showfullhelp(2, 5)\" class=\"calchelp\"><i>D&eacute;tail...</i></a></span><br><br>";}}}
if(tmp_current==3)
{if(!checkInput(3,"RepartMon","P0"))
{addError("R\u00E9partition Mon\u00E9taire");}
if(!checkInput(3,"RepartAct","P0"))
{addError("R\u00E9partition Actions");}
if(!checkInput(3,"RepartObl","P0"))
{addError("R\u00E9partition Obligations");}
if(!checkInput(3,"RentMon","P0"))
{addError("Rentabilit\u00E9 Mon\u00E9taire");}
if(!checkInput(3,"RentAct","P0"))
{addError("Rentabilit\u00E9 Actions");}
if(!checkInput(3,"RentObl","P0"))
{addError("Rentabilit\u00E9 Obligations");}
if(!checkTotalRepart(3,"RepartTot"))
{addError("R\u00E9partition Total");}}
if(tmp_current==4)
{if(!checkInput(4,"TxRotCT","P0"))
{addError("Taux de rotation du portefeuille");}
if(!checkInput(4,"FraisCT","P"))
{addError("Taux de frais de transaction (Param\u00E8tres du compte titre)");}
if(userchoice=="withPEA")
{if(!checkInput(4,"TxRotPEA","P0"))
{addError("Taux de rotation");}
if(!checkInput(4,"FraisPEA","P"))
{addError("Taux de frais de transaction (Param\u00E8tres du PEA)");}}
if(!checkInput(4,"FraisAV","P"))
{addError("Taux de frais de gestion");}}
if(g2_erros!="")
return false;return true;}
function checkInput(formno,myInput,myType)
{var str,arg;var myInputName=myInput;var str=eval("document.allocation"+formno+"."+myInput+".value");if(str!="")
{arg=str;arg=arg.replace(/ /g,"");myInput=arg;if(IsNumeric(arg))
{switch(myType)
{case"N":if(parseFloat(myInput)>0)
{eval("val"+myInputName+"="+parseFloat(myInput));return true;}
else
{return false;}
break;case"I":if((str.indexOf(",")!=-1)||(str.indexOf(".")!=-1)||(str==0))
return false;else
{eval("val"+myInputName+"="+parseInt(myInput));return true;}
break;case"P0":myInput=myInput.replace(/,/g,".");if((parseFloat(myInput)>=0)&&(parseFloat(myInput)<=100))
{eval("val"+myInputName+"="+parseFloat(myInput));return true;}
else
return false;break;case"P":myInput=myInput.replace(/,/g,".");if((parseFloat(myInput)>0)&&(parseFloat(myInput)<=100))
{eval("val"+myInputName+"="+parseFloat(myInput));return true;}
else
{return false;}
break;}}
else
{return false;}}
else
{return false;}}
function checkTotalRepart(formno,myInput)
{var str=eval("document.allocation"+formno+"."+myInput+".value");str=str.replace(/ /g,"");str=str.replace(/,/g,".");if(IsNumeric(str))
{if(parseFloat(str)==100)
{return true;}
else
{return false;}}
else
{return false;}}
function IsNumeric(sText)
{var ValidChars="0123456789.,";var IsNumber=true;var Char;for(i=0;i<sText.length&&IsNumber==true;i++)
{Char=sText.charAt(i);if(ValidChars.indexOf(Char)==-1)
{IsNumber=false;}}
return IsNumber;}
function formatAndSum(myParam)
{var f=document.allocation3;if(myParam!=null)
{f.RepartTot.value=numToFloat(strToFloat(strToFloat(f.RepartMon.value)+strToFloat(f.RepartAct.value)+strToFloat(f.RepartObl.value)));f.RendTot.value=numToFloat((strToFloat(f.RepartMon.value)*strToFloat(f.RentMon.value)+strToFloat(f.RepartAct.value)*strToFloat(f.RentAct.value)+strToFloat(f.RepartObl.value)*strToFloat(f.RentObl.value))/100);if(strToFloat(f.elements[myParam].value)!=0){f.elements[myParam].value=numToFloat(strToFloat(f.elements[myParam].value));}}
else{f.RepartTot.value=numToFloat(strToFloat(strToFloat(f.RepartMon.value)+strToFloat(f.RepartAct.value)+strToFloat(f.RepartObl.value)));f.RendTot.value=numToFloat((strToFloat(f.RepartMon.value)*strToFloat(f.RentMon.value)+strToFloat(f.RepartAct.value)*strToFloat(f.RentAct.value)+strToFloat(f.RepartObl.value)*strToFloat(f.RentObl.value))/100);}}
function TypeGestion_onchange()
{var f=document.allocation3;if(f.TypeGestion.options[1].selected){f.RepartMon.value=numToFloat(strToFloat(repartmon_d));f.RepartAct.value=numToFloat(strToFloat(repartact_d));f.RepartObl.value=numToFloat(strToFloat(repartobl_d));}
else if(f.TypeGestion.options[3].selected){f.RepartMon.value=numToFloat(strToFloat(repartmon_a));f.RepartAct.value=numToFloat(strToFloat(repartact_a));f.RepartObl.value=numToFloat(strToFloat(repartobl_a));}
else if(f.TypeGestion.options[2].selected){f.RepartMon.value=numToFloat(strToFloat(repartmon_p));f.RepartAct.value=numToFloat(strToFloat(repartact_p));f.RepartObl.value=numToFloat(strToFloat(repartobl_p));}
else{f.RepartMon.value=numToFloat(strToFloat(repartmon_e));f.RepartAct.value=numToFloat(strToFloat(repartact_e));f.RepartObl.value=numToFloat(strToFloat(repartobl_e));}
formatAndSum();}
function start()
{loaded=true;if(run!=''){setTimeout(run,0);}}
start();function format(myParam){var f=document.allocation4;f.elements[myParam].value=numToFloat(strToFloat(f.elements[myParam].value));}
function replaceDot2Comma(param)
{if(param!="")
{str=param.replace(/ /g,"");strReplacedText=str.replace(/,/g,".");return parseFloat(strReplacedText);}
else
{return 0;}}
function putDbl(param)
{var strReplacedText;var str
var posP
var posV
var notspace;notspace=param.replace(/ /g,"");if(IsNumeric(notspace))
{posV=param.split(",");posP=param.split(".");if((posV.length==1)&&(posP.length!=1))
{if(posP.length>2)
{return-9999999999;}
else
{return replaceDot2Comma(param);}}
else if((posV.length!=1)&&(posP.length==1))
{if(posV.length>2)
{return-9999999999;}
else
{return replaceDot2Comma(param);}}
else if((posV.length!=1)&&(posP.length!=1))
{return-9999999999}
else
{return replaceDot2Comma(param)}}
else
{return-999999999;}}
function putLong(param)
{var notspace;notspace=param.replace(/ /g,"");if((param!="")&&(IsNumeric(notspace)))
{return parseFloat(param);}
else
{return 0;}}
function calculGestion()
{var Coef=0;var PortefDirect=new Array();var PVDirect=new Array();var PrixDirect=new Array();var ImpDirect=new Array();var FraisDirect=new Array();var NetDirect=new Array();var ImpDirectLiq=new Array();var FraisDirectLiq=new Array();var PortefAV=new Array();var PVAV=new Array();var FraisAV=new Array();var NetAV=new Array();var ImpAVLiq=new Array();var PortefPEA=new Array();var PVPEA=new Array();var FraisPEA=new Array();var NetPEA=new Array();var ImpPEALiq=new Array();var FraisPEALiq=new Array();CapitalDepart=putDbl(document.allocation2.CapitalDepart.value);valCapitalDepart=document.allocation2.CapitalDepart.value;Horizon=document.allocation2.Horizon.value;valHorizon=Horizon;N=putLong(Horizon)
var Rentabilite=new Array();Rentabilite[1]=putDbl(document.allocation3.RentMon.value)/100;Rentabilite[2]=putDbl(document.allocation3.RentAct.value)/100;Rentabilite[3]=putDbl(document.allocation3.RentObl.value)/100;var Repartition=new Array();Repartition[1]=putDbl(document.allocation3.RepartMon.value)/100;Repartition[2]=putDbl(document.allocation3.RepartAct.value)/100;Repartition[3]=putDbl(document.allocation3.RepartObl.value)/100;var Frais=new Array();Frais[1]=putDbl(document.allocation4.FraisCT.value)/100;if(userchoice=="withPEA")
{Frais[2]=putDbl(document.allocation4.FraisPEA.value)/100;}
Frais[3]=putDbl(document.allocation4.FraisAV.value)/100;TauxImp[1]=parseFloat(tx_imp_CT)/100;if(userchoice=="withPEA")
{TauxImp[2]=parseFloat(tx_imp2_PEA)/100;TauxImp[3]=parseFloat(tx_imp5_PEA)/100;TauxImp[4]=parseFloat(tx_impF_PEA)/100;}
else
{TauxImp[2]=0;TauxImp[3]=0;TauxImp[4]=0;}
TauxImp[5]=parseFloat(tx_imp4_AV)/100;TauxImp[6]=parseFloat(tx_imp8_AV)/100;TauxImp[7]=parseFloat(tx_impF_AV)/100;TauxImp[8]=parseFloat(tx_impA_AV)/100;var TauxRot=new Array();TauxRot[1]=putDbl(document.allocation4.TxRotCT.value)/100;if(userchoice=="withPEA")
{TauxRot[2]=putDbl(document.allocation4.TxRotPEA.value)/100;}
else
{TauxRot[2]=0;}
var AbbatementAV;AbbatementAV=abb_cel_AV;for(j=1;j<=3;j++)
{Coef=Coef+Repartition[j]*Rentabilite[j];}
NetDirect[0]=CapitalDepart;NetDirectLiq[0]=CapitalDepart;PrixDirect[0]=CapitalDepart;for(i=1;i<=N;i++)
{PortefDirect[i]=NetDirect[i-1]*(1+Coef);PVDirect[i]=NetDirect[i-1]*Coef;FraisDirect[i]=NetDirect[i-1]*(1+Coef)*TauxRot[1]*Frais[1];if(TauxRot[1]>0)
{if((NetDirect[i-1]*(1+Coef)-PrixDirect[i-1])*TauxRot[1]-FraisDirect[i]>=0)
{ImpDirect[i]=((NetDirect[i-1]*(1+Coef)-PrixDirect[i-1])*TauxRot[1]-FraisDirect[i])*TauxImp[1];}
else
{ImpDirect[i]=0;}
NetDirect[i]=NetDirect[i-1]*(1+Coef)-ImpDirect[i]-FraisDirect[i];PrixDirect[i]=PrixDirect[i-1]*(1-TauxRot[1])+NetDirect[i-1]*(1+Coef)*TauxRot[1]-FraisDirect[i]-ImpDirect[i];}
else
{ImpDirect[i]=0;NetDirect[i]=NetDirect[i-1]*(1+Coef)-ImpDirect[i]-FraisDirect[i];PrixDirect[i]=NetDirect[i];}
FraisDirectLiq[i]=NetDirect[i-1]*(1+Coef)*Frais[1];ImpDirectLiq[i]=(NetDirect[i-1]*(1+Coef)-PrixDirect[i-1]-FraisDirectLiq[i])*TauxImp[1];NetDirectLiq[i]=NetDirect[i-1]*(1+Coef)-FraisDirectLiq[i]-ImpDirectLiq[i];}
NetPEA[0]=CapitalDepart;NetPEALiq[0]=CapitalDepart;for(i=1;i<=N;i++)
{PortefPEA[i]=NetPEA[i-1]*(1+Coef);PVPEA[i]=NetPEA[i-1]*Coef;FraisPEA[i]=NetPEA[i-1]*(1+Coef)*TauxRot[2]*Frais[2];NetPEA[i]=NetPEA[i-1]*(1+Coef)-FraisPEA[i];FraisPEALiq[i]=NetPEA[i]*Frais[2];if(i<=2)
{ImpPEALiq[i]=(NetPEA[i]-NetPEA[0]-FraisPEALiq[i])*TauxImp[2];}
else if((i>2)&&(i<=5))
{ImpPEALiq[i]=(NetPEA[i]-NetPEA[0]-FraisPEALiq[i])*TauxImp[3];}
else if(i>5)
{ImpPEALiq[i]=(NetPEA[i]-NetPEA[0]-FraisPEALiq[i])*TauxImp[4];}
NetPEALiq[i]=NetPEA[i-1]*(1+Coef)-ImpPEALiq[i]-FraisPEALiq[i];}
NetAV[0]=CapitalDepart;NetAVLiq[0]=CapitalDepart;for(i=1;i<=N;i++)
{PortefAV[i]=NetAV[i-1]*(1+Coef);PVAV[i]=NetAV[i-1]*Coef;FraisAV[i]=NetAV[i-1]*(1+Coef)*Frais[3];NetAV[i]=NetAV[i-1]*(1+Coef)-FraisAV[i];if(i<=4)
{if((NetAV[i]-NetAV[0])*TauxImp[5]<0)
{ImpAVLiq[i]=0;}
else
{ImpAVLiq[i]=(NetAV[i]-NetAV[0])*TauxImp[5];}}
else if((i>4)&&(i<=8))
{if((NetAV[i]-NetAV[0])*TauxImp[6]<0)
{ImpAVLiq[i]=0;}
else
{ImpAVLiq[i]=(NetAV[i]-NetAV[0])*TauxImp[6];}}
else if(i>8)
{if((NetAV[i]-NetAV[0]-AbbatementAV)>0)
{ImpAVLiq[i]=(NetAV[i]-NetAV[0]-AbbatementAV)*(TauxImp[7]-TauxImp[8])+(NetAV[i]-NetAV[0])*TauxImp[8];}
else
{ImpAVLiq[i]=(NetAV[i]-NetAV[0])*TauxImp[8];}}
NetAVLiq[i]=NetAV[i-1]*(1+Coef)-ImpAVLiq[i];}
calcul_ok=true;}
function DisplayResults()
{var strResults="";if(calcul_ok)
{strResults=strResults+"<table width=\"100%\" border=\"0\" cellpadding=0 cellspacing=0 >";strResults=strResults+"<tr height=28>";strResults=strResults+"<td width=2>&nbsp;</td>";strResults=strResults+"<td class=\"smallprompt\">Capital de d&eacute;part</td>";strResults=strResults+"<td class=\"smallprompt\" align=\"right\">"+putValue(valCapitalDepart,0)+"&nbsp;&euro;</td>";strResults=strResults+"<td class=\"smallprompt\"></td>";strResults=strResults+"<td width=2>&nbsp;</td>";strResults=strResults+"</tr>";strResults=strResults+"<tr height=28>";strResults=strResults+"<td width=2>&nbsp;</td>";strResults=strResults+"<td class=\"smallprompt\">Horizon d'investissement</td>";strResults=strResults+"<td class=\"smallprompt\" align=\"right\">"+putValue(valHorizon,0)+"&nbsp;ans</td>";strResults=strResults+"<td width=2>&nbsp;</td>";strResults=strResults+"</tr>";strResults=strResults+"<tr height=28>";strResults=strResults+"<td width=2>&nbsp;</td>";strResults=strResults+"<td class=\"heading4black\">Valeur du compte titre &agrave; terme</td>";strResults=strResults+"<td class=\"heading4black\" align=\"right\">"+putResult(NetDirectLiq[N])+"&nbsp;&euro;</td>";strResults=strResults+"<td width=2>&nbsp;</td>";strResults=strResults+"</tr>";strResults=strResults+"<tr height=28>";strResults=strResults+"<td width=2>&nbsp;</td>";strResults=strResults+"<td class=\"heading4black\">Valeur de l'assurance vie &agrave; terme</td>";strResults=strResults+"<td class=\"heading4black\" align=\"right\">"+putResult(NetAVLiq[N])+"&nbsp;&euro;</td>";strResults=strResults+"<td width=2>&nbsp;</td>";strResults=strResults+"</tr>";if(userchoice=="withPEA")
{strResults=strResults+"<tr height=28>";strResults=strResults+"<td width=2>&nbsp;</td>";strResults=strResults+"<td class=\"heading4black\">Valeur du PEA &agrave; terme</td>";strResults=strResults+"<td class=\"heading4black\" align=\"right\">"+putResult(NetPEALiq[N])+"&nbsp;&euro;</td>";strResults=strResults+"<td width=2>&nbsp;</td>";strResults=strResults+"</tr>";}
strResults=strResults+"<tr height=28>";strResults=strResults+"<td width=2>&nbsp;</td>";strResults=strResults+"<td colspan=2 class='smallprompt'>Ces valeurs sont nettes d'imp&ocirc;ts.</td>";strResults=strResults+"<td width=2>&nbsp;</td>";strResults=strResults+"</tr>";strResults=strResults+"</table>";}
document.getElementById("divResults").innerHTML=strResults;}
function addGraph(osX,osY){var buffer=new String();var values=new Array();values[0]=new Array();values[1]=new Array();var nams=new Array();if(userchoice=="withPEA")
{values[2]=new Array();}
for(i=0;i<=N;i++)
{if(calcul_ok)
{values[0][i]=NetDirectLiq[i];values[1][i]=NetAVLiq[i];if(userchoice=="withPEA")
{values[2][i]=NetPEALiq[i];}}
else
{values[0][i]=0;}}
nams[0]="Compte titre";nams[1]="Assurance vie";if(userchoice=="withPEA")
{nams[2]="PEA";}
var os=navigator.userAgent;var browserName=navigator.appName;if(browserName=="Netscape"||os.indexOf("WIN95")!=-1||os.indexOf("Windows 95")!=-1)
{}
else
{if(userchoice=="withPEA")
{buffer=myVMLDrawGraph(250,150,values,nams,"AV,PEA",osX,osY);}
else
{buffer=myVMLDrawGraph(250,150,values,nams,"AV",osX,osY);}
return buffer;}}
function GetBodyOffsetsRelative(strElementName)
{var obj=document.getElementById(strElementName);while(obj.offsetParent)
{if(obj==document.getElementsByTagName('body')[0])
{break;}
else
{osX=osX+obj.offsetParent.offsetLeft;osY=osY+obj.offsetParent.offsetTop;obj=obj.offsetParent;}}}
function DisplayGraph()
{var strGraph="";var strTemp="";osX=0;osY=0;GetBodyOffsetsRelative("divGraph");strGraph=strGraph+"<table width='100%' celpadding=1 cellspacing=1 border=0>";intGraphHeight=220;if((navigator.appName.indexOf("Netscape")!=-1)||(is_opera))
{strGraph=strGraph+"<tr><td align=center id='graphe'>";strGraph=strGraph+"</td>";strGraph=strGraph+"</tr>";}
else
{strTemp=addGraph(osX,osY);strGraph=strGraph+"<tr><td align=center id='graphe' height='"+intGraphHeight+"'>";strGraph=strGraph+strTemp;strGraph=strGraph+"</td>";strGraph=strGraph+"</tr>";strGraph=strGraph+"<tr><td class='smallprompt'><p>Les pointill&eacute;s sur le graphe servent &agrave; mettre en avant l'impact qu'a la variation du taux d'imposition dans le temps, sur la valeur des enveloppes.</p></td></tr>";}
strGraph=strGraph+"<tr>";strGraph=strGraph+"<td>";strGraph=strGraph+"<table align='center' border='0' cellpadding='1' cellSpacing='1' class=smallprompt>";strGraph=strGraph+"<tr>";strGraph=strGraph+"<td>&nbsp;</td>          ";strGraph=strGraph+"<td align=right><font color='green'>Compte titre</font></td>";strGraph=strGraph+"<td>&nbsp;&nbsp;</td>          ";strGraph=strGraph+"<td align=right><font color='blue'>Assurance vie</font></td>";strGraph=strGraph+"<td>&nbsp;&nbsp;</td>          ";if(userchoice=="withPEA")
{strGraph=strGraph+"<td align=right><font color='red'>PEA</font></td>";}
strGraph=strGraph+"</tr>";for(j=0;j<=N;j++)
{strGraph=strGraph+"<tr>";strGraph=strGraph+"<td align='right'>"+j+"</td>";strGraph=strGraph+"<td align='right'>";strGraph=strGraph+"<font color='green'>";strGraph=strGraph+putResult(NetDirectLiq[j]);strGraph=strGraph+"</font>";strGraph=strGraph+"&nbsp;&euro;</td>";strGraph=strGraph+"<td>&nbsp;</td>";strGraph=strGraph+"<td align='right'>";strGraph=strGraph+"<font color='blue'>";strGraph=strGraph+putResult(NetAVLiq[j]);strGraph=strGraph+"</font>";strGraph=strGraph+"&nbsp;&euro;</td>";strGraph=strGraph+"<td>&nbsp;</td>";if(userchoice=="withPEA")
{strGraph=strGraph+"<td align='right'>";strGraph=strGraph+"<font color='red'>";strGraph=strGraph+putResult(NetPEALiq[j]);strGraph=strGraph+"</font>";strGraph=strGraph+"&nbsp;&euro;</td>";}
strGraph=strGraph+"</tr>";}
strGraph=strGraph+"</table>";strGraph=strGraph+"</td> ";strGraph=strGraph+"</tr>";strGraph=strGraph+"<tr><td><br><p><font size=1>Les valeurs du tableau ci-dessus sont nettes d'imp&ocirc;ts.</font></p></td></tr>";strGraph=strGraph+"</table>";document.getElementById("divGraph").innerHTML=strGraph;}