

$(document).ready(function()
	{
	$("img.star").hover(function()
		{
		var a=this.id.substr(1,2);
		var b=a.substr(0,1);
		var c=a.substr(1,1);
		if($("#isoquestionrating"+b).val()=="")
			{
			for(var x=b+'1';
			x<=b+'5';
			x++)
				{
				if(a>x-1)
					{
					document.getElementById("i"+x).src="/wp-content/themes/kreditkarten/images/buttons/stern_a.png"
				}
				else
					{
					document.getElementById("i"+x).src="/wp-content/themes/kreditkarten/images/buttons/stern.png"
				}
			}
		}
	}
	,function()
		{
		var a=this.id.substr(1,2);
		var b=a.substr(0,1);
		var c=a.substr(1,1);
		if($("#isoquestionrating"+b).val()=="")
			{
			for(var x=b+'1';
			x<=b+'5';
			x++)
				{
				document.getElementById("i"+x).src="/wp-content/themes/kreditkarten/images/buttons/stern.png"
			}
		}
	}
	)
}
);
function setrate(a)
	{
	var b=a.substr(0,1);
	var c=a.substr(1,1);
	for(var x=b+'1';
	x<=b+'5';
	x++)
		{
		if(a>x-1)
			{
			document.getElementById("i"+x).src="/wp-content/themes/kreditkarten/images/buttons/stern_a.png"
		}
		else
			{
			document.getElementById("i"+x).src="/wp-content/themes/kreditkarten/images/buttons/stern.png"
		}
	}
	if(c==1)
		{
		$("#isoquestioncomment"+b).slideDown(500)
	}
	else
		{
		$("#isoquestioncomment"+b).slideUp(250)
	}
	if(c==1&&document.getElementById('isoquestionrating'+b).value==1)
		{
		c=0;
		$("#isoquestioncomment"+b).slideUp(250);
		for(var x=b+'1';
		x<=b+'5';
		x++)
			{
			document.getElementById("i"+x).src="/wp-content/themes/kreditkarten/images/buttons/stern.png"
		}
	}
	document.getElementById('isoquestionrating'+b).value=c
}



$(document).ready(function(){

	$('.vergleich th').hover( function () {
		$('span',this).fadeIn(500);
	  }, 
	  function () {
	  	$('span',this).fadeOut(100);
	  }
	);
	
	$('.vergleich th').wrapInner("<strong></strong>");
	
	$('.vergleich th span').each(function(){
		$(this).closest("strong").addClass('hasinfo');
	})

	$('#tabs').tabs();

	$(".addanswer a").bind("click", function(e){

		var $link = $(this);
		
		$link.html('');
		$link.addClass("load");

		
		$link.closest("div").load($link.attr('href'), function(){
	
			$link.removeClass("load");
			
		});
		
		return false;
	
	});



});



