var costOfAf=0;var costOfIraq=0;var costOfTotal=0;var geographicscale=1;function calculateIraq(){var d=682800000000;var c=64534659050;var a=new Date("Oct 01, 2009");var g=new Date("Oct 01, 2010");var h=g-a;var e=c/h;var b=new Date();var f=b-a;costOfIraq=(d+(f*e))*geographicscale}function calculateAf(){var d=226700000000;var c=72290717450;var a=new Date("Oct 01, 2009");var g=new Date("Oct 01, 2010");var h=g-a;var e=c/h;var b=new Date();var f=b-a;costOfAf=(d+(f*e))*geographicscale}function updateCostOfAf(a){calculateAf();costOfWarAf_Total.innerHTML="$"+number_str(costOfAf);setTimeout("updateCostOfAf("+a+");",a)}function updateCostOfIraq(a){calculateIraq();costOfWarIraq_Total.innerHTML="$"+number_str(costOfIraq);setTimeout("updateCostOfIraq("+a+");",a)}function updateCostOfTotal(a){calculateAf();calculateIraq();costOfTotal=(costOfAf+costOfIraq);costOfWarTotal_Total.innerHTML="$"+number_str(costOfTotal);setTimeout("updateCostOfTotal("+a+");",a)}function initCostOfIraq(){var c=document.getElementById("costOfWarIraq");var b=document.createElement("div");b.setAttribute("id","costOfWarIraq_Title");costOfWarIraq_Total=document.createElement("div");costOfWarIraq_Total.setAttribute("id","costOfWarIraq_Total");var a=document.createElement("div");a.setAttribute("id","costOfWarIraq_Link");c.appendChild(b);c.appendChild(costOfWarIraq_Total);c.appendChild(a);b.innerHTML="Cost of War in Iraq";a.innerHTML='See the cost to your community at <a href="http://www.costofwar.com" title="CostOfWar.com brought to you by National Priorities Project" target="_blank">www.costofwar.com</a>'}function initCostOfAf(){var b=document.getElementById("costOfWarAf");var c=document.createElement("div");c.setAttribute("id","costOfWarAf_Title");costOfWarAf_Total=document.createElement("div");costOfWarAf_Total.setAttribute("id","costOfWarAf_Total");var a=document.createElement("div");a.setAttribute("id","costOfWarAf_Link");b.appendChild(c);b.appendChild(costOfWarAf_Total);b.appendChild(a);c.innerHTML="Cost of War in Afghanistan";a.innerHTML='See the cost to your community at <a href="http://www.costofwar.com" title="CostOfWar.com brought to you by National Priorities Project" target="_blank">www.costofwar.com</a>'}function initCostOfTotal(){var a=document.getElementById("costOfWarTotal");var c=document.createElement("div");c.setAttribute("id","costOfWarTotal_Title");costOfWarTotal_Total=document.createElement("div");costOfWarTotal_Total.setAttribute("id","costOfWarTotal_Total");var b=document.createElement("div");b.setAttribute("id","costOfWarTotal_Link");a.appendChild(c);a.appendChild(costOfWarTotal_Total);a.appendChild(b);c.innerHTML="Cost of U.S. Wars Since 2001";b.innerHTML='See the cost to your community at <a href="http://www.costofwar.com" title="CostOfWar.com brought to you by National Priorities Project" target="_blank">www.costofwar.com</a>'}function number_str(e){var a=e.toString();var c=a.lastIndexOf(".");a=a.substr(0,c);var b=a.length;var d="";for(b-=3;b>0;b-=3){d=","+a.substr(b,3)+d}d=a.substr(0,b+3)+d;return d}function inc_totals_at_rate(b){calculateIraq();var a=document.getElementById("raw");a.id="costOfIraq";setTimeout("updateIraq("+b+");",b)}function inc_totals(){inc_totals_at_rate(100)};