var urlBase = 'http://freelance.com.pl/';

$().ready(function() {
	$("a.target_blank").attr('target','_blank');
	$("#colLeft a.mainMenu").mouseover(function(){
		var thisId = $(this).attr('id');
		$(this).stop(true, false).animate({
			opacity: 0.3,
			marginLeft:10
			}, 500, 'linear', function() {
				  	
		});
	});
	$("#colLeft a.mainMenu").mouseout(function(){
		var thisId = $(this).attr('id');
		$(this).stop(true, false).animate({
			opacity: 1,
			marginLeft:0
			});
	});

	$("div.pageBack").mouseover(function(){
		  $(this).stop(true, false).animate({
		  	opacity: 0.3
		  }, 500, 'linear', function() {
		     
		  });

	});
	
	$("div.pageBack").mouseout(function(){
		  $(this).stop(true, false).animate({
		  	opacity: 1
		  }, 500, 'linear', function() {
		     
		  });

	});


});

function resetMenu(){
	
}

function sendMail(){
		$("#alError").slideUp();
		$("#alOk").slideUp();
		$.ajax({
		   type: "POST",
		   url: urlBase+'kontakt/wyslij.html',
		   data: {email_to:$('#eEmail').val(),email_name:$('#eName').val(),email_content:$('#eContent').val()},
		   success: function(msg){
				   if(msg=='ok'){
				   	$('#forma').find('input,textarea').val('');
				   	var msg = 'Wiadomość została wysłana, postaram się odpowiedzieć na tą wiadomość jak najszybciej.';
				   }else{
				   
				   }
				   $("#alOk").find('.alcontent').html(msg);
				   $("#alOk").slideDown();
		   },
		   error:function (xhr, ajaxOptions, thrownError){
				$("#alError").find('.alcontent').html('Wystąpił bląd, spróbuj wysłać wiadomość za chwilę.');
				$("#alError").slideDown();
           }
		 });
}
