/*
$(document).ready(function(){
  var move;
  $('.btn_left').hoverIntent({
     sensitivity: 3,   
     interval:50,
     over: function(){
		var parentId = $(this).parent('div').attr('id');
		move = setInterval("$('.content_thumb', $('#"+parentId+"')).scrollTo('-=1px', {axis: 'y', duration: 10})", 10);
	 }, 
     timeout: 20, 
     out:function(){
		clearInterval(move);
	 }
  });
  $('.btn_right').hoverIntent({
     sensitivity: 3,   
     interval:50,
     over: function(){
		var parentId = $(this).parent('div').attr('id');
		move = setInterval("$('.content_thumb', $('#"+parentId+"')).scrollTo('+=1px', {axis: 'y', duration: 10})", 10);
	 }, 
     timeout: 20, 
     out:function(){
		clearInterval(move);
	 }
  });
});
*/

$(document).ready(function(){

  var move;
  $('.btn_left').hoverIntent({
     sensitivity: 3,   
     interval:10, 
     over: function(){
		var parentId = $(this).parent('div').attr('id');
		move = setInterval("$('.scroller', $('#"+parentId+"')).scrollTo('-=10px', {axis: 'x', duration: 10})", 10);
		//$('#img_menub').scrollTo('-=30px', {axis: 'x', duration: 10});
	 }, 
     timeout: 10, 
     out:function(){
		clearInterval(move);
	 }
  });
  $('.btn_right').hoverIntent({
     sensitivity: 3,   
     interval:10, 
     over: function(){
		var parentId = $(this).parent('div').attr('id');
		move = setInterval("$('.scroller', $('#"+parentId+"')).scrollTo('+=10px', {axis: 'x', duration: 10})", 10);
		//$('#img_menub').scrollTo('+=30px', {axis: 'x', duration: 10});
	 }, 
     timeout: 10, 
     out:function(){
		clearInterval(move);
	 }
  });

  $('.btn_top').hoverIntent({
     sensitivity: 3,
     interval:10,
     over: function(){
        var parentId = $(this).parent('div').attr('id');
        move = setInterval("$('.scroller', $('#"+parentId+"')).scrollTo('-=5px', {axis: 'y', duration: 10})", 10);
        //$('#img_menub').scrollTo('-=30px', {axis: 'x', duration: 10});
     },
     timeout: 10,
     out:function(){
        clearInterval(move);
     }
  });
  $('.btn_bottom').hoverIntent({
     sensitivity: 3,
     interval:10,
     over: function(){
        var parentId = $(this).parent('div').attr('id');
        move = setInterval("$('.scroller', $('#"+parentId+"')).scrollTo('+=5px', {axis: 'y', duration: 10})", 10);
        //$('#img_menub').scrollTo('+=30px', {axis: 'x', duration: 10});
     },
     timeout: 10,
     out:function(){
        clearInterval(move);
     }
  });

  $('li.thumb a').click(function(){
    var id = $('div.img span.image_id').text();
    $('li#image_'+id+' a').removeClass('select_thumb');
    $('li#image_'+id+' a img').addClass('no_select_thumb');
    $(this).addClass('select_thumb');
    $(this).children('img').removeClass('no_select_thumb');
    $('div.img div.title_img h2 span.title_name').text($('span.image_name', this).text());
    $('div.img div.title_img h2 span.title_author').text($('span.image_author', this).text());
    $('div.img span.image_id').text($(this).parent().attr('id').substr($(this).parent().attr('id').indexOf('_')+1));
    $('div.img div.img_product img').attr('src', $('span.image_image', this).text());
    $('div.img div.img_product img').attr('alt', $('span.image_name', this).text());
    return false;
  });

});