<!--
//验正是否为空
function Check_Empty(form,name,str)
{
	if (document.all[form].all[name].value=="")
	{
		alert(str);
		document.all[form].all[name].focus();
		return true;
	}
}
//验正两项不能同时为空
function Check_Emptys(form,name,name2,str)
{
	if (!(document.all[form].all[name].selected && document.all[form].all[name2].selected))
	{
		alert(str);
		document.all[form].all[name].focus();
		return true;
	}
}

//验正表密码
function Check_Password(form,name,name2,str,str2)
{
	if(document.all[form].all[name].value=="" || document.all[form].all[name].value.length < 6 || document.all[form].all[name].value.length >20)
	{
		document.all[form].all[name].focus();
		alert(str);
		return true;
	}
    if(document.all[form].all[name].value != document.all[form].all[name2].value)
	{
		document.all[form].all[name].focus();
		document.all[form].all[name].value = '';
		document.all[form].all[name2].value = '';
		alert(str2);
		return true;
	}
}


//验正字符多少位到多少位
function Check_NtoN(form,name,s,b,str)
{
	if(document.all[form].all[name].value.length<s || document.all[form].all[name].value.length>b)
	{
		document.all[form].all[name].focus();
		alert(str);
		return true;
	}
}

//验正EMAIL
function Check_Email(form,name,str,str2)
{
	if(document.all[form].all[name].value.length!=0)
	{
		if (document.all[form].all[name].value.charAt(0)=="." ||        
		document.all[form].all[name].value.charAt(0)=="@"||       
		document.all[form].all[name].value.indexOf('@', 0) == -1 || 
		document.all[form].all[name].value.indexOf('.', 0) == -1 || 
		document.all[form].all[name].value.lastIndexOf("@")==document.all[form].all[name].value.length-1 || document.all[form].all[name].value.lastIndexOf(".")==document.all[form].all[name].value.length-1)
		{
			alert(str2);
			document.all[form].all[name].focus();
			return true;
		}
	}
	else
	{
		alert(str);
		document.all[form].all[name].focus();
		return true;
	}

}


//验正是否为整数
function Check_Isnan(form,name,str)
{
	if (isNaN(document.all[form].all[name].value))
	{
		alert(str);
		document.all[form].all[name].focus();
		return true;
	}
}




//验证是否日期格式
function Check_Isdate(form,name,str)
{
	date=document.all[form].all[name].value
	execScript('inreturn=IsDate("'+date+'")','vbscript')
	if (inreturn==false)
	{  
		alert(str);
		document.all[form].all[name].focus();
		return true;
	}
}

//略缩图
var flag=false; 
function Edit_Image(ImgD,widthD,heightD)
{ 
	var image=new Image(); 
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0)
	{ 
		flag=true; 
		if(image.width/image.height>= widthD/heightD)
		{ 
			if(image.width>widthD)
			{ 
				ImgD.width=widthD; 
				ImgD.height=(image.height*widthD)/image.width; 
			}
			else
			{ 
				ImgD.width=image.width; 
				ImgD.height=image.height; 
			} 
			ImgD.alt=image.width+"x"+image.height; 
		} 
		else
		{ 
			if(image.height>heightD)
			{ 
				ImgD.height=heightD; 
				ImgD.width=(image.width*heightD)/image.height; 
			}
			else
			{ 
				ImgD.width=image.width; 
				ImgD.height=image.height; 
			} 
				ImgD.alt=image.width+"x"+image.height; 
			} 
	} 
} 

//显示另一张图片
function Change_Img(name,url)
{
	document.images[name].src=url
}

//自动提交
function AutoSubmit(form) 
{
	document.all[form].submit();
}

function popupsmall(url) {
	newWindow = window.open(url,'','menubar=no,toolbar=no,location=no,scrollbars=yes,resizable=no,width=400,height=450,screenX=50,screenY=50,top=50,left=50');
	newWindow.focus();
}

//-->
