(function($) {
	
	$(document).ready(function() {
		
		$('#block_hp_1 .popup_menu, #block_hp_2 .popup_menu').animate({opacity: "0.0"}, 10);
		$('#block_hp_1 .popup_menu .blockItem, #block_hp_2 .popup_menu .blockItem1, #block_hp_2 .popup_menu .blockItem2').animate({opacity: "0.6"}, 10);
		
		$('#block_hp_1, #block_hp_2').hover(function(){
			//$('.popup_menu', this).fadeIn('slow'); - use animate() together with stop()
			$('.popup_menu', this).stop().animate({opacity: "1.0"}, 100);
		},function(){
			$('.popup_menu', this).stop().animate({opacity: "0.0"}, 100);
		});
		
		$('#block_hp_1 .popup_menu .blockItem, #block_hp_2 .popup_menu .blockItem1, #block_hp_2 .popup_menu .blockItem2').hover(function(){
			$(this).stop().animate({opacity: "1.0"}, 500);
		},function(){
			$(this).stop().animate({opacity: "0.6"}, 100);
		});
		
		
		/*Hover over the switch area - home page*/
		$(".blockSwitchToPL a").hover(
 	     function () {
  	      $(this).parent().css({"background-position": "bottom left"});
 	     }, 
	      function () {
        $(this).parent().css({"background-position": "top left"});
	      }
	    );
	    
		/*Hover over the switch area - common page*/
	    $(".switch_to a").hover(
 	     function () {
  	      $(this).parent().css({"background-position": "bottom left"});
 	     }, 
	      function () {
        $(this).parent().css({"background-position": "top left"});
	      }
	    );
	    
	    
		$(".left_menu ul li a").hover(
 	     function () {
 	     	$(this).parent().addClass('hovered');
 	     }, 
	      function () {
	      	$(this).parent().removeClass('hovered');
	      }
	    );

		// Set captcha by JS
		$("input[name='cap_prot']").val('1');
		
		// **********************************
		// ProductDetails page LIGHTBOX START
		// **********************************
		$("a.smallPic img").fadeTo(200, 0.8);
		
		$(".productDetailsPictures .smallPic").hover(function() {
			var thisHREF = $(this).attr("href");
			var thisALT = $(this).find("img").attr("alt");
			$(".productDetailsPictures .big_frame a").attr("href", thisHREF);
			$(".productDetailsPictures .big_frame a img").fadeTo(200, 0.1, function() {
				$(this).attr("src", thisALT).fadeTo(200, 1);
			});
			$("img", this).fadeTo(200, 1);
		}, function() {
			$("img", this).fadeTo(200, 0.4);
		});
		
		$("#one_product_carousel_section .smallPic").click(function() {
			return false;
		});

		
		$('.lightbox').lightBox({
			overlayBgColor: '#000',
			overlayOpacity: 0.8,
			imageLoading: '/images/lightbox/lightbox-ico-loading.gif',
			imageBtnClose: '/images/lightbox/lightbox-btn-close.gif',
			imageBtnPrev: '/images/lightbox/lightbox-btn-prev.gif',
			imageBtnNext: '/images/lightbox/lightbox-btn-next.gif',
			containerBorderSize: 10,
			containerResizeSpeed: 350
		});

		
/*
		$(function()
		{
			$('a.lightbox').lightBox();
		});
*/
		
		// ********************************
		// ProductDetails page LIGHTBOX END
		// ********************************
		
		// Hover over the home page links to JPL and PL&CO
		$(".content_hp .blockImage a").hover(
 	     function () {
  	      $(this).css({"background-position": "bottom left"});
 	     }, 
	      function () {
        $(this).css({"background-position": "top left"});
	      }
	    );

		
	    
	    
	});
	
})(jQuery);
