jQuery.fn.gallSlide = function(_options){
	// defaults options	
	var _options = jQuery.extend({
		duration: 700,
		autoSlide: 5000
	},_options);

	return this.each(function(){
		var _hold = jQuery(this);
		var _speed = _options.duration;
		var _timer = _options.autoSlide;
		var _wrap = _hold.find('ul');
		var _el = _hold.find('ul > li');
		var _next = _hold.find('a.link-next');
		var _prev = _hold.find('a.link-prev');
		var _count = _el.index(_el.filter(':last'));
		_el.show();
		var _w = _el.outerWidth();
		var _wrapHolderW = Math.ceil(_wrap.parent().width()/_w);
		var _active = 0;
		var _H = _el.eq(_active).outerHeight(true);
		_el.parent().css('height', _H);
		var _descr = jQuery('div.discription p');
		
		var _txt = _el.eq(_active).find('img').attr('alt');
		_descr.html(_txt);
		
		
		function scrollEl(){
			_wrap.eq(0).animate({
				marginLeft: -(_w * _active) + "px"
			}, {queue:false, duration: _speed});
			_H = _el.eq(_active).outerHeight(true);
			_txt = _el.eq(_active).find('img').attr('alt');
			_descr.html(_txt);
			_el.parent().css('height', _H);
			_el.parents('div.box').css('height', _H + 150);
		}
		_next.click(function(){
			_active++;
			if (_active > (_count - _wrapHolderW + 1)) _active = 0;
			scrollEl();
			return false;
		});
		_prev.click(function(){
			_active--;
			if (_active < 0) _active = _count - _wrapHolderW + 1;
			scrollEl();
			return false;
		});
	});
}
