 $(document).ready(function(){	
	if($(".rotator").length) {
          rotate_show($(".rotator #q1"));
         }
});		
	function rotate_next(obj){	
		ids = $(obj).attr("id");
		ids = ids.replace("q","")*1;
		//alert(ids);
		if(ids<$(".rotator .quote").length) {
			idn = ids+1;
			rotate_show(".rotator #q"+idn);
			}
		else rotate_show(".rotator #q1");
	}
	
	function rotate_close(obj){	
		setTimeout(function() { $(obj).fadeOut(1500, function(){rotate_next(obj);} ); }, 7000);
		}
	function rotate_show(obj){		
		//ids = $(".rotator .q_act").attr("id");
		$(obj).fadeIn(1500,rotate_close(obj));
		
		}	