var gallery=new Array('finished_leathers','product1','product2','product3');
gallery['finished_leathers']=new Array('shirt1_small.png','shirt3_small.png','shirt4_small.png','shirt2_small.png');
gallery['product1']=new Array('bag2_small.png','bag_small.png','belts_small.png','gloves_small.png');
gallery['product2']=new Array('shoe1_small.png','shoe2_small.png','slipper1_small.png','slipper2_small.png');
gallery['product3']=new Array('leather1_small.png','leather2__small.png','leather3_small.png','leather4_small.png');

var temp;
$(document).ready(function()
{
	  $("#imgthumb0").mouseover(function ()
	  {
		$(this).fadeTo("slow", 0.33);
		$("#imgbig").fadeTo("fast", 0);
		$("#imgbig").hide();
		temp=document.getElementById("imgthumb0").src;
		temp=temp.split("_");
		document.getElementById("imgbig").src=temp[0]+".png";
		$("#imgbig").show("fast");
		$("#imgbig").fadeTo("slow", 1);
		
	  });
	  
	  $("#imgthumb0").mouseout(function ()
	  {
		$(this).fadeTo("slow", 1.0);
	  });
		
		
		
		  $("#imgthumb1").mouseover(function ()
	  {
		$(this).fadeTo("slow", 0.33);
		
		$("#imgbig").fadeTo("slow", 0);
		$("#imgbig").hide();
		temp=document.getElementById("imgthumb1").src;
		temp=temp.split("_");
		document.getElementById("imgbig").src=temp[0]+".png";
		$("#imgbig").show("fast");
		$("#imgbig").fadeTo("slow", 1);
		
	  });
	  
	  $("#imgthumb1").mouseout(function ()
	  {
		$(this).fadeTo("slow", 1.0);
	  });
		
		
		
		  $("#imgthumb2").mouseover(function ()
	  {
		$(this).fadeTo("slow", 0.33);
		$("#imgbig").fadeTo("slow", 0);
		$("#imgbig").hide();
		temp=document.getElementById("imgthumb2").src;
		temp=temp.split("_");
		document.getElementById("imgbig").src=temp[0]+".png";
		
		$("#imgbig").show("fast");
		$("#imgbig").fadeTo("slow", 1);
	  });
	  
	  $("#imgthumb2").mouseout(function ()
	  {
		$(this).fadeTo("slow", 1.0);
	  });
		
		
		  $("#imgthumb3").mouseover(function ()
	  {
		$(this).fadeTo("slow", 0.33);
		$("#imgbig").fadeTo("slow", 0);
		$("#imgbig").hide();
		temp=document.getElementById("imgthumb3").src;
		temp=temp.split("_");
		document.getElementById("imgbig").src=temp[0]+".png";
			$("#imgbig").show("fast");
		$("#imgbig").fadeTo("slow", 1);
	  });
	  
	  $("#imgthumb3").mouseout(function ()
	  {
		$(this).fadeTo("slow", 1.0);
	  });
		
 
});

function change_gallery(val)
{
		$("#imgthumb0").fadeTo("slow", 0.33);
		$("#imgthumb0").hide();
		
		document.getElementById('imgthumb0').src="images/gallery/"+gallery[val][0];
		$("#imgthumb0").show("slow");
		$("#imgthumb0").fadeTo("slow", 1);
		
		
		$("#imgthumb1").fadeTo("slow", 0.33);
		$("#imgthumb1").hide();
		document.getElementById('imgthumb1').src="images/gallery/"+gallery[val][1];
		$("#imgthumb1").show("slow");
		$("#imgthumb1").fadeTo("slow", 1);
		
		
		
		$("#imgthumb2").fadeTo("slow", 0.33);
		$("#imgthumb2").hide();
		document.getElementById('imgthumb2').src="images/gallery/"+gallery[val][2];
		$("#imgthumb2").show("slow");
		$("#imgthumb2").fadeTo("slow", 1);
		
		
		$("#imgthumb3").fadeTo("slow", 0.33);
		$("#imgthumb3").hide();
		document.getElementById('imgthumb3').src="images/gallery/"+gallery[val][3];
		$("#imgthumb3").show("slow");
		$("#imgthumb3").fadeTo("slow", 1);
		
	
}
