<!--

//打开新窗口
var newWindow = null
function red_open(url,width,height)
{
        if (!newWindow||newWindow.closed)
        {
          newWindow = window.open(url,"sm","width="+width+",height="+height+",left=200,top=30,scrollbars=yes");
        }else
        {
          newWindow.focus();
        }
}


//检查是否为空
function red_check_null(obj,mesg)
{
if(obj.value=="")
  {mesg="您还没填写"+mesg+"哪！";
   alert(mesg);
   obj.focus();
  return false;

  }
else
 return true;
}

//检查类别
function red_check_cat(value,name)
 {
  if(value=="")
    {
     alert("   您还没选择类别哪！\n\n请点击选择左方或右方的类别。");
     return false;
    }
  else
     return true;
 }

function red_chk_change(obj)
 {
  if(obj.checked==true)chk_sum++;
  else chk_sum--;
 }


//投票控制
function red_check_radio(form)
 {
   if(voted==1)
   {
    alert("您已经投过一票了！请勿重复投票。");
    return false;
    }

  if(form.radio1.checked||form.radio2.checked||form.radio3.checked||form.radio4.checked)
   {
    voted=1;
    return true;
   }
  else
    alert("您还没选择哪！");
    return false;
 }

//检查数字
function red_check_num(obj)
  {ch=obj.value*1;
   if(!ch)
  {
   alert("          对不起！\n\n请检查您所填写的数字是否正确！");
   obj.select();
 }
  }


//检验密码
function red_check_pwd(pwd1,pwd2)
 {
  if(pwd1.value!=pwd2.value)
     {
      alert("您两次所输入的密码不相同！");
     pwd2.select();
     }
}

//设置焦点
function red_setfocus(form,length)
   {
    if(length>0)form.elements[0].focus();
   }

//检查邮件地址
function red_check_email(obj)
 { ch=obj.value;
  if((ch.indexOf("@")<1)||(ch.indexOf(".")<1))
     {
      alert("请检查您所输入的电子邮件地址是否正确！");
     obj.select();
     return false;
     }
  else return true;
}

function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=100
}
function highlightit(cur2){
if (cur2.filters.alpha.opacity>50)
cur2.filters.alpha.opacity-=5
else if (window.highlighting)
clearInterval(highlighting)
}

function changePos() {
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.left = xPos + document.body.scrollLeft;
img.style.top = yPos + document.body.scrollTop;
if (yon) {
yPos = yPos + step;
}
else {
yPos = yPos - step;
}
if (yPos < 0) {
yon = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset)) {
yon = 0;
yPos = (height - Hoffset);
}
if (xon) {
xPos = xPos + step;
}
else {
xPos = xPos - step;
}
if (xPos < 0) {
xon = 1;
xPos = 0;
}
if (xPos >= (width - Woffset)) {
xon = 0;
xPos = (width - Woffset);
   }
}
function red_float() {
img.visibility = "visible";
interval = setInterval('changePos()', delay);
}


//-->