//Jobs on the main page
(function ($) {
// VERTICALLY ALIGN FUNCTION
$.fn.vAlign = function() {
	return this.each(function(i){
	var ah = $(this).height();
	var ph = $(this).parent().height();
	var mh = (ph - ah) / 2;
	$(this).css('padding-top', mh);
	});
};
})(jQuery);

$(document).ready(function(){ 
	$("#pCol22 p").vAlign();
});


//Services
$(document).ready(function() {
	$("#servicesNavi").tabs("#services div", {
		event:'mouseover',  
        // enable "cross-fading" effect 
        effect: 'fade', 
        fadeOutSpeed: "slow", 		
        // start from the beginning after the last tab 
        rotate: true
    }).slideshow({
        autoplay: true,
        interval: 7000     	
    });    
});

//Newsletter
origNewsletter = "Twoj@email";
$(document).ready(function(){ 
	$('#pCol23 input').focus(function() {
		value=$(this).val();
		if ( value == origNewsletter) {
			$(this).attr("value","");
		}
	});
	$('#pCol23 input').blur(function() {
		value=$(this).val();
		if ( value == "") {
			$(this).attr("value", origNewsletter);
		}
	});
		
	$('#newsletter input').focus(function() {
		value=$(this).val();
		if ( value == origNewsletter) {
			$(this).attr("value","");
		}
	});
	$('#newsletter input').blur(function() {
		value=$(this).val();
		if ( value == "") {
			$(this).attr("value", origNewsletter);
		}
	});
});
// buttony ogolne
$(document).ready(function(){ 	
	$('button').click(
		function() {
			$(this).addClass("active");
		}
	);		
	$('button').hover(
		function() {
			$(this).addClass("hover");
		},
		function() {		
			$(this).removeClass('hover');
		}
	);	
});

//News
$(document).ready(function(){ 
	$('#news li:last').css( "border", "none" );
});

//PNGFix
$(document).ready(function(){ 
        $("#footer2").pngFix(); 
});
//NewsULTicker
$(document).ready(function(){ 
	$('#ticker01').liScroll();
	$('#footer3b .close a').click(
		function() {
			//alert("click");
			$('#footer3a').remove();
			$('#footer3b').slideUp('1800', function() {
					jQuery(this).remove();
			  });
			$.get('/tickers/hide', function(data) {
				//alert (data);
				//alert('Load was performed.');
			});			  
			return false;		
		}
	);
	
});

