var current = 1;
function swapImage(id){
	
       clearInterval(this.timer);
       this.timer = setInterval("swapImageAuto()",3000);
       swapImageFunc(id);
	
}

function swapImageFunc(id){
       $('#mainImage'+this.current).fadeOut('slow');

       $('#mainImage'+id).fadeIn('slow');

       this.current = id;
	  
}


var timer = null;

function autoslide(){
       this.timer = setInterval("swapImageAuto()",5000);
}

function swapImageAuto(){
	//alert(this.current+','+this.total)
       if(this.current<this.total){
               swapImageFunc(parseInt(this.current+1,10));
			   
       }
       else
       if(this.current==this.total){
               swapImageFunc(1);
       }
}


