?/改变管理位置标记--------------------------------------------------------------
function changeadminflag(content){
   var row=parent.parent.headframe.document.all.trans.rows[0];
   row.cells[3].innerhtml = content ;
   return true;
}
//删除各种分类节点--------------------------------------------------------------
function confirmdelsort(result,id)
//删除产品分类节点--------------------------------------------------------------
{
   if (confirm("您确实要删除本类、子类及所有下属信息条目吗?))
   {
       window.location.href=result+".asp?action=del&id="+id
   } 
}
//分类节点展开和折?备用)-------------------------------------------------------------
function addtosort(imagepath){
  window.opener.lpform.lpattern.focus();								
  window.opener.document.lpform.lpattern.value=imagepath;
  window.opener=null;
  window.close();
}
//类别选择分类------------------------------------------------------------------------
function openscript(url,width,height)
{
  var win = window.open(url,"selecttosort",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}
//分类节点展开和折?------------------------------------------------------------------
function endsortchange(a,b)
{
	if(eval(a).style.display=='')
	{
		eval(a).style.display='none';
		eval(b).classname='sortendfolderopen';
	}
	else
	{
		eval(a).style.display='';
		eval(b).classname='sortendfolderclose';
	}
}
function sortchange(a,b)
{
	if(eval(a).style.display=='')
	{
		eval(a).style.display='none';
		eval(b).classname='sortfolderopen';
	}
	else
	{
		eval(a).style.display='';
		eval(b).classname='sortfolderclose';
	}
}
//通用选择删除条目（反?全选）--------------------------------------------------------
function checkothers(form)
{
   for (var i=0;i<form.elements.length;i++)
   {
      var e = form.elements[i];
      if (e.checked==false)
      {
	     e.checked = true;
      }
      else
      {
	     e.checked = false;
      }
   }
}

function checkall(form)
{
   for (var i=0;i<form.elements.length;i++)
   {
      var e = form.elements[i];
      e.checked = true;
   }
}
//相关条目删除提示------------------------------------------------------------
function confirmdel(message)
{
   if (confirm(message))
   {
      document.formdel.submit()
   }
}
//调用在线内容编辑?----------------------------------------------------------
function opendialog(surl, iwidth, iheight)
{
   var odialog = window.open(surl, "_editordialog", "width=" + iwidth.tostring() + ",height=" + iheight.tostring() + ",resizable=no,left=0,top=0,scrollbars=no,status=no,titlebar=no,toolbar=no,menubar=no,location=no");
   odialog.focus();
}
//检验输入字符的有效性（0-9，a-z,-,_?------------------------------------------
function voidnum(argvalue) 
{
   var flag1=false;
   var compstr="1234567890abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz_-";
   var length2=argvalue.length;
   for (var iindex=0;iindex<length2;iindex++)
   {
	   var temp1=compstr.indexof(argvalue.charat(iindex));
	   if(temp1==-1) 
	   {
	      flag1=false;
			break;							
	   }
	   else
	   { flag1=true; }
   }
   return flag1;
} 
//检查管理员登录------------------------------------------------------------------------------
function checkadminlogin()
{
   var check; 
   if (!voidnum(document.adminlogin.loginname.value))
   {
	  alert("请正确输入管理员名（由0-9,a-z,-_任意组合的字符串）?);
      document.adminlogin.loginname.focus();
	  return false;
	  exit;
   }    
   if (!voidnum(document.adminlogin.loginpassword.value))
   {
	  alert("请输入管理员密码?);
	  document.adminlogin.loginpassword.focus();
	  return false;
	  exit;
   }
   if (!voidnum(document.adminlogin.verifycode.value))
   {
      alert("请正确输入验证码?);
      document.adminlogin.verifycode.focus();
	  return false;
	  exit;
   }
   return true;
}
//检查编辑管理员------------------------------------------------------------------------------
function checkadminedit()
{
   if (document.editadminform.adminname.value.length<3 || document.editadminform.adminname.value.length>10 )
   {
	  alert("请正确输入登录名（由0-9,a-z,-_任意组合3-10位的字符串）?);
      document.editadminform.adminname.focus();
	  return false;
	  exit;
   }	
   var check; 
   if (!voidnum(document.editadminform.adminname.value))
   {
	  alert("请正确输入登录名（由0-9,a-z,-_任意组合3-10位的字符串）?);
      document.editadminform.adminname.focus();
	  return false;
	  exit;
   }
}
//检查编辑会?-------------------------------------------------------------------------------
function checkmemedit()
{
   if (document.editmemform.memname.value.length<3 || document.editmemform.memname.value.length>16 )
   {
	  alert("请正确输入登录名（由0-9,a-z,-_任意组合3-16位的字符串）?);
      document.editmemform.memname.focus();
	  return false;
	  exit;
   }	
   var check; 
   if (!voidnum(document.editmemform.memname.value))
   {
	  alert("请正确输入登录名（由0-9,a-z,-_任意组合3-16位的字符串）?);
      document.editmemform.memname.focus();
	  return false;
	  exit;
   }
}
//管理员退出登录提?-------------------------------------------------------------------------
function adminout()
{
   if (confirm("您真的要退出管理操作吗?))
   location.replace("checkadmin.asp?adminaction=out")
}
//跳转到第几页-------------------------------------------------------------------------------
function gopage(myself)
{
   window.location.href=myself+"page="+document.formdel.skippage.value;
}
//添加选择路径的Id，数字路径及生成文本路径--------------------------------------------------------
function addsort(sortname,id,path)
{
	window.opener.editform.sortname.focus();								
	window.opener.document.editform.sortname.value=sortname;
	window.opener.document.editform.sortid.value=id;
	window.opener.document.editform.sortpath.value=path;
    window.opener=null;
    window.close();
}

























//选择起始日期-----------------------------------------------------------------
var ds_x,ds_y;

function dateselector()  //构造dateselector对象，用来实现一个日历形式的日期输入框?
{
  var mydate=new date();
  this.year=mydate.getfullyear();  //定义year属性，年份，默认值为当前系统年份?
  this.month=mydate.getmonth()+1;  //定义month属性，月份，默认值为当前系统月份?
  this.date=mydate.getdate();  //定义date属性，日，默认值为当前系统的日?
  this.inputname='';  //定义inputname属性，即输入框的name，默认值为空。注意：在同一页中出现多个日期输入框，不能有重复的name?
  this.display=display;  //定义display方法，用来显示日期输入框?
}

function display()  //定义dateselector的display方法，它将实现一个日历形式的日期选择框?
{
  var week=new array('?,'一','?,'?,'?,'?,'?);

  document.write("<style type=text/css>");
  document.write("  .ds_font td,span  { font: normal 12px 宋体; color: #000000; }");
  document.write("  .ds_border  { border: 1px solid #000000; cursor: hand; background-color: #dddddd }");
  document.write("  .ds_border2  { border: 1px solid #000000; cursor: hand; background-color: #dddddd }");
  document.write("</style>");

  document.write("<input style='width:72px;text-align:left;' class='textfield' id='ds_"+this.inputname+"' name='"+this.inputname+"' value='"+this.year+"-"+this.month+"-"+this.date+"' title=双击可进行编?ondblclick='this.readonly=false;this.focus()' onblur='this.readonly=true' readonly>");
  document.write("<button style='width:60px;height:18px;font-size:12px;margin:1px;border:1px solid #a4b3c8;background-color:#dfe7ef;' type=button onclick=this.nextsibling.style.display='block' onfocus=this.blur()>选择日期</button>");

  document.write("<div style='position:absolute;display:none;text-align:center;width:0px;height:0px;overflow:visible' onselectstart='return false;'>");
  document.write("  <div style='position:absolute;left:-60px;top:20px;width:142px;height:165px;background-color:#f6f6f6;border:1px solid #245b7d;' class=ds_font>");
  document.write("    <table cellpadding=0 cellspacing=1 width=140 height=20 bgcolor=#cedae7 onmousedown='ds_x=event.x-parentnode.style.pixelleft;ds_y=event.y-parentnode.style.pixeltop;setcapture();' onmouseup='releasecapture();' onmousemove='dsmove(this.parentnode)' style='cursor:move;'>");
  document.write("      <tr align=center>");
  document.write("        <td width=12% onmouseover=this.classname='ds_border' onmouseout=this.classname='' onclick=subyear(this) title='减小年份'>&lt;&lt;</td>");
  document.write("        <td width=12% onmouseover=this.classname='ds_border' onmouseout=this.classname='' onclick=submonth(this) title='减小月份'>&lt;</td>");
  document.write("        <td width=52%><b>"+this.year+"</b><b>?/b><b>"+this.month+"</b><b>?/b></td>");
  document.write("        <td width=12% onmouseover=this.classname='ds_border' onmouseout=this.classname='' onclick=addmonth(this) title='增加月份'>&gt;</td>");
  document.write("        <td width=12% onmouseover=this.classname='ds_border' onmouseout=this.classname='' onclick=addyear(this) title='增加年份'>&gt;&gt;</td>");
  document.write("      </tr>");
  document.write("    </table>");

  document.write("    <table cellpadding=0 cellspacing=0 width=140 height=20 onmousedown='ds_x=event.x-parentnode.style.pixelleft;ds_y=event.y-parentnode.style.pixeltop;setcapture();' onmouseup='releasecapture();' onmousemove='dsmove(this.parentnode)' style='cursor:move;'>");
  document.write("      <tr align=center>");
  for(i=0;i<7;i++)
	document.write("      <td>"+week[i]+"</td>");
  document.write("      </tr>");
  document.write("    </table>");

  document.write("    <table cellpadding=0 cellspacing=2 width=140 bgcolor=#eeeeee>");
  for(i=0;i<6;i++)
  {
    document.write("    <tr align=center>");
	for(j=0;j<7;j++)
      document.write("    <td width=10% height=16 onmouseover=if(this.innertext!=''&&this.classname!='ds_border2')this.classname='ds_border' onmouseout=if(this.classname!='ds_border2')this.classname='' onclick=getvalue(this,document.all('ds_"+this.inputname+"'))></td>");
    document.write("    </tr>");
  }
  document.write("    </table>");

  document.write("    <span style=cursor:hand onclick=this.parentnode.parentnode.style.display='none'>【关闭?/span>");
  document.write("  </div>");
  document.write("</div>");

  dateshow(document.all("ds_"+this.inputname).nextsibling.nextsibling.childnodes[0].childnodes[2],this.year,this.month)
}

function subyear(obj)  //减小年份
{
  var myobj=obj.parentnode.parentnode.parentnode.cells[2].childnodes;
  myobj[0].innerhtml=eval(myobj[0].innerhtml)-1;
  dateshow(obj.parentnode.parentnode.parentnode.nextsibling.nextsibling,eval(myobj[0].innerhtml),eval(myobj[2].innerhtml))
}

function addyear(obj)  //增加年份
{
  var myobj=obj.parentnode.parentnode.parentnode.cells[2].childnodes;
  myobj[0].innerhtml=eval(myobj[0].innerhtml)+1;
  dateshow(obj.parentnode.parentnode.parentnode.nextsibling.nextsibling,eval(myobj[0].innerhtml),eval(myobj[2].innerhtml))
}

function submonth(obj)  //减小月份
{
  var myobj=obj.parentnode.parentnode.parentnode.cells[2].childnodes;
  var month=eval(myobj[2].innerhtml)-1;
  if(month==0)
  {
    month=12;
    subyear(obj);
  }
  myobj[2].innerhtml=month;
  dateshow(obj.parentnode.parentnode.parentnode.nextsibling.nextsibling,eval(myobj[0].innerhtml),eval(myobj[2].innerhtml))
}

function addmonth(obj)  //增加月份
{
  var myobj=obj.parentnode.parentnode.parentnode.cells[2].childnodes;
  var month=eval(myobj[2].innerhtml)+1;
  if(month==13)
  {
    month=1;
    addyear(obj);
  }
  myobj[2].innerhtml=month;
  dateshow(obj.parentnode.parentnode.parentnode.nextsibling.nextsibling,eval(myobj[0].innerhtml),eval(myobj[2].innerhtml))
}

function dateshow(obj,year,month)  //显示各月份的?
{
  var mydate=new date(year,month-1,1);
  var today=new date();
  var day=mydate.getday();
  var selectdate=obj.parentnode.parentnode.previoussibling.previoussibling.value.split('-');
  var length;
  switch(month)
  {
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12:
      length=31;
      break;
    case 4:
    case 6:
    case 9:
    case 11:
      length=30;
      break;
    case 2:
      if((year%4==0)&&(year%100!=0)||(year%400==0))
        length=29;
      else
        length=28;
  }
  for(i=0;i<obj.cells.length;i++)
  {
    obj.cells[i].innerhtml='';
    obj.cells[i].style.color='';
    obj.cells[i].classname='';
  }
  for(i=0;i<length;i++)
  {
    obj.cells[i+day].innerhtml=(i+1);
    if(year==today.getfullyear()&&(month-1)==today.getmonth()&&(i+1)==today.getdate())
      obj.cells[i+day].style.color='red';
    if(year==eval(selectdate[0])&&month==eval(selectdate[1])&&(i+1)==eval(selectdate[2]))
      obj.cells[i+day].classname='ds_border2';
  }
}

function getvalue(obj,inputobj)  //把选择的日期传给输入框
{
  var myobj=inputobj.nextsibling.nextsibling.childnodes[0].childnodes[0].cells[2].childnodes;
  if(obj.innerhtml)
    inputobj.value=myobj[0].innerhtml+"-"+myobj[2].innerhtml+"-"+obj.innerhtml;
  inputobj.nextsibling.nextsibling.style.display='none';
  for(i=0;i<obj.parentnode.parentnode.parentnode.cells.length;i++)
    obj.parentnode.parentnode.parentnode.cells[i].classname='';
  obj.classname='ds_border2'
}

function dsmove(obj)  //实现层的拖
{
  if(event.button==1)
  {
    var x=obj.clientleft;
    var y=obj.clienttop;
    obj.style.pixelleft=x+(event.x-ds_x);
    obj.style.pixeltop=y+(event.y-ds_y);
  }
}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
