// JavaScript Document
jQuery(document).ready(function() {
	setInterval("fnInterval()",2000);
	jQuery('#box1 .smallBox').click(function() {
		jQuery(this).next('.bigBox').animate({ width: "952px"}, { queue:false, duration:800 } );

	});
	jQuery('#box2 .smallBox').click(function() {
		jQuery(this).next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });

	});
	jQuery('#box3 .smallBox').click(function() {
		jQuery(this).next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });

	});
	jQuery('#box4 .smallBox').click(function() {
		jQuery(this).next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 } );

	});
	jQuery('#box5 .smallBox').click(function() {
		jQuery(this).next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 } );

	});
	
	jQuery('#box1next').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0"}, { queue:false, duration:800 } );
		jQuery('#box2 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });
	});
	jQuery('#box2next').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0",marginLeft:'280px'}, { queue:false, duration:800 } );
		jQuery('#box3 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });	
	});
	jQuery('#box3next').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0",marginLeft:'480px'}, { queue:false, duration:800 } );
		jQuery('#box4 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });	
	});
	jQuery('#box4next').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0",marginLeft:'680px'}, { queue:false, duration:800 } );
		jQuery('#box5 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });
	});
	jQuery('#box5next').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0",marginLeft:'880px'}, { queue:false, duration:800 } );
		jQuery('#box1 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });
	});
	
	jQuery('#box1back').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0"}, { queue:false, duration:800 } );
		jQuery('#box5 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });
	});
	jQuery('#box2back').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0",marginLeft:'280px'}, { queue:false, duration:800 } );
		jQuery('#box1 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });	
	});
	jQuery('#box3back').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0",marginLeft:'480px'}, { queue:false, duration:800 } );
		jQuery('#box2 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });	
	});
	jQuery('#box4back').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0",marginLeft:'680px'}, { queue:false, duration:800 } );
		jQuery('#box3 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });
	});
	jQuery('#box5back').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0",marginLeft:'880px'}, { queue:false, duration:800 } );
		jQuery('#box4 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });
	});
	
	jQuery('#box1close').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0"}, { queue:false, duration:800 } );
	});
	jQuery('#box2close').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0",marginLeft:'280px'}, { queue:false, duration:800 } );
	});
	jQuery('#box3close').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0",marginLeft:'480px'}, { queue:false, duration:800 } );
	});
	jQuery('#box4close').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0",marginLeft:'680px'}, { queue:false, duration:800 } );
	});
	jQuery('#box5close').click(function() {
		jQuery(this).parents('.bigBox').animate({ width: "0",marginLeft:'880px'}, { queue:false, duration:800 } );
	});
	
	jQuery('.feedBtn').click(function() {
		jQuery(this).next().animate({width:'toggle'},350);
		jQuery(this).toggleClass('on')
	});
	
});
	function fnInterval()
	{
		var int = $("#hidVal").val();
		
		if(int==1){
			jQuery('#box5next').parents('.bigBox').animate({ width: "0"}, { queue:false, duration:800 } );
			jQuery('#box1 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });
			jQuery('#box1').parents('.bigBox').animate({ width: "0"}, { queue:false, duration:2000 } );
			$("#hidVal").val(2);
		}
		if(int==2){
			jQuery('#box1next').parents('.bigBox').animate({ width: "0",marginLeft:'179px'}, { queue:false, duration:800 } );
			jQuery('#box2 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });	
			$("#hidVal").val(3);
		}
		if(int==3){
			jQuery('#box2next').parents('.bigBox').animate({ width: "0",marginLeft:'358px'}, { queue:false, duration:800 } );
			jQuery('#box3 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });	
			$("#hidVal").val(4);
		}
		if(int==4){
			jQuery('#box3next').parents('.bigBox').animate({ width: "0",marginLeft:'537px'}, { queue:false, duration:800 } );
			jQuery('#box4 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });
			$("#hidVal").val(5);
		}
		if(int==5){
			jQuery('#box4next').parents('.bigBox').animate({ width: "0",marginLeft:'715px'}, { queue:false, duration:800 } );
			jQuery('#box5 .smallBox').next('.bigBox').animate({ width: "952px",marginLeft:0}, { queue:false, duration:800 });
			$("#hidVal").val(1);
		}
		
		
	}


