  $(document).ready(function() {
  
  
// AKORDEON  
  
    $("#akordeon").accordion( {
								animated: 'easeslide', 
								autoHeight: false,
				  			  } );


// SLAJDY
							  
// $('#show').cycle({
//						fx: 'fade', 
//						next:  '#show',
//						speed: 2500,
//						timeout: 1
//				});
  
  
// TOPMENU
  
    $('#topnav > li').hover(
        function () {
            var $this = $(this);
            $('a',$this).stop(true,true).animate({
                    'top':'0px'
                }, 300);
        },
        function () {
            var $this = $(this);
            $('a',$this).stop(true,true).animate({
                    'top':'-32px'
                }, 300);
        }
    );
	
// TWITTER
	

		$.getScript("http://twitter.com/javascripts/blogger.js");
	    $.getScript("http://twitter.com/statuses/user_timeline/xaoointeractive.json?callback=twitterCallback2\\&count=3", 
					function () {
								$('#col3Loader').fadeOut(350, 
															function() {
																		$('#twitter_div').fadeIn(350);
																		});
							});
 
																
										
// OFERTA
	$("#ofertaProjH").click(function() {
				$("#ofertaProjD").toggle('blind',300);
				return false;
			});
	
	$("#ofertaMarH").click(function() {
			$("#ofertaMarD").toggle('blind',300);
			return false;
		});
		
	$("#ofertaOpH").click(function() {
			$("#ofertaOpD").toggle('blind',300);
			return false;
		});

	$("#ofertaStratH").click(function() {
			$("#ofertaStratD").toggle('blind',300);
			return false;
		});
		


// FORMULARZ
	
	$('#kontaktForm').simpleValidate({
							errorElement: 'em',
							errorClass: 'error',
							errorText: 'Uzupełnij to pole.',
							emailErrorText: 'Wpisz poprawny adres.',
							inputErrorClass: 'poleError',
							ajaxRequest: true,
							completeCallback: function($el) {
												var formData = $el.serialize();
												$('#kontaktForm').html("<img src=\"img/loader.gif\" style=\"margin: 3px 0 15px 270px;\"/>").hide().fadeIn(300);
												$.ajax({
													type: 'post',
													url: 'wiadomosc.php',
													data: formData,
													success: function() {  
																$('#kontaktForm').html("<div id='komunikatSukcesu'></div>");
																$('#komunikatSukcesu').html("<h2>Dziękujemy! Wiadomość przesłana pomyślnie. </h2>")
																.append("<p>Postaramy się odpowiedzieć jak najszybciej (zwykle nie zajmuje to dłużej niż dobę). Do usłyszenia!</p> <br/> <i>Pozdrawiamy, <br/>XAOO</i>")  																
																.hide()  
																.fadeIn(500); 
																// alert('Dane kontrolnie: ' + formData);
																}  			
												});
											}						
					});

// LINKI WYCHODZĄDZE W NOWYM
					
	$(function() {
    $('a[rel*=external]').click( function() {
        window.open(this.href);
        return false;
    });
});

					
        }); 

