jQuery(function()
{
  position = parseInt($('#gallery_image div').css('left').replace('px',''));
                       number=$("#gallery_image").find('li').length;
                       different=number-4;
                       if (different<=0) {1==1} else
                       different_flag=different;

                       $('.right_p').click(function(){
                                               if (different>0)
                                               {

                                                 position = position - 219;
                                                 $('#gallery_image div').animate({left:position}, "fast");
                                                 different=different-1;

                                                }

                                                return false;
                                                })

                       $('.left_p').click(function(){
                                               if (different<different_flag)
                                               {

                                                 position = position + 219;
                                                 $('#gallery_image div').animate({left:position}, "fast");
                                                 different=different+1;

                                               }

                       return false;})


  position1 = parseInt($('#gallery_image_bottom div').css('left').replace('px',''));
                       number1=$("#gallery_image_bottom").find('img').length;
                       different1=number1-4;
                       if (different1<=0) {1==1} else
                       different_flag1=different1;

                       $('.right_p_b').click(function(){
                                               if (different1>0)
                                               {

                                                 position1 = position1 - 226;
                                                 $('#gallery_image_bottom div').animate({left:position1}, "fast");
                                                 different1=different1-1;

                                                }

                                                return false;
                                                })

                       $('.left_p_b').click(function(){
                                               if (different1<different_flag1)
                                               {

                                                 position1 = position1 + 226;
                                                 $('#gallery_image_bottom div').animate({left:position1}, "fast");
                                                 different1=different1+1;

                                               }

                       return false;})

});