// JavaScript Document


$('document').ready(function() {
	
	//custom dropdown menu
	$("#menu-main li ul").css({ display: 'none' });
	$('#menu-main > li').hover(function() {
		
		//add the hover state
		$(this).addClass('main_over');
		
		$(this).find('.sub-menu').stop(true,true).delay(50).animate({ "height": "show", "opacity": "show" }, 200 );
	}, function() {
		//remove the hover state
		$(this).removeClass('main_over');
		$(this).find('.sub-menu').stop(true,true).delay(50).animate({ "height": "hide", "opacity": "hide" }, 200 );
	})
	
	
	//clears the value of the search text field onclick
	$('#s').focus(function() {
		$(this).val("");
	})
	
	
	//hack to add the elements not in qTranslate to the menu
	
	$('.trigger_tooltip').mouseover(function() { 

	
		id = $(this).attr("id");
		//alert(id);
		$('#'+id+' + .tooltip').show();
	})
	
	$('.trigger_tooltip').mouseout(function() { 
	
		id = $(this).attr("id");
		//alert(id);
		$('#'+id+' + .tooltip').hide();
	})
	
	//alternates the row color in content tables
	$('#content_holder table tr:nth-child(odd)').css('background','#bde2f6');
	
	//toggle the register form section
	$('fieldset a').click(function (){
		var name = $(this).attr('name');
		$('#'+name).slideToggle('fast',function() {});
		var parent = $(this).parent().get(0).tagName;
		//alert($(this).get(0).tagName+' + .form_expand');
		$("a").attr('name');
		$('#'+name+' + .form_expand').toggle();
	})
	
	

		
});


