jQuery(document).ready(function($) {

	
	//hide top language support if JS is supported 
	// $('hgroup #qtranslate-chooser').hide();
	//nav animation
	$("#menu-main li a").hover(function() {	//On hover...
		$(this).animate({
			marginTop: "0" //Find the <span> tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).animate({
			marginTop: "-10"  //Move the <span> back to its original state (0px)
		}, 350);
	});

	$('.category-blog .entry-content p:empty').remove();

	// //translate
	// $('#translate').click(function() {
	// 	$(this).animate({marginLeft: '-30'}, 150);
	// 	$('#flag-box').delay(150).animate({marginLeft: '0'}, 150);
	// });

	// $('span.close').click(function() {
	// 	$('#flag-box').animate({marginLeft: '-50'}, 150);
	// 	$('#translate').delay(150).animate({marginLeft: '0'}, 150);
	// });

	//ajax for contact form

	$('#contactform').submit(function(){
	
		var action = $(this).attr('action');
		
		$("#message").fadeIn(250,function() {
		$('#message').hide();
		
 		$('#submit')
			.after('')
			.attr('disabled','disabled');
		
		$.post(action, { 
			name: $('#name').val(),
			company: $('#company').val(),
			email: $('#email').val(),
			phone: $('#phone').val(),
			subject: $('#subject').val(),
			comments: $('#comments').val(),
			verify: $('#verify').val()
		},
			function(data){
				document.getElementById('message').innerHTML = data;
				$('#message').fadeIn();
				$('#contactform img.loader').fadeOut('slow',function(){$(this).remove()});
				$('#submit').removeAttr('disabled'); 
				if(data.match('success') != null) $('#contactform').slideUp('slow');
				if(data.match('success') != null) $('#verification').hide();
			}
		);
		
		});
		
		return false; 
	
	});
});
