var counter=0;
var maxcounter=0;
var totalimage=0;
var scrollamount=724;

$(document).ready(function(){
						
						
							iesevenFixing();
							
						   	totalimage=$('#thumbsX').find('img').length
							maxcounter=Math.ceil(totalimage/4);
					   		
							
						   $('#thumbsX').find('img').each(function(n){
																   		$(this).css('left',181*n);
																   	
																   	});
						   $('.arrowRight').bind('click',moveFunction)
						   $('.arrowLeft').bind('click',moveFunction)
						   
						   });


function moveFunction(e)
{
  var classic = $(this).attr('class')
  
  switch(classic	)
  {
	  
	case "arrowRight":
	if(counter>0)
			{
			counter--;
			tgt=scrollamount*counter*(-1)
			moveNow(tgt)
			}
	break;
	
	case "arrowLeft":
	 if(counter<(maxcounter-1))
		  {
		  counter++;
		  tgt=scrollamount*counter*(-1)
		  moveNow(tgt)
		  }
	break;
	
	  
  }
}

function moveNow(amt){
		
		  $('#thumbsX').animate({left:amt},1000)
		
		}
		
		
		
function iesevenFixing()
{
	if($.browser.msie)
	{
		
		
		
		jQuery.each(jQuery.browser, function(i, val) { ieversion = val; });
		if(ieversion == '9.0' ||  ieversion == '10.0')
		{
			//do nothing
			
		}
		else
		{
			
			 $('#thumb_containerX').css('position','static');
			 $('#thumb_containerX').css('overflow','hidden');
			 $('#gallery_containerX').css('overflow','hidden');
			 $('#thumb_containerX #thumbsX').css('left','0px');
			 
		}
		
		
	
		
	}
}
		
