$(document).ready(function(){

  $("#master_slider img").click(function(){
    	var index = eval($("#master_slider img").index(this));
			//sliderBox
				$("#slide, .active").removeClass("active");
  		 		$("#slide p:eq("+(index)+")").toggleClass("active");
  		 		$("#slide span:eq("+(index)+")").toggleClass("active");
  		 		$("#master_slider img:eq("+(index)+")").toggleClass("active");
  		 	//hide
  		 	if(index==0){
  		 		$("#master_slider").animate({
  		 		width: "644px",
  		 		marginRight: "0"
  		 		},1000);
  		 		}
  		 	if(index==1){
  		 		$("#master_slider").animate({
  		 		width: "715px",
  		 		marginRight: "137px"
  		 		},1000);
  		 		}
  		 	if(index>1){
  		 		$("#master_slider").animate({
  		 		width: "946px",
  		 		marginRight: "10px"
  		 		},1000);
  		 		}


  		   		$("li:eq("+(index-3)+")").animate({
  		 		width: "0px",
  		 		marginTop: "65px"
  		 		},1000);
  		 		$("li:eq("+(index-4)+")").animate({
  		 		width: "0px",
  		 		marginTop: "65px"
  		 		},1000);

  		 	//index

  		 		$("#master_slider img:eq("+(index)+")").animate({
  		 		height: "292px",
  		 		width: "334px",
  		 		margin: "0",
  		 	 	opacity: "1"
  		 		},1000);
  		 		$("li:eq("+(index)+")").animate({
  		 		width: "334px",
  		 		height: "292px",
  		 		margin: "0"
  		 		},1000);

  		 	//leftFisrt
  		 		$("#master_slider img:eq("+(index-1)+")").animate({
  		 		height: "218px",
  		 		marginBottom: "17px",
  		 	 	marginRight: "-29px",
  		 	 	opacity: "0.8"
  		 		},1000);
  		 		$("li:eq("+(index-1)+")").animate({
  		 		width: "190px",
  		 		height: "252px",
  		 		marginTop: "40px"
  		 		},1000);
  		 	//leftSecond
  		 		$("#master_slider img:eq("+(index-2)+")").animate({
  		 		height: "157px",
  		 		marginBottom: "17px",
  		 	 	marginRight: "-29px",
  		 	 	opacity: "0.8"
  		 		},1000);
  		 		$("li:eq("+(index-2)+")").animate({
  		 		width: "116px",
  		 		height: "227px",
  		 		marginTop: "65px"
  		 		},1000);
  //right
			//rightFirst
			  	$("#master_slider img:eq("+(index+1)+")").animate({
  		 		height: "218px",
  		 		marginBottom: "17px",
  		 	 	marginLeft: "-29px",
  		 	 	opacity: "0.8"
  		 		},1000);
  		 		$("li:eq("+(index+1)+")").animate({
  		 		width: "190px",
  		 		height: "252px",
  		 		marginTop: "40px"
  		 		},1000);
  		 	//rightSecond
			  	$("#master_slider img:eq("+(index+2)+")").animate({
  		 		height: "157px",
  		 		marginBottom: "17px",
  		 	 	marginLeft: "-29px",
  		 	 	opacity: "0.8"
  		 		},1000);
  		 		$("li:eq("+(index+2)+")").animate({
  		 		width: "116px",
  		 		height: "227px",
  		 		marginTop: "65px"
  		 		},1000);

	});
				$("#master_slider img").mouseover(function(){
				       			$(this).css("cursor","pointer").animate({
								opacity: "1"},0);
				});
				$("#master_slider img").mouseout(function(){
				       			$(this).animate({
								opacity: "0.8"},0);

				});


});
