///////////////////////////////////////////////////
//                                               //
//				  slideme ! v 1.0                //
//			hossein dehbashi (Arad itc.)         //
//	      	   info@arad-itc.com                 //
//                                               //
///////////////////////////////////////////////////

var change_time = '3000'; // in miliseconds 

var Interval= setInterval("next_news('go')", change_time);

	var num = '2';
	
	function next_news(func){
	
	
		if(num != 1){
		var last = num-1;
			$("#"+last).removeClass("hover");
			$("#img"+last).fadeOut('fast');
		} else {
			$("#3").removeClass("hover");
			$("#img3").removeClass("visible");
		}
		$("#"+num).addClass("hover");
		$("#img"+num).fadeIn('slow');
	
		if(func=='go'){
			num++ ;
		} 	
		
		if(num>3) num = 1;
	}
	
$(document).ready(function() {

		$("#1").addClass("hover");
		$("#img1").addClass("visible");

	$(".textco").hover(
	  function () {
		    $(this).addClass("hover");
		    $("img.image:visible").fadeOut("fast");
		    $("img#img"+this.id).fadeIn("fast");
	  		clearInterval(Interval);
	  },
	  function () {
	    $(this).removeClass("hover");
		next_news('stop');
	    Interval= setInterval("next_news('go')", change_time);
	  }
	);
   
});
