jQuery(document).ready(function(){
	jQuery(".gallery img").fadeTo("fast", .9);
	jQuery(".gallery img").hover(function(){
			jQuery(this).fadeTo("normal", 1);
		},function(){
			jQuery(this).fadeTo("normal", .9);
	});

	jQuery(".thickbox").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600,
		'speedOut'		:	200,
		'hideOnContentClick':true,
		'overlayColor':'#333',
		'overlayOpacity':0.5
	});
});




function check_notification_tellpanel()
{
 if (document.tellpanel.sender_email.value=="" || false == /^[A-Za-z0-9._%-]+@[A-Za-z0-9._%-]+\.[A-Za-z0-9._%-]{2,4}$/.test( document.tellpanel.sender_email.value) || document.tellpanel.sender_email.value == '' || document.tellpanel.translation_text.value=="" || document.tellpanel.sender_telephone.value=="")
 {
 alert ('Musisz podać poprawny adres e-mail, tekst do tłumaczenia oraz numer kontaktowy!'); return false;
 }
 else {
     advAJAX.post({
    		url: 'ajax_captcha.php',
	 		parameters : {
      			uid : $("#uid_js").val(),
      			cid : $("#cid_js").val()
     		},
	 		onSuccess : function(obj) {
				if(eval(obj.responseText) ){
					//$("#uid_js").removeClass("invalid");
                    $("#uid_js").css("background-color","#fff");
                    document.tellpanel.submit();
				}else{
					//$("#uid_js").addClass("invalid");
                    $("#uid_js").css("background-color","#f4e8ea");
                    alert('Wpisz prawidłowy kod z obrazka');
                    return false;
				}
      		}
  		});



 }
}

function check_article_reply_form()
{
 if (document.articlereply.reply_email.value=="" || false == /^[A-Za-z0-9._%-]+@[A-Za-z0-9._%-]+\.[A-Za-z0-9._%-]{2,4}$/.test( document.articlereply.reply_email.value) || document.articlereply.reply_email.value == '' || document.articlereply.reply_text.value=="")
 {
 alert ('Musisz podać poprawny adres e-mail oraz treść odpowiedzi!'); return false;
 }
 else {
     advAJAX.post({
    		url: 'ajax_captcha.php',
	 		parameters : {
      			uid : $("#uid_js").val(),
      			cid : $("#cid_js").val()
     		},
	 		onSuccess : function(obj) {
				if(eval(obj.responseText) ){
					//$("#uid_js").removeClass("invalid");
                    $("#uid_js").css("background-color","#fff");
                    document.articlereply.submit();
				}else{
					//$("#uid_js").addClass("invalid");
                    $("#uid_js").css("background-color","#f4e8ea");
                    alert('Wpisz prawidłowy kod z obrazka');
                    return false;
				}
      		}
  		});



 }
}
