function commends(id,commendtype)
{
	getId(commendtype+id).innerHTML="<img src='../skins/images/loading.gif' />";
	var sec=ajax("admin_ajax.asp","id="+id+"&commendtype="+commendtype,commendtype+id);	
	if(sec!="-")
	{
		if(commendtype=="intop_")
		{
			if(sec.indexOf(lang_cancel)>0)
			{
				getId("intop_pic_"+id).style.display="inline";
			}
			else
			{
				getId("intop_pic_"+id).style.display="none";
			}
		}
		else if(commendtype=="commend_")
		{
			if(sec.indexOf(lang_cancel)>0)
			{
				getId("commend_pic_"+id).style.display="inline";
			}
			else
			{
				getId("commend_pic_"+id).style.display="none";
			}	
		}
	}
	else
	{
		getId(commendtype+id).innerHTML="<b style='text-decoration:line-through'>Error</b>";
	}
}
function admin_news(types)
{
	var type=types.split("|");
	var ids=getName("id");
	var idstr="";
	if(type[0]=="re"||type[0]=="del2"){url="?recycle=1";}else{url="?1=1";}
	for(var i=0;i<ids.length;i++)
	{
		if(ids[i].checked)
		idstr+=ids[i].value+",";
	}
	if(types!=""&&idstr.replace(",","")!="")
	{	
		if(confirm(type[1]+"？"))
		{
			if(type[0]=="toall"||type[0]=="tolist"||type[0]=="todesc"||type[0]=="move")
			{
				showMsg(type[1],"<iframe src='news/news_admin.asp?action="+type[0]+"&ids="+idstr+"' scrolling='no' width='100%' height='500' frameborder='0' style='overflow-x:hidden'></iframe>",900,0);
			}
			else
			{
				ajax2("news_admin.asp","ids="+idstr+"&action="+type[0]);
				location.href=url;
			}
		}
	}
	else
	{
		getId("def_").selected=true;
	}
}

function checksave()
{
	var obj=getId("title");
	var obj2=getId("classid");
	//var content=getFCK("content");
	if (obj.value=="")
	{
		alert(news_n12);
		obj.focus();
		return false;
	}
	if (obj2.value=="")
	{
		alert("Error type！");
		obj2.focus();
		return false;
	}	
	lock_button("Submit1","Submit2","loading","<img src='../skins/images/loading.gif' /> "+lan_savemes);
}

function setnow(id,nowt)
{
	var obj=getId(id);
	if(obj){obj.value=nowt;}
}