

// +-----------------------------------------------------------------------------------------------------+
// | rechner.js                                                                                          |
// +-----------------------------------------------------------------------------------------------------+
// | Copyright (c) 2008 steuerberaten.de                                                                 |
// +-----------------------------------------------------------------------------------------------------+
// | Datum: 07.07.2008                                                                                   |
// +-----------------------------------------------------------------------------------------------------+
// | Urheberrechtshinweis:                                                                               |
// | Diese Script ist urheberrechtlich geschützt. Einer Freigabe zur Publikation in anderen Medien oder  |
// | zu sonstiger Verwendung wird ausdrücklich widersprochen. Jede Zuwiderhandlung wird - unabhängig von |
// | Zweck, Person, Umfang, Einsatzgebiet - sofort und ohne weitere Warnung juristisch verfolgt.         |
// +-----------------------------------------------------------------------------------------------------+
// | Autor: Michael Mühl <muehl@emric.de>                                                                |
// +-----------------------------------------------------------------------------------------------------+
 


// ********** INFO TEXTE *********
function set_info(type)
 {
 	var TAXCALC = "19272001169";
    var obj;
    var txt;

    if (document.all)
      obj = document.all.infotext;
    else
      obj = document.getElementById("infotext");

    switch (type)
    {
      case "ausgabe":
        txt = txtausgabe
        break;
      case "allgemein":
        txt = "";
        break;
      case "info_motor":
      	img_alt = "<img src='../../../assets/pics/kfz_motor_alt.gif' width='129' height='30' style='margin:3px 0px 0px 10px'>";
      	img_neu = "<img src='../../../assets/pics/kfz_motor_neu.gif' width='129' height='30' style='margin:3px 0px 0px 10px'>";
        txt = "<b>Motorart:</b> Diese Information finden Sie auch in Ihren Unterlagen:<br>Alter Fahrzeugschein: Feld 5<br>"+img_alt+"<br><br>Neue Zulassungbescheinigung: Feld P.3<br>"+img_neu;
        break;
      case "info_hubraum":
      	img_alt = "<img src='../../../assets/pics/kfz_hubraum_alt.gif' width='129' height='30' style='margin:3px 0px 0px 10px'>";
      	img_neu = "<img src='../../../assets/pics/kfz_hubraum_neu.gif' width='129' height='30' style='margin:3px 0px 0px 10px'>";
        txt = "<b>Hubraum:</b> Diese Information finden Sie auch in Ihren Unterlagen:<br>Alter Fahrzeugschein: Feld 8<br>"+img_alt+"<br><br>Neue Zulassungbescheinigung: Feld P.1<br>"+img_neu;
        break;
      case "info_schadstoff":
      	img_neu = "<img src='../../../assets/pics/kfz_schadstoff_neu.gif' width='129' height='30' style='margin:3px 0px 0px 10px'>";
        txt = "<b>Schadstoff:</b> Diese Information finden Sie auch in Ihren Unterlagen:<br>Alter Fahrzeugschein: Bitte berechnen Sie Ihren Wert in diesem <a href='http://www.dekra-online.de/co2/co2_rechner.html' class='link_std' target='_new'>Rechner</a><br><br>Neue Zulassungbescheinigung: Feld V.7<br>"+img_neu;
        break;

    }

    obj.innerHTML = txt;


  }





function CalcKfz(widget, style)  
{
	style_action(style);
	
	if (widget == "") widget = false;
	else widget = true;

	motorart = "";
	if (document.eingabe.motor[0].checked == true) { motorart = "benzin"; } 
	if (document.eingabe.motor[1].checked == true) { motorart = "diesel"; }
	hubraum		= change(document.eingabe.hubraum.value);
	schadstoff	= change(document.eingabe.schadstoff.value);
	
	hubraum_tmp = (hubraum / 100);
	hubraum_tmp = Math.ceil(hubraum_tmp)*100; 
	
	if (motorart != "" && hubraum != "" && schadstoff != "")
	{
		if (motorart == "benzin")
		{
			if (schadstoff > 120) { kfz_2009 = hubraum_tmp/100*2+(schadstoff-120)*2; kfz_2009_co = (schadstoff-120)*2; } else { kfz_2009 = hubraum_tmp/100*2; kfz_2009_co = 0; }
			if (schadstoff > 110) { kfz_2012 = hubraum_tmp/100*2+(schadstoff-110)*2; kfz_2012_co = (schadstoff-110)*2; } else { kfz_2012 = hubraum_tmp/100*2; kfz_2012_co = 0; }
			if (schadstoff > 95) { kfz_2014 = hubraum_tmp/100*2+(schadstoff-95)*2; kfz_2014_co = (schadstoff-95)*2; } else { kfz_2014 = hubraum_tmp/100*2; kfz_2014_co = 0; }
		}
		else
		{
			if (schadstoff > 120) { kfz_2009 = hubraum_tmp/100*9.5+(schadstoff-120)*2; kfz_2009_co = (schadstoff-120)*2;} else { kfz_2009 = hubraum_tmp/100*9.5; kfz_2009_co = 0;}
			if (schadstoff > 110) { kfz_2012 = hubraum_tmp/100*9.5+(schadstoff-110)*2; kfz_2012_co = (schadstoff-110)*2;} else { kfz_2012 = hubraum_tmp/100*9.5; kfz_2012_co = 0;}
			if (schadstoff > 95) { kfz_2014 = hubraum_tmp/100*9.5+(schadstoff-95)*2; kfz_2014_co = (schadstoff-95)*2; } else { kfz_2014 = hubraum_tmp/100*9.5; kfz_2014_co = 0;}
		}

		textzusammen(widget)
		set_info('ausgabe')
	}
}


function textzusammen(widget) {



	text = "<b>Kfz-Steuer pro Jahr:</b><br><TABLE cellspacing=0 cellpadding=1 border=0'>";

	text += "<TR><TD class='cell_line'>&nbsp;</TD><TD class='cell_line_border'>&nbsp;</TD></TR>";

	text += "<TR><TD valign=top class='cell'>2009 (ab 1.7.)&nbsp;&nbsp;</TD><TD class='cell_green_border'><nobr>&nbsp;&nbsp;" + komma(kfz_2009) + "  &euro;&nbsp;</nobr></TD></TR>";	
	text += "<TR><TD valign=top class='cell'>davon aufgrund CO2</TD><TD class='cell_green_border'><nobr>&nbsp;&nbsp;" + komma(kfz_2009_co) + "  &euro;&nbsp;</nobr></TD></TR>";	
	text += "<TR><TD class='cell_line'>&nbsp;</TD><TD class='cell_line'>&nbsp;</TD></TR>";


	text += "<TR><TD valign=top class='cell'>2012 (ab 1.1.)&nbsp;&nbsp;</TD><TD class='cell_green_border'><nobr>&nbsp;&nbsp;" + komma(kfz_2012) + "  &euro;&nbsp;</nobr></TD></TR>";
	text += "<TR><TD valign=top class='cell'>davon aufgrund CO2</TD><TD class='cell_green_border'><nobr>&nbsp;&nbsp;" + komma(kfz_2012_co) + "  &euro;&nbsp;</nobr></TD></TR>";	
	text += "<TR><TD class='cell_line'>&nbsp;</TD><TD class='cell_line'>&nbsp;</TD></TR>";
		
	text += "<TR><TD valign=top class='cell'>2014 (ab 1.1.)&nbsp;&nbsp;</TD><TD class='cell_green_border'><nobr>&nbsp;&nbsp;" + komma(kfz_2014) + "  &euro;&nbsp;</nobr></TD></TR>";	
	text += "<TR><TD valign=top class='cell'>davon aufgrund CO2</TD><TD class='cell_green_border'><nobr>&nbsp;&nbsp;" + komma(kfz_2014_co) + "  &euro;&nbsp;</nobr></TD></TR>";	
	

	text += "<TR><TD class='cell_line'>&nbsp;</TD><TD class='cell_line'>&nbsp;</TD></TR>";

	text += "</TABLE>";


if (!widget) 
{ 
	promo = "";
} 
else 
{ 
	promo = "";
} 

txtausgabe = text+promo;

}


