function keisanc(){
    this.myreturn = "<br />";//unescape("%0D%0A");
    this.haiki = "";
    this.c_zei = "";
    this.zibaiseki = "";
    this.ton = "";//車重
    this.z_zei = "";//重量税
    this.hiyou = "";//購入費用
    this.s_zei = "";//自動車取得税
    this.c_zei_name = "";
    this.s_zei_name = "";
    this.s_zei = "";
    this.km = "";
    this.nenpi = "";
    this.gasprice = "";
    this.gat_s_zei = "";
    this.gas =  "";
    this.gas_zei =  "";
    this.gas_s_zei_all =  "";
    this.hoken= "";//保険
    this.chusha= "";//駐車
    this.syaken= "";//車検
    this.kaikae="";//買い替え年
    this.total_zei="";
     this.s_zei_nen="";
    this.hiyou_nen = "";
    this.total = "";
    this.kekka="";
    this.msg="";
    this.msg2="";
    this.msg3="";
    this.test = function(){
        confirm(this.total_zei);  
    }
    this.car_calc = function(){
		if(this.kaikae==0){
			this.kaikae=1;
		}
        if(this.haiki == 0){
            this.zibaiseki = 9490*1;
         }else{
            this.zibaiseki = 11235*1;
        }
        if(this.haiki == 0 || this.ton == 0){
            this.c_zei_name = "軽自動車税/年";
            this.s_zei_name = "自動車取得税/年（軽自動車3%）";
            this.s_zei = this.hiyou*0.03;
         }else{
            this.c_zei_name = "自動車税/年";
            this.s_zei_name = "自動車取得税/年（自動車5%）";
            this.s_zei = this.hiyou*0.05;
        }
        this.gat_s_zei = this.gasprice - Math.round(this.gasprice / 1.05);
        this.gas = Math.round(this.km/this.nenpi*this.gasprice);
        this.gas_zei = Math.round(this.km/this.nenpi*28.7);
        this.gas_s_zei_all = Math.round(this.km/this.nenpi*this.gat_s_zei);
        this.syaken = this.syaken/2;
        this.syaken = this.syaken - this.z_zei - this.zibaiseki;
        this.s_zei_nen = Math.round(this.s_zei/this.kaikae);//自動車取得税
        this.total_zei = eval(this.c_zei);//自動車税
        this.total_zei = this.total_zei+eval(this.zibaiseki);//自動車税
        this.total_zei = this.total_zei+eval(this.z_zei);//重量税
        this.total_zei = this.total_zei+this.s_zei_nen;//重量税
        this.total_zei = this.total_zei+eval(this.gas_zei);//ガソリン税
        this.total_zei = this.total_zei+eval(this.gas_s_zei_all);//ガソリン税の消費税
        this.hiyou_nen = Math.round(this.hiyou/this.kaikae);
        this.total = this.hiyou_nen;
        this.total = this.total+eval(this.c_zei);
        this.total = this.total+eval(this.zibaiseki);
       this.total = this.total+eval(this.z_zei);
        this.total = this.total+eval(this.s_zei_nen);
        this.total = this.total+eval(this.gas);
        this.total = this.total+eval(this.syaken);
        this.total = this.total+eval(this.hoken);
        this.total = this.total+eval(this.chusha);
    }
    this.car_result = function(){
        this.kekka ="";
        this.kekka = this.kekka + "購入費用/年（購入費/買替年）："+this.hiyou_nen+"円" + this.myreturn;//☆結果購入費用/年
        this.kekka = this.kekka + this.c_zei_name + "："+this.c_zei+"円" + this.myreturn;//☆結果自動車税//軽自動車税
        this.kekka = this.kekka + "自賠責保険/年："+this.zibaiseki+"円"+ this.myreturn;//☆結果自賠責
        this.kekka = this.kekka + "重量税/年："+this.z_zei+"円"+ this.myreturn;//☆結果重量税
        this.kekka = this.kekka + "ガソリン代/年　燃費"+this.nenpi+"km/lで計算："+this.gas+"円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "ガソリン税/年　燃費"+this.nenpi+"km/lで計算："+this.gas_zei+"円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "ガソリン代とガソリン税にかかる消費税/年　燃費"+this.nenpi+"km/lで計算："+this.gas_s_zei_all+"円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + this.s_zei_name + "："+this.zibaiseki+"円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "任意保険/年："+this.hoken+"円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "駐車場代/年："+this.chusha+"円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "車検代（1年・保険税抜き）："+this.syaken+"円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "————————————————————"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "維持費/月："+Math.round(this.total/12)+"円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "税/月　※自賠責は税金として計算："+Math.round(this.total_zei/12)+"円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "維持費/年："+Math.round(this.total/1000)/10+"万円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "税/年　※自賠責は税金として計算："+Math.round(this.total_zei/1000)/10+"万円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "維持費/10年で："+Math.round(this.total*10/1000)/10+"万円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "税/10年で　※自賠責は税金として計算："+Math.round(this.total_zei*10/1000)/10+"万円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "維持費/生涯（50年で）："+Math.round(this.total*50/1000)/10+"万円"+ this.myreturn;//☆結果
        this.kekka = this.kekka + "税/生涯（50年で）　※自賠責は税金として計算："+Math.round(this.total_zei*50/1000)/10+"万円"+ this.myreturn;//☆結果
    }
    this.car_msg = function(){
        this.msg = "";
        this.msg = "あなたは生涯、車に"+Math.round(this.total*50/1000)/10+"万円使い";
        this.msg = this.msg+Math.round(this.total_zei*50/1000)/10+"万円の税金を払います。";
        if(this.total<300000){
                this.msg2 = "本当に車が必要ですか？";
        }else if(this.total<450000){
                this.msg2 = "毎年海外旅行ができますね。";
        }else if(this.total<600000){
                this.msg2 = "マンションが買えますね。";
        }else if(this.total<750000){
                this.msg2 = "家が買えますね。";
        }else{
                this.msg2 = "大豪邸が買えるのでは？";
        }
	if(this.total_zei/this.total < 0.1){
	         this.msg3 = "維持費の中でも車代、駐車場代、保険代などが高すぎるようです。";
	}else if(this.total_zei/this.total > 0.3){
	         this.msg3 = "あなたの自動車維持費の30%以上が税金です。";
	}else{
	         this.msg3 = "あなたの自動車維持費の"+Math.round(this.total_zei/this.total*100)+"%が税金です。";
	}
        this.msg = this.msg+this.msg2+this.msg3;
    }
}

function petit_keisanc(){
    this.kekka = "";
    this.myreturn = "<br />¥r¥n";//unescape("%0D%0A");
	this.syasyu;
	this.kihonA=2980;
	this.kihonB=1050;
	this.tankaA=0;
	this.tankaB=0;
	this.tankaKmAB=0;
	this.dailyA=0;
	this.dailyB=0;
	this.totalhourA=0;
	this.totalhourB=0;
	this.totalKm=0;//ほかで使用する
	this.totalkyoriA=0;
	this.totalkyoriB=0;
	this.taxi01=0;
	this.taxi02=0;
	this.taxi03=0;
	this.hour=new Array(7);
	this.kyori=new Array(7);
	this.hindo_o=new Array(7);
	this.hour_o=new Array(7);
	this.kyori_o=new Array(7);
	
    this.total = "";
    this.msg="";
    this.car_init = function(){
		this.totalhourA=0;
		this.totalhourB=0;
		this.totalkyoriA=0;
		this.totalkyoriB=0;
		this.taxi01=0;
		this.taxi02=0;
		this.taxi03=0;
		this.totalKm=0;//ほかで使用する
    }
    this.car_calc = function(){
		if(this.syasyu == "SK"){
			this.tankaA=160;
			this.tankaB=260;
			this.tankaKmAB=14;
			this.dailyA=4980;
			this.dailyB=6980;
		}else{
			this.tankaA=190;
			this.tankaB=310;
			this.tankaKmAB=15;
			this.dailyA=5980;
			this.dailyB=7980;
		}
		//毎週の事
		for(N=1;N<8;N++){
			this.totalkyoriA=this.totalkyoriA+(this.kyori[N]*this.tankaKmAB);
			this.totalkyoriB=this.totalkyoriB+(this.kyori[N]*this.tankaKmAB);
			this.totalKm=this.totalKm+this.kyori[N]*1;//ほかで使用する
			if(this.hour[N] == 480){
				//alert(this.dailyA);
				this.totalhourA=this.totalhourA+this.dailyA;
				this.totalhourB=this.totalhourB+this.dailyB;
			}else{
				this.totalhourA=this.totalhourA+this.tankaA*(this.hour[N]/15);
				this.totalhourB=this.totalhourB+this.tankaB*(this.hour[N]/15);
			}
			if(this.hour[N] > 0){
				this.taxi01=this.taxi01+1200;
				this.taxi02=this.taxi02+2000;
				this.taxi03=this.taxi03+3000;
			}
		}
		this.totalkyoriA=this.totalkyoriA*52;
		this.totalkyoriB=this.totalkyoriB*52;
		this.totalhourA=this.totalhourA*52;
		this.totalhourB=this.totalhourB*52;
		this.taxi01=this.taxi01*52;
		this.taxi02=this.taxi02*52;
		this.taxi03=this.taxi03*52;
		this.totalKm=this.totalKm*52;//ほかで使用する
		//オプション
		for(N=1;N<8;N++){
			this.totalkyoriA=this.totalkyoriA+(this.kyori_o[N]*this.tankaKmAB*this.hindo_o[N]);
			this.totalkyoriB=this.totalkyoriB+(this.kyori_o[N]*this.tankaKmAB*this.hindo_o[N]);
			this.totalKm=this.totalKm+(this.kyori_o[N]*this.hindo_o[N]);
			this.taxi01=this.taxi01+1200*this.hindo_o[N];
			this.taxi02=this.taxi02+2000*this.hindo_o[N];
			this.taxi03=this.taxi03+3000*this.hindo_o[N];
			if(this.hour[N] == 480){
				this.totalhourA=this.totalhourA+(this.dailyA*this.hindo_o[N]);
				this.totalhourB=this.totalhourB+(this.dailyB*this.hindo_o[N]);
			}else{
				this.totalhourA=this.totalhourA+(this.tankaA*(this.hour_o[N]/15)*this.hindo_o[N]);
				this.totalhourB=this.totalhourB+(this.tankaB*(this.hour_o[N]/15)*this.hindo_o[N]);
			}
		}
		//alert(this.totalkyoriA);
    }
    this.car_result = function(){
        this.kekka ="";
    }
    this.car_msg = function(){
        this.msg = "";
	}
}

function keisan(flg){
    mykeisanc = new keisanc();
	if(flg == 1){
    	mykeisanc.haiki = document.form1.haiki.value;
    	mykeisanc.c_zei= document.form1.c_zei.value;
    	mykeisanc.ton = document.form1.ton.value;
    	mykeisanc.z_zei= document.form1.z_zei.value;
	}else{
    	obj = document.form1.syasyu;
    	mykeisanc.haiki = obj.selectedIndex;
    	mykeisanc.c_zei=obj.options[obj.selectedIndex].value;
    	obj = document.form1.ton;
    	mykeisanc.ton = obj.selectedIndex
    	mykeisanc.z_zei=obj.options[mykeisanc.ton].value;
	}
    obj = document.form1.hiyou;
    mykeisanc.hiyou=obj.options[obj.selectedIndex].value;
    obj = document.form1.km;
    mykeisanc.km=obj.options[obj.selectedIndex].value;
    obj = document.form1.nenpi;
    mykeisanc.nenpi =obj.options[obj.selectedIndex].value;
    obj = document.form1.gasprice;
    mykeisanc.gasprice =obj.options[obj.selectedIndex].value;
    obj = document.form1.hoken;
    mykeisanc.hoken=obj.options[obj.selectedIndex].value;//保険
    mykeisanc.hoken = mykeisanc.hoken*12;
    obj = document.form1.chusha;
    mykeisanc.chusha=obj.options[obj.selectedIndex].value;//駐車
    mykeisanc.chusha = mykeisanc.chusha*12;
    obj = document.form1.syaken;
    mykeisanc.syaken=obj.options[obj.selectedIndex].value;//車検
    obj = document.form1.kaikae;
    mykeisanc.kaikae=obj.options[obj.selectedIndex].value;
    mykeisanc.car_calc();
    mykeisanc.car_result();
    mykeisanc.car_msg();
    
    document.getElementById("izi1").innerHTML = Math.round(mykeisanc.total/12)+"円";
    document.getElementById("izi_zei1").innerHTML = Math.round(mykeisanc.total_zei/12)+"円";
    document.getElementById("izi12").innerHTML = Math.round(mykeisanc.total/1000)/10+"万円";
    document.getElementById("izi_zei12").innerHTML = Math.round(mykeisanc.total_zei/1000)/10+"万円";
    document.getElementById("izi120").innerHTML = Math.round(mykeisanc.total*10/1000)/10+"万円";
    document.getElementById("izi_zei120").innerHTML = Math.round(mykeisanc.total_zei*10/1000)/10+"万円";
    document.getElementById("izi600").innerHTML = Math.round(mykeisanc.total*50/1000)/10+"万円";
    document.getElementById("izi_zei600").innerHTML = Math.round(mykeisanc.total_zei*50/1000)/10+"万円";
    
    document.getElementById("c_zei").innerHTML = mykeisanc.c_zei+"円";//自動車税//軽自動車税
    document.getElementById("c_zei_name").innerHTML = mykeisanc.c_zei_name;
    document.getElementById("zibaiseki").innerHTML = mykeisanc.zibaiseki+"円";//自賠責
    document.getElementById("hiyou_nen").innerHTML = mykeisanc.hiyou_nen+"円";//購入費用/年
    document.getElementById("z_zei").innerHTML = mykeisanc.z_zei+"円";
    document.getElementById("gas_mei").innerHTML = "ガソリン代/年　燃費"+mykeisanc.nenpi+"km/lで計算";
    document.getElementById("gas_zei_mei").innerHTML = "ガソリン税/年　燃費"+mykeisanc.nenpi+"km/lで計算";
    document.getElementById("gas").innerHTML = mykeisanc.gas+"円";
    document.getElementById("gas_zei").innerHTML = mykeisanc.gas_zei+"円";
    document.getElementById("gas_s_zei_all").innerHTML = mykeisanc.gas_s_zei_all+"円";
    document.getElementById("s_zei_name").innerHTML = mykeisanc.s_zei_name;
    document.getElementById("s_zei").innerHTML = mykeisanc.s_zei_nen+"円";
    document.getElementById("syaken_v").innerHTML = mykeisanc.syaken+"円";//車検/年
    
    document.form1.msgfield.value = mykeisanc.msg;
    document.getElementById("kekka").innerHTML = mykeisanc.kekka;
}



function keisan_lite(viewflg,flg){
    mykeisanc = new keisanc();
	if(flg == 1){
        mykeisanc.haiki = document.form1.haiki.value;
        mykeisanc.ton = document.form1.ton.value;
        mykeisanc.z_zei=document.form1.z_zei.value;
        mykeisanc.c_zei=document.form1.c_zei.value;
        mykeisanc.hiyou=document.form1.hiyou.value;
        mykeisanc.nenpi=document.form1.nenpi.value;
        mykeisanc.syaken=document.form1.syaken.value;
	}else{
    obj = document.form1.syasyu;
    var syasyu = obj.selectedIndex;
    if(syasyu == 0){
        //軽
        mykeisanc.haiki = 0;
        mykeisanc.ton = 0;
        mykeisanc.z_zei=2500;
        mykeisanc.c_zei=7200;
        mykeisanc.hiyou=1500000;
        mykeisanc.nenpi=18;
        mykeisanc.syaken=76200;//車検
    }else if(syasyu == 1){
        //マーチ
        mykeisanc.haiki = 2;
        mykeisanc.ton = 1;
        mykeisanc.z_zei=5000;
        mykeisanc.c_zei=34500;
        mykeisanc.hiyou=1500000;
        mykeisanc.nenpi=12;
        mykeisanc.syaken=117200;//車検
    }else if(syasyu == 2){
        //サニー
        mykeisanc.haiki = 3;
        mykeisanc.ton = 2;
        mykeisanc.z_zei=7500;
        mykeisanc.c_zei=34500;
        mykeisanc.hiyou=1800000;
        mykeisanc.nenpi=10;
        mykeisanc.syaken=117200;//車検
    }else if(syasyu == 3){
        //ステップ
        mykeisanc.haiki = 3;
        mykeisanc.ton = 3;
        mykeisanc.z_zei=10000;
        mykeisanc.c_zei=39500;
        mykeisanc.hiyou=2400000;
        mykeisanc.nenpi=7;
        mykeisanc.syaken=122000;//車検
    }else if(syasyu == 4){
        //VOXY
        mykeisanc.haiki = 5;
        mykeisanc.ton = 3;
        mykeisanc.z_zei=10000;
        mykeisanc.c_zei=51000;
        mykeisanc.hiyou=2700000;
        mykeisanc.nenpi=5;
        mykeisanc.syaken=134400;//車検
    }
    obj = document.form1.hiyou;
    if(obj.selectedIndex == 0){
        mykeisanc.hiyou=0;
    }else if(obj.selectedIndex == 1){
    }else if(obj.selectedIndex == 2){
        mykeisanc.hiyou=Math.round(mykeisanc.hiyou*0.8);
    }else if(obj.selectedIndex == 3){
        mykeisanc.hiyou=Math.round(mykeisanc.hiyou*0.6);
    }else if(obj.selectedIndex == 4){
        mykeisanc.hiyou=Math.round(mykeisanc.hiyou*0.4);
    }
    }
    obj = document.form1.km;
    mykeisanc.km=obj.options[obj.selectedIndex].value;//距離
    mykeisanc.gasprice =100;
    obj = document.form1.hoken;
    mykeisanc.hoken=obj.options[obj.selectedIndex].value;//保険
    mykeisanc.hoken = mykeisanc.hoken*12;
    obj = document.form1.chusha;
    mykeisanc.chusha=obj.options[obj.selectedIndex].value;//駐車
    mykeisanc.chusha = mykeisanc.chusha*12;
    obj = document.form1.kaikae;
    mykeisanc.kaikae=obj.options[obj.selectedIndex].value;
    mykeisanc.car_calc();
    mykeisanc.car_result();
    mykeisanc.car_msg();
    
    document.getElementById("izi1").innerHTML = Math.round(mykeisanc.total/12)+"円";
    document.getElementById("izi_zei1").innerHTML = Math.round(mykeisanc.total_zei/12)+"円";
    document.getElementById("izi12").innerHTML = Math.round(mykeisanc.total/1000)/10+"万円";
    document.getElementById("izi_zei12").innerHTML = Math.round(mykeisanc.total_zei/1000)/10+"万円";
    document.getElementById("izi120").innerHTML = Math.round(mykeisanc.total*10/1000)/10+"万円";
    document.getElementById("izi_zei120").innerHTML = Math.round(mykeisanc.total_zei*10/1000)/10+"万円";
    document.getElementById("izi600").innerHTML = Math.round(mykeisanc.total*50/1000)/10+"万円";
    document.getElementById("izi_zei600").innerHTML = Math.round(mykeisanc.total_zei*50/1000)/10+"万円";
    
    document.getElementById("c_zei").innerHTML = mykeisanc.c_zei+"円";//自動車税//軽自動車税
    document.getElementById("c_zei_name").innerHTML = mykeisanc.c_zei_name;
    document.getElementById("zibaiseki").innerHTML = mykeisanc.zibaiseki+"円";//自賠責
    document.getElementById("hiyou_nen").innerHTML = mykeisanc.hiyou_nen+"円";//購入費用/年
    document.getElementById("z_zei").innerHTML = mykeisanc.z_zei+"円";
    document.getElementById("gas_mei").innerHTML = "ガソリン代/年　燃費"+mykeisanc.nenpi+"km/lで計算";
    document.getElementById("gas_zei_mei").innerHTML = "ガソリン税/年　燃費"+mykeisanc.nenpi+"km/lで計算";
    document.getElementById("gas").innerHTML = mykeisanc.gas+"円";
    document.getElementById("gas_zei").innerHTML = mykeisanc.gas_zei+"円";
    document.getElementById("gas_s_zei_all").innerHTML = mykeisanc.gas_s_zei_all+"円";
    document.getElementById("s_zei_name").innerHTML = mykeisanc.s_zei_name;
    document.getElementById("s_zei").innerHTML = mykeisanc.s_zei_nen+"円";
    document.getElementById("syaken_v").innerHTML = mykeisanc.syaken+"円";//車検/年
    
    document.form1.msgfield.value = mykeisanc.msg;
    document.getElementById("kekka").innerHTML = mykeisanc.kekka;
}

function petit_keisan(){
	//ここからカーシェアリング計算
	p_keisanc = new petit_keisanc();
	p_keisanc.car_init();
    obj = document.form1.syasyu;
    p_keisanc.syasyu=obj.options[obj.selectedIndex].value;
    obj = document.form1.week01a;
    p_keisanc.hour[1]=obj.options[obj.selectedIndex].value;
    obj = document.form1.week02a;
    p_keisanc.hour[2]=obj.options[obj.selectedIndex].value;
    obj = document.form1.week03a;
    p_keisanc.hour[3]=obj.options[obj.selectedIndex].value;
    obj = document.form1.week04a;
    p_keisanc.hour[4]=obj.options[obj.selectedIndex].value;
    obj = document.form1.week05a;
    p_keisanc.hour[5]=obj.options[obj.selectedIndex].value;
    obj = document.form1.week06a;
    p_keisanc.hour[6]=obj.options[obj.selectedIndex].value;
    obj = document.form1.week07a;
    p_keisanc.hour[7]=obj.options[obj.selectedIndex].value;
	
    obj = document.form1.week01b;
    p_keisanc.kyori[1]=obj.options[obj.selectedIndex].value;
    obj = document.form1.week02b;
    p_keisanc.kyori[2]=obj.options[obj.selectedIndex].value;
    obj = document.form1.week03b;
    p_keisanc.kyori[3]=obj.options[obj.selectedIndex].value;
    obj = document.form1.week04b;
    p_keisanc.kyori[4]=obj.options[obj.selectedIndex].value;
    obj = document.form1.week05b;
    p_keisanc.kyori[5]=obj.options[obj.selectedIndex].value;
    obj = document.form1.week06b;
    p_keisanc.kyori[6]=obj.options[obj.selectedIndex].value;
    obj = document.form1.week07b;
    p_keisanc.kyori[7]=obj.options[obj.selectedIndex].value;
	
    obj = document.form1.opt01;
    p_keisanc.hindo_o[1]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt02;
    p_keisanc.hindo_o[2]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt03;
    p_keisanc.hindo_o[3]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt04;
    p_keisanc.hindo_o[4]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt05;
    p_keisanc.hindo_o[5]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt06;
    p_keisanc.hindo_o[6]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt07;
    p_keisanc.hindo_o[7]=obj.options[obj.selectedIndex].value;
	
    obj = document.form1.opt01a;
    p_keisanc.hour_o[1]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt02a;
    p_keisanc.hour_o[2]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt03a;
    p_keisanc.hour_o[3]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt04a;
    p_keisanc.hour_o[4]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt05a;
    p_keisanc.hour_o[5]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt06a;
    p_keisanc.hour_o[6]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt07a;
    p_keisanc.hour_o[7]=obj.options[obj.selectedIndex].value;
	
    obj = document.form1.opt01b;
    p_keisanc.kyori_o[1]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt02b;
    p_keisanc.kyori_o[2]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt03b;
    p_keisanc.kyori_o[3]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt04b;
    p_keisanc.kyori_o[4]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt05b;
    p_keisanc.kyori_o[5]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt06b;
    p_keisanc.kyori_o[6]=obj.options[obj.selectedIndex].value;
    obj = document.form1.opt07b;
    p_keisanc.kyori_o[7]=obj.options[obj.selectedIndex].value;
	
    p_keisanc.car_calc();
	
	//ここから維持費計算
	mykeisanc = new keisanc();
    obj = document.form1.syasyu;
    mysyasyu=obj.options[obj.selectedIndex].value;
    var syasyu = obj.selectedIndex;
    if(mysyasyu == "SK"){
        //軽
        mykeisanc.haiki = 0;
        mykeisanc.ton = 0;
        mykeisanc.z_zei=4400;
        mykeisanc.c_zei=7200;
        mykeisanc.nenpi=18;
        mykeisanc.syaken=80000;//車検
    }else{
        //マーチ
        mykeisanc.haiki = 2;
        mykeisanc.ton = 1;
        mykeisanc.z_zei=12600;
        mykeisanc.c_zei=34500;
        mykeisanc.nenpi=12;
        mykeisanc.syaken=140000;//車検
    }
	//購入費用は0で計算
    mykeisanc.hiyou=0;
    mykeisanc.km=p_keisanc.totalKm;//距離
    //ガソリン代
    mykeisanc.gasprice =150;
    mykeisanc.hoken=5000;//保険
    mykeisanc.hoken = mykeisanc.hoken*12;
    obj = document.form1.chusha;
    mykeisanc.chusha=obj.options[obj.selectedIndex].value;//駐車
    mykeisanc.chusha = mykeisanc.chusha*12;
    mykeisanc.kaikae=0;
    mykeisanc.car_calc();
   // mykeisanc.car_result();
    //mykeisanc.car_msg();
    document.getElementById("izi1").innerHTML = Math.round(mykeisanc.total/12)+"円";//維持費/月
   // document.getElementById("izi_zei1").innerHTML = Math.round(mykeisanc.total_zei/12)+"円";//税/月
    document.getElementById("izi12").innerHTML = Math.round(mykeisanc.total/1000)/10+"万円";//維持費/年
    //document.getElementById("izi_zei12").innerHTML = Math.round(mykeisanc.total_zei/1000)/10+"万円";//税/年
    document.getElementById("izi1a").innerHTML = Math.round(p_keisanc.totalhourA/12)+"円";
    document.getElementById("izi1b").innerHTML = Math.round(p_keisanc.totalhourB/12)+"円";
    document.getElementById("izi2a").innerHTML = Math.round(p_keisanc.totalkyoriA/12)+"円";
    document.getElementById("izi2b").innerHTML = Math.round(p_keisanc.totalkyoriB/12)+"円";
    document.getElementById("izi3a").innerHTML = Math.round(p_keisanc.totalhourA/12+p_keisanc.totalkyoriA/12+p_keisanc.kihonA)+"円";
    document.getElementById("izi3b").innerHTML = Math.round(p_keisanc.totalhourB/12+p_keisanc.totalkyoriB/12+p_keisanc.kihonB)+"円";
    document.getElementById("izi1ay").innerHTML = Math.round(p_keisanc.totalhourA)+"円";
    document.getElementById("izi1by").innerHTML = Math.round(p_keisanc.totalhourB)+"円";
    document.getElementById("izi2ay").innerHTML = Math.round(p_keisanc.totalkyoriA)+"円";
    document.getElementById("izi2by").innerHTML = Math.round(p_keisanc.totalkyoriB)+"円";
	total_allA=p_keisanc.totalhourA+p_keisanc.totalkyoriA+p_keisanc.kihonA*12;
	total_allB=p_keisanc.totalhourB+p_keisanc.totalkyoriB+p_keisanc.kihonB*12;
    document.getElementById("izi3ay").innerHTML = Math.round(total_allA/1000)/10+"万円";//年
    document.getElementById("izi3by").innerHTML = Math.round(total_allB/1000)/10+"万円";//年
	
    document.getElementById("taxi01a").innerHTML = Math.round(p_keisanc.taxi01/12)+"円";
    document.getElementById("taxi02a").innerHTML = Math.round(p_keisanc.taxi02/12)+"円";
    document.getElementById("taxi01b").innerHTML = Math.round(p_keisanc.taxi01/1000)/10+"万円";//年
    document.getElementById("taxi02b").innerHTML = Math.round(p_keisanc.taxi02/1000)/10+"万円";//年
//    document.form1.msgfield.value = p_keisanc.msg;
//    document.getElementById("kekka").innerHTML = p_keisanc.kekka;
	if(total_allA < mykeisanc.total){
		msg = "カーシェアリング料金"+total_allA+"円　¥n自動車維持費"+mykeisanc.total+"円　¥nカーシェアリングをしたほうが安いようです";
	}else{
		msg = "カーシェアリング料金"+total_allA+"円　¥n自動車維持費"+mykeisanc.total+"円　¥n車を購入したほうが安いようですね";
	}
    document.form1.msgfield.value = msg;
}

function jump(){
    var msg = document.form1.msgfield.value;
    alert(msg);
}
