$(document).ready(function(){

	$('.item1').hover(function(){
		$('.item1 div').stop().animate({'left': '6px', 'top': '7px'}, 200);
			}, function () {
			$('.item1 div.item11').stop().animate({'left': '0px', 'top' : '0px'}, 100);
			$('.item1 div.item22').stop().animate({'left': '9px', 'top' : '2px'}, 200);
			$('.item1 div.item33').stop().animate({'left': '5px', 'top' : '6px'}, 300);
			$('.item1 div.item44').stop().animate({'left': '1px', 'top' : '7px'}, 400);
	});
	
	
	$('.item2').hover(function(){
		$('.item2 div').stop().animate({'left': '6px', 'top': '7px'}, 200);
			}, function () {
			$('.item2 div.item11').stop().animate({'left': '0px', 'top' : '0px'}, 100);
			$('.item2 div.item22').stop().animate({'left': '9px', 'top' : '2px'}, 200);
			$('.item2 div.item33').stop().animate({'left': '5px', 'top' : '6px'}, 300);
			$('.item2 div.item44').stop().animate({'left': '1px', 'top' : '7px'}, 400);
	});
	
	
	$('.item3').hover(function(){
		$('.item3 div').stop().animate({'left': '6px', 'top': '7px'}, 200);
			}, function () {
			$('.item3 div.item11').stop().animate({'left': '0px', 'top' : '0px'}, 100);
			$('.item3 div.item22').stop().animate({'left': '9px', 'top' : '2px'}, 200);
			$('.item3 div.item33').stop().animate({'left': '5px', 'top' : '6px'}, 300);
			$('.item3 div.item44').stop().animate({'left': '1px', 'top' : '7px'}, 400);
	});
	
	
	$('.item4').hover(function(){
		$('.item4 div').stop().animate({'left': '6px', 'top': '7px'}, 200);
			}, function () {
			$('.item4 div.item11').stop().animate({'left': '0px', 'top' : '0px'}, 100);
			$('.item4 div.item22').stop().animate({'left': '9px', 'top' : '2px'}, 200);
			$('.item4 div.item33').stop().animate({'left': '5px', 'top' : '6px'}, 300);
			$('.item4 div.item44').stop().animate({'left': '1px', 'top' : '7px'}, 400);
	});
	
	
});





function getrandom()
{
	min_random = -30;
	max_random = 30;
    var range = max_random - min_random + 1;
	var generation = Math.floor(Math.random()*range) + min_random;
	
	if (generation <= 15 && generation >= 0)
		generation = generation + 15;

	if (generation >= -15 && generation < 0)
		generation = generation - 15;
	
    return generation;
}


/*  MENU  */
 $(function(){
    $('.header li a')
				   .hover(function(){
					$(this).stop().animate({color: "#ffffff", 'background-position': '0px 0px'},{queue:false,duration:600});
	               }, function () {
				$(this).stop().animate({color: "#565656", 'background-position': '0px -83px'},{queue:false,duration:300});
			});
});








 $(function(){
    $('.novelty_index .img')
				   .hover(function(){
					$(this).stop().animate({'top':'0px'}, 400);
				//	$('.novelty_index .circle').stop().animate({'top':'-0px', 'left':'0px'}, 600);
	               }, function () {
					$(this).stop().animate({'top':'50px'}, 200);
				//	$('.novelty_index .circle').stop().animate({'top':'20px', 'left':'20px'}, 300);
			});
});



	
	
/* FIND */	
	visible_search = 0;
	function show_search(){
		if (visible_search == 0)
		{
			$('.find .form_bg').animate({width:'140px'}, 800)
			$('.find .form_bg .button').css({'display' : 'block'}).animate({'opacity' : '1'}, 500);
			visible_search = 1;
			$('.find .form_bg input').css({'display' : 'block'}).animate({'opacity' : '1'}, 1400);
		}
		else
		{
			/*$('.find .form_bg').animate({width:'40px'}, 400)
			$('.find .form_bg input').animate({'opacity' : '0'}, 1400).css({'display' : 'none'});
			$('.find .form_bg .button').animate({'opacity' : '0'}, 500).css({'display' : 'none'});
			visible_search = 0;*/
			
			window.location.href=document.getElementById('search_local').value+'/search/'+document.getElementById('search_param').value+'/'+document.getElementById('search_string').value;
			//alert(document.getElementById('search_local').value+'/site/search/'+document.getElementById('search_param').value+'/'+document.getElementById('search_string').value);
		}
		
	}
	
	
/* PERO */
$(document).ready(function(){
	$('.top_item_block .parallax').jparallax({triggerExposesEdges: true, yorigin:0.5, frameDuration: 2, mouseActiveOutside:true}, {xtravel: 0.05, ytravel: 0.06}, {xtravel: 0.2, ytravel: 0.2}, {xtravel: 0.05, ytravel: 0.09});
});	


$(document).ready(function(){
	$('.novelty_index .parallax').jparallax({triggerExposesEdges: true, yorigin:0.5, frameDuration: 2, mouseActiveOutside:true}, {xtravel: 0.05, ytravel: 0.06}, {xtravel: 0.2, ytravel: 0.2}, {xtravel: 0.03, ytravel: 0.09});
});	


$(document).ready(function(){
	$('.catalog_item .parallax').jparallax({triggerExposesEdges: true, yorigin:0.5, frameDuration: 2, mouseActiveOutside:true}, {xtravel: 0.14, ytravel: 0.2}, {xtravel: 0.11, ytravel: 0.15}, {xtravel: 0.1, ytravel: 0.04});
});


$(document).ready(function(){
	$('.cat_para .parallax').jparallax({triggerExposesEdges: true, yorigin:0.5, frameDuration: 2, mouseActiveOutside:true}, {xtravel: 0.14, ytravel: 0.2}, {xtravel: 0.22, ytravel: 0.3}, {xtravel: 0.03, ytravel: 0.04});
});





$(function() {
	$(window).bind("scroll", scrolled);
});

function scrolled(evt) {
	var scrollpx = $(window).scrollTop();
	
	var fold = $(window).scrollTop();
	
	var speed1 = -(fold * 0.7);
	var speed2 = -(fold * 0.5);
	var speed3 = -(fold * 0.3);
	
	
	$(".top_item_block .leave_1").css({ top: 0 + speed1 },400,'swing');
	$(".top_item_block .leave_2").css({ top: 0 + speed2 },400,'swing');
	$(".top_item_block .leave_3").css({ top: 0 + speed3 },400,'swing');
	
	
	
	
	$(".catalog_item .feathen1 img").css({ top: 0 + speed3 },400,'swing');
	$(".catalog_item .feathen2 img").css({ top: 0 + speed2 },400,'swing');
	$(".catalog_item .feathen3 img").css({ top: 0 + speed1 },400,'swing');
	
	$(".cat_para .feathen1 img").css({ top: 0 + speed3 },400,'swing');
	$(".cat_para .feathen2 img").css({ top: 0 + speed2 },400,'swing');
	$(".cat_para .feathen3 img").css({ top: 0 + speed1 },400,'swing');

	/*
	var speed1 = (fold * 0.2);
	var speed2 = (fold * 0.36);
	var speed3 = (fold * 0.28);
	$(".novelty_index .feathen1").css({ top: 0 + speed1 },400,'swing');
	$(".novelty_index .feathen2").css({ top: 0 + speed2 },400,'swing');
	$(".novelty_index .feathen3").css({ top: 0 + speed3 },400,'swing');
	*/
	
	return true;
}



/* Steps Animation
	function stepsFadeIn(){
		$('.top_item_block').fadeTo(700, 0.8, function(){
			$(this).fadeTo(400, 0.3, function(){
				$(this).fadeTo(200, 1, function(){
					$(this).fadeTo(150, 0.1, function(){
						$(this).fadeTo(100, 0.9, function(){
							$(this).fadeTo(100, 0.2, function(){
								$(this).fadeTo(50, 0.9, function(){
									$(this).fadeTo(50, 0.1, function(){
										$(this).fadeTo(150, 1, function(){
											$(this).removeClass('fade');
											if ($(this).next().length > 0) {
												$(this).next().addClass('fade');
												$(this).animate({opacity: 1}, 150, function(){
													stepsFadeIn();
												});
											}
										});
									});
								});
							});
						});
					});
				})
			})
		});
	}
	$(document).ready(function(){
		if (!$.browser.msie) {
			$('.top_item_block').fadeTo(0, 0);
			stepsFadeIn();
		}
	});
*/

