  $(document).ready(function(){
    $(".drag").draggable({ 
//		  revert: false,
		  zIndex:1000,
    	  drag: function(e,ui) { 
//		     $(ui.helper).css("zIndex","1000");
//		     $("#position").text("слева: " + ui.position.left + "px, сверху: " + ui.position.top + "px");
		  },
		  stop: function(e,ui) {
//		  	$(this).css("background-color", "#58AEFC");
		  }
    });
    $("#close").click(function(){
        $("#banner_bg").animate({ opacity: "hide" }, "slow");
        return false;
    });
    $("#close").hover(function(){
        $("#close").animate({ opacity: "0.5" }, "slow");
    },function(){
        $("#close").animate({ opacity: "1" }, "slow");
    });
   /* $(".rm").hover(function(){
        $(this).find('span').slice(0,1).animate({ left: "5px" }, 100);
        $(this).css("background", "#e7dccc");
        $(this).css("padding-right", "5px");
        $(this).find('div').slice(0,1).css("background", "#b2a69b");
    },function(){
        $(this).find('span').slice(0,1).animate({ left: "0px" }, 100);
        $(this).css("background", "");
        $(this).css("padding-right", "");
        $(this).find('div').slice(0,1).css("background", "");
    });*/
   $(".rm").hover(function(){
        $(this).find('span').slice(0,1).animate({ left: "3px" }, 100);
    },function(){
        $(this).find('span').slice(0,1).animate({ left: "0px" }, 100);
    });
    
   $(".prev_t").hover(function(){
        $(this).find('span').slice(0,1).animate({ left: "-5px" }, 100);
    },function(){
        $(this).find('span').slice(0,1).animate({ left: "0px" }, 100);
    });
    
   $(".next_t").hover(function(){
        $(this).find('span').slice(0,1).animate({ right: "-5px" }, 100);
    },function(){
        $(this).find('span').slice(0,1).animate({ right: "0px" }, 100);
    });
    
	function getGroupItems(opts) {
		$("#fancy_close").hover(function(){
        	$("#fancy_close").animate({ opacity: "0.5" }, "slow");
    	},function(){
        	$("#fancy_close").animate({ opacity: "1" }, "slow");
    	});
		jQuery.each(imageList, function(i, val) {
	        if (val!=undefined) opts.itemArray.push(val);
	    });
	}
    
	$("#custom").fancybox({
		hideOnContentClick: true,
    	overlayShow: true,
    	overlayOpacity: 0.5,
    	zoomSpeedIn: 1500,
    	zoomSpeedOut: 600,
	    itemLoadCallback: getGroupItems
	});
	
	$("#frm_a").fancybox({
		hideOnContentClick: false,
    	overlayShow: true,
    	overlayOpacity: 0.5,
    	zoomSpeedIn: 0,
    	zoomSpeedOut: 0,
    	frameWidth: 700,
    	frameHeight: 600,
    	aSize: 1
    });
    
    $(".crea a").fancybox({
    	hideOnContentClick: true,
    	overlayShow: true,
    	overlayOpacity: 0.5,
    	zoomSpeedIn: 1500,
    	zoomSpeedOut:600
    });
    
    $("#o_ph").fancybox({
    	hideOnContentClick: true,
    	overlayShow: true,
    	overlayOpacity: 0.5,
    	zoomSpeedIn: 1500,
    	zoomSpeedOut:600
    });
	
  });
  
	$(function()
	{
		$('.scroll-pane').jScrollPane({showArrows:true, scrollbarWidth:23, dragMaxHeight:35});
	});
