function commends(id,commendid)
{
	getId("commend"+commendid+id).innerHTML="<img src='../skins/images/loading.gif' />";
	ajax("admin_ajax.asp","id="+id+"&commendid="+commendid,"commend"+commendid+id);	
}

function admin_pro(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]=="move"||type[0]=="copy"||type[0]=="tolist"||type[0]=="todesc"||type[0]=="toall")
			{
				showMsg(type[1],"<iframe src='product/products_admin.asp?action="+type[0]+"&ids="+idstr+"' scrolling='no' width='100%' height='500' frameborder='0' style='overflow-x:hidden'></iframe>",900,0);
			}
			else
			{
				var sec=ajax("products_admin.asp","ids="+idstr+"&action="+type[0],"");
				location.href=url;
			}
		}
	}
	else
	{
		getId("def_").selected=true;
	}
}

function upFileOption(AllowTypes,AllowSize)
{
	var maxnum=9
	var UpFileNum = getId("UpFileNum").value;
	if(UpFileNum=='')
	UpFileNum=1;
	var k,i,Optionstr,n=0;
	Optionstr=""
	for(k=0;k<UpFileNum;k++)
	{
		n=n+1;
		Optionstr = Optionstr+'<input class="fileckbg" name="bigpic" id="bigpic'+n+'" type="text" size="40" maxlength="150" readonly /> ';
		Optionstr = Optionstr+'<input type="button" onClick="setfile(\''+lan_fileadmin+'\',\'/images/propic/\',\'bigpic'+n+'\',\'|types='+AllowTypes+'|size='+AllowSize+'|\')" value="'+lan_selectpic+'" />';		
		Optionstr = Optionstr+' <input class="fileckbg" name="smallpic" id="smallpic'+n+'" type="text" size="40" maxlength="150" readonly /> ';
		Optionstr = Optionstr+'<input type="button" onClick="setfile(\''+lan_fileadmin+'\',\'/images/propic/\',\'smallpic'+n+'\',\'|types='+AllowTypes+'|size='+AllowSize+'|\')" value="'+lan_selectsmall+'" />';
		Optionstr = Optionstr+'<br />';		
		if(n==UpFileNum||n>=maxnum)break;
	}
	getId("FilesList").innerHTML = Optionstr;
}

function objNameIo(name,io)
{
	var obj=getName(name);
	var dis="none";
	if(io)dis="";
	for(i=0;i<obj.length;i++)
	{
		obj[i].style.display=dis;	
	}
}


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

function delthepic(i)
{
	var obj1=getId("bigpic"+i);
	var obj2=getId("bigpic2"+i);
	var obj3=getId("smallpic"+i);
	var obj4=getId("smallpic2"+i);
	var obj5=getId("del"+i);
	for(ii=1;ii<=5;ii++)
	{
		eval("obj"+ii+".style.display=\'none\';");
		eval("obj"+ii+".value=\'\';");
	}
}