/*

v.0001 
Date:  25.01.2012 0:44:45 (GMT)
developed by: DevLeader
site: http://devleader.net

*/
jQuery.fn.nscroller = function(options){
	var options = jQuery.extend({
	    object:null,
	    delay:10000,
	    items:0,
	    citem:0,
	    nitem:0,
	    btn_next:'#nscroller-next',
	    btn_prev:'#nscroller-prev',
	    timeEl:null
  },options);
	return this.each(function() {
		options.object = this;
		options.items = jQuery(options.object).find('a').length;
		jQuery(options.object).find('a').hide();
		jQuery(options.btn_next).bind('click',function(){
			options.nitem++;
			if (options.nitem >= options.items) options.nitem = 0;
			clearTimeout(options.timeEl);
			activate_element();
			return false;
		});
		jQuery(options.btn_prev).bind('click',function(){
			options.nitem--;
			if (options.nitem < 0) options.nitem = options.items-1;
			clearTimeout(options.timeEl);
			activate_element();
			return false;
		});
		activate_element();
	});
	function activate_element(){
		jQuery(options.object).find('a:eq('+options.citem+')').hide();
		jQuery(options.object).find('a:eq('+options.nitem+')').fadeIn('slow');
		options.citem = options.nitem;
		options.timeEl = setTimeout(function(){jQuery(options.btn_next).click();},options.delay);
	}	
	function nscroller_process(){
		
	}
	
};
