var qnews={ids:[],timer:null,time:6000,cur:0,ouver:false,nunlock:false,init:function(){if($("#qnews .news").length>1){var b=0,a=$("#qnews .news").length-1;$("#qnews .news").each(function(){qnews.ids.push($(this).attr("id"));if(b!=a){$("#"+$(this).attr("id")).hide().css({opacity:0})}b++});window.setTimeout("qnews.auto();",qnews.timer)}else{if($("#qnews .news").length<1){qnews.xhide()}}},qnext:function(){var a=qnews.cur-1,b=qnews.cur;if(a<0){a=qnews.ids.length-1}$("#"+qnews.ids[b]).animate({opacity:0},600,"swing",function(){$(this).hide()});$("#"+qnews.ids[a]).show().animate({opacity:1},600,"swing");qnews.cur=a},qprev:function(){var b=qnews.cur+1,a=qnews.cur;if(b>=qnews.ids.length){b=0}$("#"+qnews.ids[a]).animate({opacity:0},600,"swing",function(){$(this).hide()});$("#"+qnews.ids[b]).show().animate({opacity:1},600,"swing");qnews.cur=b},auto:function(){var a=qnews.cur-1,b=qnews.cur;if(a<0){a=qnews.ids.length-1}qnews.xswitch(a,b)},xswitch:function(b,a){if((b<0)||b>=qnews.ids.length||b==qnews.cur){return}if(!qnews.over){window.clearTimeout(qnews.timer);$("#"+qnews.ids[a]).animate({opacity:0},600,"swing",function(){$(this).hide()});$("#"+qnews.ids[b]).show().animate({opacity:1},600,"swing");qnews.cur=b;qnews.timer=window.setTimeout("qnews.auto();",qnews.time)}else{qnews.nunlock=true}},xhide:function(){$("#qnews").html("").hide()}};$(document).ready(function(){$("#qnews").mouseover(function(){$(this).find(".nav").stop().animate({top:6},200);qnews.over=true});$("#qnews").mouseout(function(){$(this).find(".nav").stop().animate({top:-32},200);qnews.over=false;if(qnews.nunlock){qnews.nunlock=false;qnews.auto()}});$("#qnews .next").click(function(){qnews.qnext()});$("#qnews .prev").click(function(){qnews.qprev()})});
