$(document).ready(function() {

	/* LANG */

	$("#language").hover(
	function() {
		$(this).animate({
			top: '0px'
		},{queue:false, duration:500});
	},
	function() {
		$(this).animate({
			top: '-100px'
		},{queue:false, duration:500});
	}
	);
	
	/* BACK2TOP */
	
	$("#wgore").click(function() {
		$("html, body").animate({scrollTop: 0},'slow','easeOutQuart');
	});
	
	/* CONTACT */
		
	function rozwin() {
		$("a.h1").stop().animate({opacity: '0', filter: '', left: '-200px'},500);
		$("#contact-box").animate({
			left: '-200px'
		},{queue:false, duration:500});
	};
	
	function zwin() {
		$("a.h1").stop().animate({opacity: '10', filter: '', left: '0px'},500);
		$("#contact-box").animate({
			left: '0px'
		},{queue:false, duration:500});
	};
	
	$("#contact").hover(
	function() {
		rozwin();
	},
	function() {
		zwin();
	}
	);
	
	/* TABS */
	
	$(".tab_content").hide();
	$("ul.tabs li:first").addClass("active").show(); 
	$(".tab_content:first").show();

	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active");
		$(this).addClass("active"); 
		$(".tab_content").hide();

		var activeTab = $(this).find("a").attr("href"); 
		$(activeTab).fadeIn(); 
		return false;
	});
	
	$("#cat-fast").colorbox({width:"880px", inline:true, href:"#live-preview"});


});



$(".item").hover(function() {
	$(this).css({'z-index' : '100'}); /*Add a higher z-index value so this image stays on top*/ 
	$(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
		.animate({
			marginTop: '-50px', /* The next 4 lines will vertically align this image */ 
			marginLeft: '-80px',
			top: '50%',
			left: '50%',
			width: '160px', /* Set new width */
			height: '100px', /* Set new height */
		}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */

	} , function() {
	$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
	$(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
		.animate({
			marginTop: '5px', /* Set alignment back to default */
			marginLeft: '5px',
			top: '0',
			left: '0',
			width: '140px', /* Set width back to default */
			height: '90px', /* Set height back to default */
		}, 200);
});


















