function swaptab(prefix,count,cur,activestyle,normalstyle){
	if(activestyle==undefined)activestyle="active";
	if(normalstyle==undefined)normalstyle="normal";
	for(var i=1;i<=count;i++){
		var curC=document.getElementById(prefix+i.toString());
		var curB=document.getElementById(prefix+"t"+i.toString());
		if(cur==i){
			curC.style.display="block";
			curB.className=activestyle;
		}else{
			curC.style.display="none";
			curB.className=normalstyle;
		}
	}
}

function pic_switch(id,interval,rate)
{
	if(interval==undefined)interval=5;
	if(rate==undefined)rate=1500;
	id="#"+id;
	var t=$(id);
	//$(id).hide();
	$(id).show();
	t.children().each(function(){
		$(this).hide();
	});
	var childs=t.children();
	var len=childs.length;
	childs.eq(0).show();
	t.attr("cur",1);
	$("body").everyTime(interval.toString()+"s",function(){
		var t=$(id);
		var childs=t.children();
		var len=childs.length;
		childs.each(function(){
			$(this).hide();
		});
		var cur=t.attr("cur");
		if(cur==undefined)
			cur=0;
		else
		{
			if(cur>=len)
				cur=0;
		}
		cur++;
		t.attr("cur",cur);
		childs.eq(cur-1).fadeIn(rate);
	});
}