		function formatCurrency(num) {
			num = num.toString().replace(/\$|\,/g,'');
			if(isNaN(num))
			num = "0";
			sign = (num == (num = Math.abs(num)));
			num = Math.floor(num*100+0.50000000001);
			cents = num%100;
			num = Math.floor(num/100).toString();
			if(cents<10)
			cents = "0" + cents;
			for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
			num = num.substring(0,num.length-(4*i+3))+','+
			num.substring(num.length-(4*i+3));
			return (((sign)?'':'-') + num + '.' + cents);
		}
		function count(){
			var count=3500000;
			if(document.getElementById('np').checked){
				count=count+1500000;
			}
			if(document.getElementById('fd').checked){
				count=count+1500000;
			}
			if(document.getElementById('ft').checked){
				count=count+1000000;
			}
			if(document.getElementById('gf').checked){
				count=count+1000000;
			}
			if(document.getElementById('jh').value!=""){
				var temp=Math.round(document.getElementById('jh').value)*1000000;
				count=count+temp;
			}
			if(document.getElementById('fl').checked){
				var temp2=Math.round(document.getElementById('st').value)*10/100;
				count=count+temp2;
			}
			document.getElementById('st').value= count;
			document.getElementById('st2').value= formatCurrency(count);

		}
		function up(){
			document.getElementById('jh').value=Math.round(document.getElementById('jh').value)+1;
			count();
		}
		function down(){
			if(Math.round(document.getElementById('jh').value)>0){
				document.getElementById('jh').value=Math.round(document.getElementById('jh').value)-1;
				count();
			}
			
			
		}
		/*
		var undo;
		function setundo(){
			undo=Math.round(document.getElementById('st').value);
		}

		function getundo(){
			document.getElementById('st').value=undo;
		}
		function count1(id,val){
			if(document.getElementById(id).checked){
				document.getElementById('st').value=Math.round(document.getElementById('st').value)+Math.round(val);
				setundo();
			}
			else{
				document.getElementById('st').value=Math.round(document.getElementById('st').value)-Math.round(val);
				setundo();
			}
		}

		function count2(){
			var disc=Math.round(document.getElementById('st').value)*10/100;
			if(document.getElementById('fl').checked){
				setundo();
				document.getElementById('st').value=Math.round(document.getElementById('st').value)+disc;				
			}
			else{
				getundo();

			}
		}

		function count3(val){
			if(document.getElementById('jh').value!=""){
				var c=val*1000000;
				document.getElementById('st').value=Math.round(document.getElementById('st').value)+c;
			}
			else{
				getundo();
			}
		}*/
