$().ready(function(){
	$('.menu>li>a').mouseenter(function(){
		$('.menu>li').removeClass('active');
		$(this).parent().addClass('active');
	});
	$('.menu>li>ul').mouseleave(function(){
		$(this).parent().removeClass('active');
	});
	
	$('.opener').mouseover(function(){
		if ($(this).next('ul').css('display') == 'none')
		{
			$(this).css('color','#cc0001');
		}
		
	});
	$('.opener').mouseout(function(){
		if ($(this).next('ul').css('display') == 'none')
		{
			$(this).css('color','#666666');
		}
	});
	
	$('.opener2').mouseover(function(){
		if ($(this).next('div').css('display') == 'none')
		{
			$(this).css('color','#cc0001');
		}
		
	});
	$('.opener2').mouseout(function(){
		if ($(this).next('div').css('display') == 'none')
		{
			$(this).css('color','#666666');
		}
	}); 
	$('textarea').click(function(){
		if ($(this).val() == 'Describe your idea' || $(this).val() == 'Ask your question' || $(this).val() == 'Share your concern' || $(this).val() == 'Give your compliment')
		{
			$(this).val('');
		}
	});
	$('.opener').click(function(){
		if ($(this).next('ul').css('display') == 'none')
		{
			$(this).parent().children('ul').slideUp();
			$('.opener').css({'background':'url(/fileadmin/templates/img/arrowRightOff.gif) no-repeat scroll 0 14px transparent', 'color':'#666666'});
			$(this).next('ul').slideDown();
			$(this).css({'background':'url(/fileadmin/templates/img/arrowDown.gif) no-repeat scroll 0 14px transparent', 'color':'#cc0001'});
		}
		else
		{
			$('.opener').css({'background':'url(/fileadmin/templates/img/arrowRightOff.gif) no-repeat scroll 0 14px transparent', 'color':'#666666'});
			$(this).next('ul').slideUp();
		}
	});
	$('.opener2').click(function(){
		if ($(this).next('div').css('display') == 'none')
		{
			$(this).parent().children('div').slideUp();
			$('.opener2').css({'background':'url(/fileadmin/templates/img/arrowRightOff.gif) no-repeat scroll 0 14px transparent', 'color':'#666666'});
			$(this).next('div').slideDown();
			$(this).css({'background':'url(/fileadmin/templates/img/arrowDown.gif) no-repeat scroll 0 14px transparent', 'color':'#cc0001'});
		}
		else
		{
			$('.opener2').css({'background':'url(/fileadmin/templates/img/arrowRightOff.gif) no-repeat scroll 0 14px transparent', 'color':'#666666'});
			$(this).next('div').slideUp();
		}
	});
	$('#submitForm').click(function(){
		if ($('textarea').val() != '')
		{
			$('input[type=submit]').click(); 
		}
		return false;
	});
	
	$('.radio').click(function(){
		var text = $(this).attr('rel');
		
		if (text == 'Describe your idea') { $('form .recipient').val('1'); }
		else if (text == 'Ask your question') { $('form .recipient').val('2'); }
		else if (text == 'Share your concern') { $('form .recipient').val('3'); }
		else if (text == 'Give your compliment') { $('form .recipient').val('4'); }
		
		
		$('.radio').css({'background':'url(/fileadmin/templates/img/radioOFF.gif) no-repeat'});
		$(this).css({'background':'url(/fileadmin/templates/img/radioON.gif) no-repeat'});
		$('textarea').val(text);
	});
});
