 jQuery(document).ready(function() { 
	// adding animation to navigation
	
	//$posArray = jQuery('#header .nav a').css('top'); 
	jQuery('#header .nav .item2 a').attr({ rel : 'item1'});
	jQuery('#header .nav .item3 a').attr({ rel : 'item2'});
	jQuery('#header .nav .item4 a').attr({ rel : 'item3'});
	jQuery('#header .nav .item5 a').attr({ rel : 'item4'});
		 		
	jQuery('#header .nav a').hover( function() {
		//$topPos = jQuery(this).css('top');
		$topPos = '-70px';
		$currItem = jQuery(this).attr('rel');
		if (($currItem == 'item2') || ($currItem == 'item4' )) { $topPos = '-60px' }
		else if ($currItem == 'item5') { $topPos = '-70px' };
		 jQuery(this).animate( { top: "-30px" }, 400, "easeOutBack" ) },
	 	function() { jQuery(this).animate ({ top: $topPos }, 600, "easeOutElastic" ) }
	);
	
	// animate the sun
	jQuery('.sun').wrap('<em class="around-sun"></em>');
	jQuery('.sun').pulse({ speed: 1200, opacityRange: [1, 0.5] } );
	
	//animate feature items
	var feat1top = jQuery('.feat1 img').css('top');
	var feat3top = jQuery('.feat3 img').css('top');
	var feat1left = jQuery('.feat1 img').css('left');
	var feat3left = jQuery('.feat3 img').css('left');
	var feat1W = jQuery('.feat1 img').attr('width');
	var feat1H = jQuery('.feat1 img').attr('height');
	var feat2W = jQuery('.feat2 img').attr('width');
	var feat2H = jQuery('.feat2 img').attr('height');
	var feat3W = jQuery('.feat3 img').attr('width');
	var feat3H = jQuery('.feat3 img').attr('height');
	
	var coeff = 1.05;
	
	var feat1Wpx = feat1W+'px';
	var feat1Hpx = feat1H+'px';
	var feat2Wpx = feat2W+'px';
	var feat2Hpx = feat2H+'px';
	var feat3Wpx = feat3W+'px';
	var feat3Hpx = feat3H+'px';

	var new1Wpx = Math.round(feat1W * coeff)+'px';
	var new3Wpx = Math.round(feat3W * coeff)+'px';
	var new1Hpx = Math.round(feat1H * coeff)+'px';
	var new3Hpx = Math.round(feat3H * coeff)+'px';	
		
	jQuery('.feat1 img').hover( 
		function() { jQuery(this).animate( { height: new1Hpx, width: new1Wpx, left: '15px', top: '35px' }, 100 ) }, 
		function() { jQuery(this).animate( { height: feat1Hpx, width: feat1Wpx, left: feat1left, top: feat1top } ) }  
		);
	
	jQuery('.feat3 img').hover( 
		function() { jQuery(this).animate( { height: new3Hpx, width: new3Wpx, left: '15px', top: '50px' }, 100) }, 
		function() { jQuery(this).animate( { height: feat3Hpx, width: feat3Wpx, left: feat3left, top: feat3top } ) }  
		);

	jQuery('.feat2 img').hover( 
		function() { 
			jQuery(this).animate( { height: '279px', width: '328px', left: '-2px', top: '-2px' }, 100) }, 
			function() { jQuery(this).animate( { height: feat2Hpx, width: feat2Wpx, left: 0, top: 0 }, 100 ); }
		);
	
	
	// other product list on the home page - make whole <li> clickable
	jQuery('.oth-prod-list li').css('cursor', 'pointer').click(function() {window.location = jQuery('a', this).attr('href'); });

	jQuery('.catalog li').css('cursor', 'pointer').click(function() {window.location = jQuery('a', this).attr('href'); });
	jQuery('.catalog li').hover( function() { jQuery('.lnk-view', this).css( 'background-position', '0 -24px'); }, 
	function() { jQuery('.lnk-view', this).css( 'background-position', '0 0'); });			
	jQuery('.ru .catalog li').hover( function() { jQuery('.lnk-view', this).css( 'background-position', '-47px -24px'); }, function() { jQuery('.lnk-view', this).css( 'background-position', '-47px 0'); });
	jQuery('.lv .catalog li').hover( function() { jQuery('.lnk-view', this).css( 'background-position', '-121px -24px'); }, function() { jQuery('.lnk-view', this).css( 'background-position', '-121px 0'); });


		
	// striped tables and styling of the exhibition table
	jQuery('#home .table-exh-inner tr').hide();
	jQuery('td.show').parent('tr').show().addClass('show');
	jQuery('.table-exh tr.show:odd').addClass('bg2');
	jQuery('.table-exh tr td:nth-child(2)').addClass('date');
	
});



