$(document).ready(function() {

/**********************************************************************************
/* T A R I F E
/**********************************************************************************/

$("td:first-child","#tarifliste tbody").addClass("colFirst");

$("tr", "#tarifliste table tbody").each(function() {
	$("td:even", this).addClass("colEven");
	$("td:odd",  this).addClass("colOdd");
});

$("tr", "#tarifliste table tbody").hover(function() {
	$(this).addClass("rowLine");
	$("td", this).removeClass("colEven colOdd");
}, function() {
	$(this).removeClass("rowLine");
	$("td:even", this).addClass("colEven");
	$("td:odd",  this).addClass("colOdd");
});

/**********************************************************************************
/* FRAGEBOGEN
/**********************************************************************************/

// SMS
$("input.zusatz:text","form.fragebogen fieldset.sms").focus(function() {
	$(this).css("background-color","#FFFFFF")
	       .css("color","#000000");
	var oElem = $(this).prev("label").prev("input:radio");
	$(oElem).attr("checked","checked");
});

$("input:radio","form.fragebogen fieldset.sms").focus(function() {
	if ($(this).val()!=2) {
		var oElem = $(this).siblings("input.zusatz:text");
		$(oElem).val("")
		        .css("background-color","#ABABAB")
		        .css("color","#888888");
	} else {
		var oElem = $(this).siblings("input.zusatz:text");
		$(oElem).css("background-color","#FFFFFF")
		        .css("color","#000000");
	}
});



// Gespräche
$("input:text","form.fragebogen fieldset.anruf").focus(function() {
	$(this).css("background-color","#FFFFFF")
	       .css("color","#000000");
	var oElem = $(this).siblings("input:radio");
	$(oElem).removeAttr("checked");
});

$("input:radio","form.fragebogen fieldset.anruf").focus(function() {
	var oElem = $(this).siblings("input:text");
	$(oElem).css("background-color","#BABABA")
	        .css("color","#888888")
	        .val("");
});


});

