$(document).ready(function() {


        $('#newsletterForm').submit(function() {
            var $this = $(this);

             if (!$('input[name=nl_email]').val())
             {
                 $('input[name=nl_email]').css('border', '1px solid red');
                   return false;
             }
         });

        $('#filesendForm').submit(function() {
            var $this = $(this);

             if (!$('#mail').val())
             {
                 $('#label_mail').css('color', 'red');
                   return false;
              }
              if(!$('#name').val() && !$('#firm').val())
              {
                 $('#label_name').css('color', 'red');
                 $('#label_firm').css('color', 'red');
                 return false;
              }

         });

	$('#gallery a').lightBox();
        $('.product-gallery a').lightBox();
	
	$('#promocje').click(function(){
		window.location.href = "http://www.aspekt.net.pl/promocje";
	});
	
	$('#logo').click(function(){
		window.location.href = "http://www.aspekt.net.pl";
	});
	
	$('.instruction-pdf, .carts-pdf, .info0-pdf, .info1-pdf, .info2-pdf, .info3-pdf, .info4-pdf').click(function(){
                var who = $(this).attr('class');
                var src = $('input[name='+who+']').val();
                
                $('.mail_box').fadeIn(1000);
                $('input[name=src_sendfile]').val(src);
                
                return false;
	});
	
	$('.mail_box_close').click(function(){
		$('.mail_box').fadeOut(1000);
	});

        $('.msg_box_close').click(function(){
		$('.msg_box').fadeOut(1000);
	});
});