﻿		/* start ----- play img*/
		var curr = 0, next = 0, count = 0;
		$(document).ready(function() {	
			count = $('#img_list a').size();	
			
			t = setInterval('imgPlay()', 5500);
			
			$('.banner_1 li, #img_list a').hover(function() {
				clearInterval(t);
			}, function() {
				t = setInterval('imgPlay()', 9500);
			});
			
			
			$('#img_list a').click(function() {
				var index = $('#img_list a').index(this);
				if(curr != index) {
					play(index);
					curr = index;
				};
				return false;
			});
			
		});
		
		var imgPlay = function() {
			next = curr + 1;
			if(curr == count-1) next=0;
			play(next);
			
			curr++;
			if(curr > count-1) { curr=0; next = curr +1; }
		};
		
		var play = function(next) {
			$('.banner_1 li').eq(curr).css({'opacity': '0.5'}).animate({'left': '-950px', 'opacity': '1'}, 'slow', function() {
										 	$(this).css({'left': '950px'});
										 }).end()
									 .eq(next).animate({'left': '0px', 'opacity': '1'}, 'slow', function() {
										 	$('#img_list a').siblings('a').removeClass('active').end().eq(next).addClass('active');
										 });
		};
		/* endof ----- play img*/

