
var he = 10;

$(document).ready(function()
{
	// Slider auf die Positionen setzen
	// Manipulation über die Slider
	$('#lineal_1').slider(
	{
		stepping:100,
		min:500,
		max:60000,
		slide: function()
		{
			val = $('#lineal_1').slider('value');
			$('#lin_1_val').val(''+val+'');
		}
	}
	);
	$('#lineal_2').slider(
	{
		min:20,
		max:300,
		slide: function()
		{
			val = $('#lineal_2').slider('value');
			$('#lin_2_val').val(''+val+'');
			$('#leistung_kw').val((val*0.055).toFixed(0));
		}
	}
	);
	// Umgekehrter Fall, Manipulation über Input-Feld
	$('#lin_2_val').blur(
	function()
	{
		val = $('#lin_2_val').val();
		$('#lineal_2').slider('moveTo',val);
		$('#leistung_kw').val((val*0.055).toFixed(0));

	}
	);
	$('#lin_1_val').blur(
	function()
	{
		val = $('#lin_1_val').val();
		$('#lineal_1').slider('moveTo',val);
	}
	);
	$('#but_privatkunde').click(
	function()
	{
		$('#but_gewerbekunde').removeClass('gk_active');
		$('#but_privatkunde').addClass('pk_active');
		$('#cust_group').val('1');
	}
	);
	$('#but_gewerbekunde').click(
	function()
	{
		$('#but_gewerbekunde').addClass('gk_active');
		$('#but_privatkunde').removeClass('pk_active');
		$('#cust_group').val('2');
	}
	);

	$('.pfeilbild_1').click(
		function(e)
		{
			$('#helpcontent #help2').hide();
			$('#helpcontent #help1').show();
			var he = $('#helpcontent').height();
			$('#help').animate({height: he+'px'});
			var t = e.pageY-$('#helpcontent').height()+60;
			var l = e.pageX-405;
			$('#help').css ({top: t +'px', left: l +'px'});

		}
		);
	$('.pfeilbild_2').click(
		function(e)
		{
			$('#helpcontent #help1').hide();
			$('#helpcontent #help2').show();
			var he = $('#helpcontent').height();
			$('#help').animate({height: he+'px'});
			var t = e.pageY-$('#helpcontent').height()+60;
			var l = e.pageX-405;
			$('#help').css ({top: t +'px', left: l +'px'});

		}
		);
	$('#close-help').click(
		function()
		{
			$('#help').fadeOut();
		});

		$('#show_impress').click(
			function()
			{
				done = $('.newsbox');
				$('#more_links').fadeOut('slow');
				if (done.fadeOut('slow').is(':animated'))
				{
					$('div#impressum').fadeIn('slow');
				}
			}
		);

		$('#show_news').click(
			function()
			{
				done = $('.newsbox');
				$('#more_links').fadeIn('slow');
				if (done.fadeIn('slow').is(':animated'))
				{
					$('div#impressum').fadeOut('slow');
				}
			}
		);

		$('#postleitzahl').click(
			function()
			{
				$(this).val('');
			}
		);



		$('#lineal_1').slider('moveTo',3000);
		$('#lineal_2').slider('moveTo',75);
	}
);

