(function($){


$.fn.newsFeature_function=function(){ 

/////////////////////////////////////           SLIDES
/*

$('.option').click(function(){
currentIndex=$(this).attr('loadIndex');
clearInterval(slideshowInterval);
slideshowInterval=setInterval(function() { 
fadeFeature();
}, 5000); 

//alert(currentIndex);

//currentIndex=1;

fadeFeature();

})
*/



$('.newsFeature_nextBtn').click(function(){
clearInterval(slideshowInterval);
slideshowInterval=setInterval(function() { 
fadeFeature();
}, 5000); 
fadeFeature();
})


$('.newsFeature_previousBtn').click(function(){
//alert(currentIndex);
if(currentIndex==1){currentIndex=($('.newsFeature').length-1);}
if(currentIndex==2){currentIndex=($('.newsFeature').length);}
if(currentIndex!=1&&currentIndex!=2){
currentIndex--;
currentIndex--;}
//currentIndex=$(this).attr('loadIndex');
clearInterval(slideshowInterval);
slideshowInterval=setInterval(function() { 
fadeFeature();
}, 5000); 
fadeFeature();
})





slideshowInterval=setInterval(function() { 
fadeFeature();
}, 5000); 



currentIndex=1;

function fadeFeature(){	
//reset
$('.newsFeature').hide();
$(".newsFeatureCaption").hide();
//fadeIn and slide In
$("#feature_"+currentIndex).fadeIn();
$("#featureCaption_"+currentIndex).slideDown();

if(currentIndex==$('.newsFeature').length){currentIndex=1}
else{currentIndex++;}
}


fadeFeature();

//CLOSE FEATURE FUNCTION
}
				
	
// CLOSE FUNCTION
})(jQuery);
		
