function ValidateTextboxAdd(box, button)
{
 var buttonCtrl = document.getElementById( button );
 if ( buttonCtrl != null )
 {
 if (box.value == "" || box.value == box.helptext)
 {
 buttonCtrl.disabled = true;
 }
 else
 {
 buttonCtrl.disabled = false;
 }
 }
}
function test()
{
  if(!confirm('确认删除吗？')) return false;
}

function checkclick(msg){if(confirm(msg)){event.returnValue=true;}else{event.returnValue=false;}}

var flag=false;
function DrawImage(ImgD,w,h){
var image=new Image();
var iwidth = w; //定义允许图片宽度
var iheight = h; //定义允许图片高度
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= iwidth/iheight){
if(image.width>iwidth){ 
ImgD.width=iwidth;
ImgD.height=(image.height*iwidth)/image.width;
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
ImgD.alt=image.width+"×"+image.height;
}
else{
if(image.height>iheight){ 
ImgD.height=iheight;
ImgD.width=(image.width*iheight)/image.height; 
}else{
ImgD.width=image.width; 
ImgD.height=image.height;
}
ImgD.alt=image.width+"×"+image.height;
}
}
} 

function login2()
{

if (document.form.username.value == "")
{
alert("请输入您的会员名");
document.form.username.focus();
return false;
}
if (document.form.password.value == "")
{
alert("请输入您的密码");
document.form.password.focus();
return false;
}

return true;
}      


function checkform()
{

if (document.form.username.value == "")
{
alert("请填写用户名称");
document.form.username.focus();
return false;
}
if (document.form.password.value == "")
{
alert("请填写登录密码");
document.form.password.focus();
return false;
}
if (document.form.password2.value == "")
{
alert("请填写确认密码");
document.form.password2.focus();
return false;
}
if (document.form.password.value!=document.form.password2.value)
{
alert("两次输入的密码不一致");
document.form.password.value="";
document.form.password2.value="";
document.form.password.focus();
return false;
}
return true;
}  
