/* 
/*
 * Equatorland Slider For (for jQuery)
 * version: alpha
 * @requires jQuery v1.2 or later
 * @mail blackminute#gmail.com
 */
$.fn.eqShow = function(options) {
				defaults = {
					imgDiv: '#container',
					controller: '#thumbs',
					idle: 3000,
                                        effectSpeed: 500
				}
				var options = jQuery.extend(defaults,options);
				var count = $(options.controller+' li').attr('rel');
				var currentImage;
				var currentIndex = -1;
				var interval;
				 
				
				function showImage(index){					
						if(index < $(options.imgDiv+' img').length){
							var indexImage = $(options.imgDiv+' img')[index]
							if(currentImage){   
								if(currentImage != indexImage ){
									$(currentImage).css('z-index',2);
									clearTimeout(myTimer);
//                                                                         $(currentImage).animate({                                                                               
//                                                                                backgroundColor: '#ffffff',
//                                                                                opacity: 0.0
//                                                                              }, options.effectSpeed );
									$(currentImage).fadeOut(250, function() {
										myTimer = setTimeout(function(){showNext();}, options.idle);
										$(this).css({'display':'none','z-index':1})
									});
								}
							}
							$(indexImage).css({'display':'block'});
                                                        $(indexImage).animate({                                                                               
                                                                                opacity: 1                                                                                                                                                                                                                                               
                                                                              }, options.effectSpeed );
							currentImage = indexImage;
							currentIndex = index;
							$(options.controller+' li').removeClass('active');
							$($(options.controller+' li')[index]).addClass('active');
							}
				}
				
                                function showNext(){
                                        var len = $(options.imgDiv+' img').length;							
                                        var next = currentIndex < (len-1) ? currentIndex + 1 : 0;
                                        showImage(next);
                                }																					
						
				var myTimer
				myTimer = setTimeout(function(){showNext();}, options.idle);
				showNext();
                               // 
				$(options.controller+' li').bind('click',function(e){
					var count = $(this).attr('rel');       
                                       
					showImage(parseInt(count)-1);
					preventDefault(e);
				});
			}	
