function check()
{
	if (document.form2.bigclass.value=="")
	{
		alert(EmptySelAlert);
		document.form2.bigclass.focus();
		return false;
	}
	if (document.form2.smallclass.value=="")
	{
		alert(EmptySelAlert);
		document.form2.smallclass.focus();
		return false;
	}
	if (document.form2.ku.value=="")
	{
		alert(EmptySelAlert);
		document.form2.ku.focus();
		return false;
	}
	if (document.form2.photo.value=="")
	{
		alert(EmptyFileAlert);
		return false;
	}
	document.getElementById("btnok").disabled=true;
	var loading=document.getElementById("loading");
	loading.style.display="block";
	document.form2.submit();
	return true;
}

function chgBigclass(obj)
{
	var bigclassval=obj.value;
	if(isEmpty(bigclassval))
	{
		var smallclass=document.getElementById("smallclass");
		smallclass.options.length=1;
	}
	else
	{
		var url="getSmallClass.asp?Action=smallclass&id="+bigclassval+"&d="+new Date();
		var loader=new net.ContentLoader(url,SetSmallClass);
	}
}

function SetSmallClass()
{
    var result = this.req.responseText;
	var id_huiyuan=document.getElementById("smallclass");
	if(result.length<=0)
	{
		id_huiyuan.options.length=1;
	}
	else
	{
		if(result.length>=3)
		{
			var ls=result.split(",");
			id_huiyuan.options.length=1;
			for (i=0;i<ls.length;i++ )
			{
				var lss=ls[i].split("$");
				id_huiyuan.add(new Option(lss[1],lss[0]));
			}
		}
	}
}

var alt="";
function checkhuohao(msg)
{
	var hh=getEle("tiaoma").value;
	alt=msg;
	if(!isEmpty(hh))
	{
		var url="checkHuohao.asp?huohao="+hh+"&d="+NewDate();
		var loader=new net.ContentLoader(url,popcheckHuohao);
	}
}

function popcheckHuohao()
{
    if(this.req.readyState==4)
    {
        if(this.req.status==200){
            var list=this.req.responseText;
			var huohao=getEle("tiaoma");
			if(list=="false")
			{
				alert("["+huohao.value+"] "+AlreadyExists);
				huohao.focus();
			}
			else
			{
				getEle("huohao").value=huohao.value;
			}
        }else{
            alert("Abnormal");
        }
    }
}

function checkBatch()
{
	if (document.form2.id_payment.value=="")
	{
		alert(EmptySelAlert);
		document.form2.id_payment.focus();
		return false;
	}
	if (document.form2.photo.value=="")
	{
		alert(EmptyFileAlert);
		return false;
	}
	document.getElementById("btnok").disabled=true;
	var loading=document.getElementById("loading");
	loading.style.display="block";
	document.form2.submit();
	return true;
}
