jQuery(document).ready(function() {

	$.fx.interval = 50;

// ----- detekcja przegladarki -----

	var $sr_browser;
	if (navigator.userAgent.indexOf("Chromium")>0) $sr_browser = 'CHROMIUM';
	else if (navigator.userAgent.indexOf("Chrome")>0) $sr_browser = 'CHROME';
	else if ( $.browser.mozilla ) $sr_browser = 'FIREFOX';
	else if ( $.browser.msie ) $sr_browser = 'IE';
	else if ( $.browser.safari ) $sr_browser = 'SAFARI';
	else if ( $.browser.opera ) $sr_browser = 'OPERA';
	$('BODY').addClass($sr_browser);


// ----- animacja zdjec -----

	if ( ( $('#CONTENT').hasClass('SIMPLE')||$('#CONTENT').hasClass('PAGE') ) && !$('#CONTENT').hasClass('GALLERY') ) {
		var ANIMATE_IMAGE = 0;
		var ANIMATE_IMAGE_length = $('#CONTENT .images a').length;
		$('#CONTENT .images a').css('display','none');
		$('#CONTENT .images').css('display','inherit');
		setTimeout( function() {
			function ANIMATE_IMAGE_timer_function() {
				if ( ANIMATE_IMAGE==ANIMATE_IMAGE_length ) {
					clearTimeout(ANIMATE_IMAGE_timer);
					return;
				}
				$('#CONTENT .images a:eq('+(ANIMATE_IMAGE++)+')').fadeIn(1000);
			}
			var ANIMATE_IMAGE_timer = setInterval( ANIMATE_IMAGE_timer_function, 600 );
		}, 500);
	}


// ----- animacja list -----

	if ( $('#CONTENT').hasClass('PAGE') ) {
		var ANIMATE_LIST = 0;
		var ANIMATE_LIST_length = $('#CONTENT article > ul >li').length;
		$('#CONTENT article > ul >li').css('display','none');
		$('#CONTENT article > ul').css('display','inherit');
		setTimeout( function() {
			function ANIMATE_LIST_timer_function() {
				if ( ANIMATE_LIST==ANIMATE_LIST_length ) {
					clearTimeout(ANIMATE_LIST_timer);
					return;
				}
				if ( !($.browser.msie && ( $.browser.version.slice(0,1)<'9' ) ) ) $('#CONTENT article > ul >li:eq('+(ANIMATE_LIST++)+')').fadeIn(1000);
				else $('#CONTENT article > ul >li:eq('+(ANIMATE_LIST++)+')').show();
			}
			var ANIMATE_LIST_timer = setInterval( ANIMATE_LIST_timer_function, 600 );
		}, 500);
	}


// ----- drukowanie -----

	$('.PRINT').click( function() {
		window.print();
	});


// ----- scroll strony -----

$('#page-up').click( function() {
	$('html, body').animate({'scrollTop': 0}, 2000);
});


// ----- fancybox -----

	$(".FANCYBOX a").each( function() {
		$(this).attr('rel',$(this).attr('class'));
	});
	$(".FANCYBOX a").fancybox({
		'overlayOpacity'	: 0.8,
		'overlayColor' : '#000',
		'showCloseButton' : false,
		'hideOnContentClick' : true,
		'padding' : 5,
		'transitionIn' : 'fade',
		'transitionOut' : 'fade',
		'speedIn' : 1000,
		'speedOut' : 500,
		'centerOnScroll' : true,
		'titlePosition' : 'over'
	});

	$(".PAGE article a > img,.SIMPLE article a > img,.SINGLE article a > img").each( function() {
		$(this).parent().attr('rel',$(this).attr('class'));
		var fancybox_link = $(this).parent().attr('href');
		fancybox_link = fancybox_link.substring(fancybox_link.length-3);
		if ( ( fancybox_link=='jpg' ) || ( fancybox_link=='png' ) )
			$(this).parent().fancybox({
				'overlayOpacity'	: 0.8,
				'overlayColor' : '#000',
				'showCloseButton' : false,
				'hideOnContentClick' : true,
				'padding' : 5,
				'transitionIn' : 'fade',
				'transitionOut' : 'fade',
				'speedIn' : 1000,
				'speedOut' : 500,
				'centerOnScroll' : true,
				'titlePosition' : 'over'
		});
	})


// ----- zanikanie zdjęć -----

	if ( !($.browser.msie && ( $.browser.version.slice(0,1)<'9' ) ) ) {
		$('.SINGLE article a > img').hover( function() {
			$(this).stop().fadeTo(1000,'0.8');
		}, function() {
			$(this).stop().fadeTo(500,'1');
		});
	}


// ----- switch zdjęć -----

	$('.switch').each(function() {
		$(this).width( $(this).find('img').width() );
		$(this).find('span').width( $(this).find('img').width() );
		$(this).height( $(this).find('img').height() + $(this).find('span').height() );
	});
	if ( !($.browser.msie && ( $.browser.version.slice(0,1)<'9' ) ) ) {
		$('.switch,.CLIENTS .images a').hover( function() {
			$(this).find('img').eq(1).stop().fadeTo(500,'1');
		}, function() {
			$(this).find('img').eq(1).stop().fadeTo(1000,'0');
		});
	}


// ----- opisy zdjęć -----

	if ( !($.browser.msie && ( $.browser.version.slice(0,1)<'9' ) ) ) {
		$('.HOME figure,.SIMPLE figure').hover( function() {
			$(this).find('figcaption').stop().fadeTo(500,'1');
		}, function() {
			$(this).find('figcaption').stop().fadeTo(500,'0');
		});

		$('.PAGE figure').hover( function() {
			$(this).find('span').stop().fadeTo(500,'1');
		}, function() {
			$(this).find('span').stop().fadeTo(500,'0');
		});
	}
	else {
		$('.HOME figure,.SIMPLE figure').hover( function() {
			$(this).find('figcaption').show();
		}, function() {
			$(this).find('figcaption').hide();
		});

		$('.PAGE figure').hover( function() {
			$(this).find('span').show();
		}, function() {
			$(this).find('span').hide();
		});
	}


// ----- baner blog -----

		var BANNER_length = $('#BANNER .script li').length;
		$('#BANNER .paginate').append( '<li class="active"></li>' );
		for( i=1; i<BANNER_length; i++ ) {
			$('#BANNER .paginate').append( '<li></li>' );
		}
		$('#BANNER .paginate').fadeOut(0).fadeIn(500);
		BANNER_length = $('#BANNER .script li').length;
		$('#BANNER .script li:eq(0) > article > section').animate({'left': '0px'},2000);

		var BANNER_block;
		$('#BANNER .paginate li').click( function() {
			clearTimeout(BANNER_timer);

			test = $("#BANNER .paginate li").index(this);
			if ( BANNER_counter==test ) return;

			$('#BANNER .script li:eq('+BANNER_counter+')').fadeOut(1000);
			$('#BANNER .paginate li:eq('+BANNER_counter+')').removeClass('active');
			$('#BANNER .script li:eq('+BANNER_counter+') > article > section').animate({'left': '960px'},1000);
			BANNER_counter = test;
			$('#BANNER .script li:eq('+BANNER_counter+')').fadeIn(2000);
			$('#BANNER .paginate li:eq('+BANNER_counter+')').addClass('active');
			$('#BANNER .script li:eq('+BANNER_counter+') > article > section').animate({'left': '0px'},2000);

			if ( !BANNER_block ) BANNER_timer = setTimeout( BANNER_timer_function, 15000 );
		});

		var BANNER_counter = 0;
		var BANNER_timer_function = function() {
			if ( BANNER_length < 2 ) return;

			if ( $('#BANNER .script li:eq('+BANNER_counter+')').is(':animated') ) return;

			$('#BANNER .script li:eq('+BANNER_counter+')').fadeOut(1000);
			$('#BANNER .paginate li:eq('+BANNER_counter+')').removeClass('active');
			$('#BANNER .script li:eq('+BANNER_counter+') > article > section').animate({'left': '960px'},1000);
			if ( (++BANNER_counter)==BANNER_length ) BANNER_counter = 0;
			$('#BANNER .script li:eq('+BANNER_counter+')').fadeIn(2000);
			$('#BANNER .paginate li:eq('+BANNER_counter+')').addClass('active');
			$('#BANNER .script li:eq('+BANNER_counter+') > article > section').animate({'left': '0px'},2000);

			if ( !BANNER_block ) BANNER_timer = setTimeout( BANNER_timer_function, 15000 );
		}
		var BANNER_timer;
		if ( !BANNER_block ) setTimeout( BANNER_timer_function, 15000 );

		$('#BANNER .script').hover( function() {
			BANNER_block = 1;
			clearTimeout(BANNER_timer);
		}, function() {
			BANNER_block = 0;
			BANNER_timer = setTimeout( BANNER_timer_function, 15000 );
		})

// ----- rotator partnerzy -----

		var PARTNERS_width = $('#PARTNERS a').width();
		var PARTNERS_length = $('#PARTNERS img').length;
		$('#PARTNERS ul').width( PARTNERS_length * PARTNERS_width );
		var PARTNERS_height = $('#PARTNERS ul').height();
		$('#PARTNERS li').each( function(){
			$(this).css('margin-top', ( PARTNERS_height - $(this).height() ) / 2 );
		});
		$('#PARTNERS .button').bind('selectstart.disableTextSelect', function() {
			return false;
		});
		$('#PARTNERS .button').bind('mousedown.disableTextSelect', function() {
			return false;
		});
		var PARTNERS_block;
		var PARTNERS_timer_function = function() {
			if ( $('#PARTNERS ul').is(':animated') ) return;
			clearTimeout(PARTNERS_timer);
			$('#PARTNERS ul').animate( {
				left: '-='+PARTNERS_width+'px'
			}, 2000, function(){
				$(this).append( '<li style="'+$('#PARTNERS li:first-child').attr('style')+'">'+$('#PARTNERS li:first-child').html()+'</li>' ).css( 'left', '0px');
				$('#PARTNERS li:first-child').remove();
				if ( !PARTNERS_block ) PARTNERS_timer = setTimeout( PARTNERS_timer_function, 5000 );
			});
		};
		var PARTNERS_timer;
		if ( !PARTNERS_block ) setTimeout( PARTNERS_timer_function, 5000 );

		$('#PARTNERS #next').click( function(){
			PARTNERS_timer_function();
		});

		$('#PARTNERS #previous').click( function(){
			if ( $('#PARTNERS ul').is(':animated') ) return;
			clearTimeout(PARTNERS_timer);
			$('#PARTNERS ul').prepend( '<li style="'+$('#PARTNERS li:last-child').attr('style')+'">'+$('#PARTNERS li:last-child').html()+'</li>' ).css( 'left', '-'+PARTNERS_width+'px');
			$('#PARTNERS li:last-child').remove();
			$('#PARTNERS ul').animate( {
				left: '+='+PARTNERS_width+'px'
			}, 2000, function(){
				if ( !PARTNERS_block ) PARTNERS_timer = setTimeout( PARTNERS_timer_function, 5000 );
			});
		});

		$('#PARTNERS ul').hover( function() {
			PARTNERS_block = 1;
			clearTimeout(PARTNERS_timer);
		}, function() {
			PARTNERS_block = 0;
			PARTNERS_timer = setTimeout( PARTNERS_timer_function, 5000 );
		})


// ----- google map api -----

if ( $('#CONTENT').hasClass('CONTACT') ) {
	var company = [2];
	company.address = 'Wroniecka 18/5, Poznań';
	var zoom = 15;

	var map;
	$.googlemap = function(myLatlng) {

		var myOptions = {
			center: myLatlng,
			zoom: zoom,
			mapTypeId: google.maps.MapTypeId.ROADMAP,
			panControl: false,
			zoomControl: true,
			zoomControlOptions: {
				style: google.maps.ZoomControlStyle.SMALL,
				position: google.maps.ControlPosition.LEFT_TOP
			},
			mapTypeControl: true,
			mapTypeControlOptions: {
				style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR
			},
			scaleControl: false,
			streetViewControl: false
		}
		map = new google.maps.Map(document.getElementById("googleapi"), myOptions);

		var markerCompany = new google.maps.Marker({
			map: map,
			position: myLatlng,
			icon: "http://labs.google.com/ridefinder/images/mm_20_red.png",
			zIndex: -1,
			title: "Espeo Software Sp.z o.o"
		});
	}

	$.initialize = function() {
		var geocoder = new google.maps.Geocoder();
		geocoder.geocode( {
			address : company.address
		}, function(results, status) {
			if (status == google.maps.GeocoderStatus.OK) $.googlemap( results[0].geometry.location );
			else $.googlemap( new google.maps.LatLng( company.position[0], company.position[1] ) );
		});
	}

	$.ajax({
		url: "http://maps.google.com/maps/api/js?sensor=false&region=PL&language=PL&callback=$.initialize",
		dataType: "script"
	});
}


// ----- formularz kontaktowy -----

	$('#BASEMENU input[type=text]').each( function() {
		$(this).attr( 'special', $(this).attr('title') );
		if ( !$(this).val() ) $(this).val( $(this).attr('special') );
	});
	$('#BASEMENU input[type=text]').focus( function() {
		if ( $(this).val()== $(this).attr('special') ) $(this).attr('value','');
	});
	$('#BASEMENU input[type=text]').blur( function() {
		if ( !$(this).val() ) $(this).attr('value',$(this).attr('special'));
	});
	$('#BASEMENU form').submit(function() {
		if ( !$("#BASEMENU input[name=s]").val()||$("#BASEMENU input[name=s]").val()==$("#BASEMENU input[name=s]").attr('special') ) {
			return false;
		}
	});


	$('.newsletter').append('<input type="text" name="js" value="1" />');
	$('.newsletter input[type=text]').each( function() {
		$(this).attr( 'special', $(this).attr('title') );
		if ( !$(this).val() ) $(this).val( $(this).attr('special') );
	});
	$('.newsletter input[type=text]').focus( function() {
		if ( $(this).val()== $(this).attr('special') ) $(this).attr('value','');
	});
	$('.newsletter input[type=text]').blur( function() {
		if ( !$(this).val() ) $(this).attr('value',$(this).attr('special'));
	});
	$('.newsletter').submit(function() {
		if ( !$(".newsletter input[name=newsletter_email]").val()||$(".newsletter input[name=newsletter_email]").val()==$(".newsletter input[name=newsletter_email]").attr('special') ) {
			return false;
		}
		$.ajax({
			type: "POST",
			url: $(location).attr('href'),
			data: $(this).serialize(),
			dataType: 'html',
			success: function(data) {$('.newsletter p').html( $('.newsletter p',data).html() );},
			error: function() {
				if ( $('html').attr('lang') == 'en-US' ) $('.newsletter p').html('You can not send messages.');
				else if ( $('html').attr('lang') == 'de-DE' ) $('.newsletter p').html('Sie können keine Nachrichten senden.');
				else $('.newsletter p').html('Nie można wysłać wiadomości.');
			}
		});
		return false;
	});


if ( $('#CONTENT').hasClass('SINGLE') ) {
	$('#comments .comment-form-comment').append('<input type="text" name="js" value="1" />');

	$('#comments .paginate a,#comments .comment-reply-link,#comments #cancel-comment-reply-link').live('click', function(e) {
		$.ajax({
			type: "GET",
			url: $(this).attr('href'),
			dataType: 'html',
			success: function(data) {
				$('#comments').html( $('#comments',data).html() );
				$('#comments .comment-form-comment').append('<input type="text" name="js" value="1" />');
			}
		});
		e.preventDefault();
	});

	$('#respond input[type=text],#respond input[type=checkbox],#respond textarea').live('click', function() {
		$('#respond #error').html('');
		$('#respond .validate').removeClass('validate');
	});

	$('#respond form').live('submit' ,function() {
		if ( $("#respond input[name=author]").attr('name') && ( !$("#respond input[name=author]").val()||$("#respond input[name=author]").val()==$("#respond input[name=author]").attr('special') ) ) {
			if ( $('html').attr('lang') == 'en-US' ) $(this).find('#error').html('<p class="error-r">Please enter your firstname and surname.</p>');
			else if ( $('html').attr('lang') == 'de-DE' ) $(this).find('#error').html('<p class="error-r">Bitte geben Sie Ihren Namen.</p>');
			else $(this).find('#error').html('<p class="error-r">Proszę podać imię i nazwisko.</p>');
			$("#respond input[name=author]").addClass('validate');
			return false;
		}
		var email = $("#respond input[name=email]").val();
		if ( $("#respond input[name=email]").attr('name') && ( email==$("#respond input[name=email]").attr('special') || ( email.indexOf( "@" ) < 1 ) || ( email.indexOf( "@" ) != email.lastIndexOf( "@" ) ) || ( email.indexOf( ".@" ) > -1 ) || ( email.indexOf( "@." ) > -1 ) || ( email.indexOf( ".." ) > -1 ) || ( email.indexOf( "." ) ==0 ) || ( email.lastIndexOf( "." ) > email.length - 2 ) || ( email.lastIndexOf( "@" ) + 1 >= email.lastIndexOf( "." ) ) ) ) {
			if ( $('html').attr('lang') == 'en-US' ) $(this).find('#error').html('<p class="error-r">Please enter a valid e-mail address.</p>');
			else if ( $('html').attr('lang') == 'de-DE' ) $(this).find('#error').html('<p class="error-r">Bitte geben Sie eine gültige E-Mail.</p>');
			else $(this).find('#error').html('<p class="error-r">Proszę podać prawidłowy adres e-mail.</p>');
			$("#respond input[name=email]").addClass('validate');
			return false;
		}
		if ( !$("#respond textarea").val() || $("#respond textarea").val()==$("#respond textarea").attr('special') ) {
			if ( $('html').attr('lang') == 'en-US' ) $(this).find('#error').html('<p class="error-r">Please add your message.</p>');
			else if ( $('html').attr('lang') == 'de-DE' ) $(this).find('#error').html('<p class="error-r">Bitte fügen Sie Ihre Nachricht.</p>');
			else $(this).find('#error').html('<p class="error-r">Proszę uzupełnić treść wiadomości.</p>');
			$("#respond textarea").addClass('validate');
			return false;
		}

		if ( $('html').attr('lang') == 'en-US' ) $('#respond #error').html('<p class="error-b">Sending...</p>');
		else if ( $('html').attr('lang') == 'de-DE' ) $('#respond #error').html('<p class="error-b">Weiter senden...</p>');
		else $('#respond #error').html('<p class="error-b">Trwa wysyłanie...</p>');

		$.ajax({
			type: "POST",
			url: 'http://www.espeo.pl/wp-comments-post.php',
			data: $(this).serialize(),
			dataType: 'html',
			success: function(data) {
				$('#comments').html( $('#comments',data).html() );
				$('#comments .comment-form-comment').append('<input type="text" name="js" value="1" />');
				if ( $('html').attr('lang') == 'en-US' ) $('#respond #error').html('<p class="error-g">You can not send messages.</p>');
				else if ( $('html').attr('lang') == 'de-DE' ) $('#respond #error').html('<p class="error-g">Sie können keine Nachrichten senden.</p>');
				else $('#respond #error').html('<p class="error-g">Wiadomość została wysłana poprawnie.</p>');
			},
			error: function(jqXHR) {
				var sr_comment_error = jqXHR.responseText.split('p>');
				sr_comment_error = sr_comment_error[1].slice(0,sr_comment_error[1].length-2);
				if ( sr_comment_error ) $('#respond #error').html( '<p class="error-r">' + sr_comment_error + '</p>' );
				else {
					if ( $('html').attr('lang') == 'en-US' ) $('#respond #error').html('<p class="error-r">You can not send messages.</p>');
					else if ( $('html').attr('lang') == 'de-DE' ) $('#respond #error').html('<p class="error-r">Sie können keine Nachrichten senden.</p>');
					else $('#respond #error').html('<p class="error-r">Nie można wysłać wiadomości.</p>');
				}
			}
		});
		return false;
	});
}


if ( $('#CONTENT').hasClass('CONTACT') ) {
	$('.CONTACT > .RIGHT form').append('<input type="text" name="js" value="1" />');

	$('.CONTACT input[type=text],.CONTACT textarea').each( function() {
		$(this).attr( 'special', $(this).attr('title') );
		if ( !$(this).val() ) $(this).val( $(this).attr('special') );
	});

	$('.CONTACT input[type=text],.CONTACT textarea').focus( function() {
		if ( $(this).val()== $(this).attr('special') ) $(this).attr('value','');
	});
	$('.CONTACT input[type=text],.CONTACT textarea').blur( function() {
		if ( !$(this).val() ) $(this).attr('value',$(this).attr('special'));
	});

	$('.CONTACT input[type=text],.CONTACT input[type=checkbox],.CONTACT textarea').click( function() {
		$('.CONTACT #error').html('');
		$(".CONTACT .validate").removeClass('validate');
	});

	$('.CONTACT input[name=phone]').keypress( function(e) {
		if ( ( ( e.which < 48 ) || ( e.which > 57 ) ) && ( e.which != 8 ) && ( e.which != 13 ) ) e.preventDefault();
	});

	$('.CONTACT form').submit(function() {
		if ( !$(".CONTACT input[name=surname]").val()||$(".CONTACT input[name=surname]").val()==$(".CONTACT input[name=surname]").attr('special') ) {
			if ( $('html').attr('lang') == 'en-US' ) $(this).find('#error').html('<p class="error-r">Please enter your firstname and surname or company name.</p>');
			else if ( $('html').attr('lang') == 'de-DE' ) $(this).find('#error').html('<p class="error-r">Bitte geben Sie Ihren Namen oder Firmennamen.</p>');
			else $(this).find('#error').html('<p class="error-r">Proszę podać imię i nazwisko, albo nazwę firmy.</p>');
			$(".CONTACT input[name=surname]").addClass('validate');
			return false;
		}
		var email = $(".CONTACT input[name=email]").val();
		if ( email==$(".CONTACT input[name=email]").attr('special') || ( email.indexOf( "@" ) < 1 ) || ( email.indexOf( "@" ) != email.lastIndexOf( "@" ) ) || ( email.indexOf( ".@" ) > -1 ) || ( email.indexOf( "@." ) > -1 ) || ( email.indexOf( ".." ) > -1 ) || ( email.indexOf( "." ) ==0 ) || ( email.lastIndexOf( "." ) > email.length - 2 ) || ( email.lastIndexOf( "@" ) + 1 >= email.lastIndexOf( "." ) ) ) {
			if ( $('html').attr('lang') == 'en-US' ) $(this).find('#error').html('<p class="error-r">Please enter a valid e-mail address.</p>');
			else if ( $('html').attr('lang') == 'de-DE' ) $(this).find('#error').html('<p class="error-r">Bitte geben Sie eine gültige E-Mail.</p>');
			else $(this).find('#error').html('<p class="error-r">Proszę podać prawidłowy adres e-mail.</p>');
			$(".CONTACT input[name=email]").addClass('validate');
			return false;
		}
		if ( !$(".CONTACT input[name=topic]").val()||$(".CONTACT input[name=topic]").val()==$(".CONTACT input[name=topic]").attr('special') ) {
			if ( $('html').attr('lang') == 'en-US' ) $(this).find('#error').html('<p class="error-r">Please fill in the message subject.</p>');
			else if ( $('html').attr('lang') == 'de-DE' ) $(this).find('#error').html('<p class="error-r">Bitte füllen Sie in den Betreff der Nachricht.</p>');
			else $(this).find('#error').html('<p class="error-r">Proszę uzupełnić temat wiadomości.</p>');
			$(".CONTACT input[name=topic]").addClass('validate');
			return false;
		}
		if ( !$(".CONTACT textarea").val() || $(".CONTACT textarea").val()==$(".CONTACT textarea").attr('special') ) {
			if ( $('html').attr('lang') == 'en-US' ) $(this).find('#error').html('<p class="error-r">Please add your message.</p>');
			else if ( $('html').attr('lang') == 'de-DE' ) $(this).find('#error').html('<p class="error-r">Bitte fügen Sie Ihre Nachricht.</p>');
			else $(this).find('#error').html('<p class="error-r">Proszę uzupełnić treść wiadomości.</p>');
			$(".CONTACT textarea").addClass('validate');
			return false;
		}

		$('.CONTACT input').each(function() {
			if ( $(this).val()==$(this).attr('special') ) $(this).attr('value','');
		})
		$('.CONTACT textarea').each(function() {
			if ( $(this).val()==$(this).attr('special') ) $(this).attr('value','');
		})

		if ( $('html').attr('lang') == 'en-US' ) $('.CONTACT form #error').html('<p class="error-b">Sending...</p>');
		else if ( $('html').attr('lang') == 'de-DE' ) $('.CONTACT form #error').html('<p class="error-b">Weiter senden...</p>');
		else $('.CONTACT form #error').html('<p class="error-b">Trwa wysyłanie...</p>');

		$.ajax({
			type: "POST",
			url: $(location).attr('href'),
			data: $(this).serialize(),
			dataType: 'html',
			success: function(data) { $('.CONTACT form #error').html( $('#error',data).html() ); },
			error: function() {
				if ( $('html').attr('lang') == 'en-US' ) $('.CONTACT form #error').html('<p class="error-r">You can not send messages.</p>');
				else if ( $('html').attr('lang') == 'de-DE' ) $('.CONTACT form #error').html('<p class="error-r">Sie können keine Nachrichten senden.</p>');
				else $('.CONTACT form #error').html('<p class="error-r">Nie można wysłać wiadomości.</p>');
			}
		});
		return false;
	});
}
});
