function  secBoard(tt,n,cc)
{
for(i=0;i<tt.cells.length;i++)
tt.cells[i].className="select_no";
tt.cells[n].className="select_yes";
for(i=0;i<cc.tBodies.length;i++)
cc.tBodies[i].style.display="none";
cc.tBodies[n].style.display="block";
}

var isStart01=true;
var nn01=0;
var tt01;
var ss01=5000;

setTimeout('change_img01()',ss01);
function change_img01()
{
if(isStart01){
 nn01++;
 if(nn01>=link_tt1.cells.length) nn01=0;
 if(tt01) clearTimeout(tt01);
 secBoard(link_tt1,nn01,link_cc1);
 tt01=setTimeout('change_img01()',ss01); 
 }else{
 tt01=setTimeout('change_img01()',100);
 }
}

// 框架收缩
function switchSysBar(){
var left_close;
var left_open;
if (document.getElementById("switchPoint").className=="left_close"){
document.getElementById("switchPoint").className="left_open";
document.getElementById("frmTitle").style.display="none";
}else{
document.getElementById("switchPoint").className="left_close";
document.getElementById("frmTitle").style.display="";
}
}


function eshop(id) { window.open("eshop.asp?cpid="+id,"","height=400,width=640,left=200,top=0,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");}

function show_pic(aa,bb) {
document.getElementById("pic_images").style.top   =   event.clientY + document.body.scrollTop+5; 
document.getElementById("pic_images").style.left  =   event.clientX +document.body.scrollLeft-28;
document.getElementById('pic_images').style.display="block";
document.getElementById('pic_images').innerHTML="<table width=100% border=0 cellspacing=0 cellpadding=3 align=center><tr><td width=218 align=center><img src=../uppic/"+aa+" onload='javascript:DrawImage(this,400,300);'></td></tr><tr><td align=center><font color=#000000>"+bb+"</font></td></tr></table>";
}
function noshow_pic() {
document.getElementById('pic_images').style.display="none";
}

//========================= 设置字体大中小 start =============
function doZoom(size){
   var artibody = document.getElementById('artibody');
   if(!artibody){
    return;
   }
   var artibodyChild = artibody.childNodes;
   artibody.style.fontSize = size + 'px';
   //再对artibody div内的直接html节点设置fontSize属性
   for(var i = 0; i < artibodyChild.length; i++){
    if(artibodyChild[i].nodeType == 1){
     artibodyChild[i].style.fontSize = size + 'px';
    }
   }
}
//========================= 设置字体大中小 end =============


//========================= 打印正文部分 start =============
//print js begin

function LoadPrintJsCallBack()
{
   if(typeof forSPrint == "object" && forSPrint.Print)
   {
    forSPrint.Print();
   }
}

function SinaPrintGetBrowser(){
   if (navigator.userAgent.indexOf("MSIE") != -1)
   {
    return 1;
   }
   else if (navigator.userAgent.indexOf("Firefox") != -1)
   {
    return 2;
   }
   else if (navigator.userAgent.indexOf("Navigator") != -1)
   {
    return 3;
   }
   else if (navigator.userAgent.indexOf("Opera") != -1 )
   {
    return 4;
   }else
   {
    return 5;
   }
}

function LoadPrintJs()
{
   var myBrowser = SinaPrintGetBrowser();

   if(myBrowser == 1)
   {
    var js_url = "manageother/inc/print.js";
    var js = document.createElement( "script" ); 
    js.setAttribute( "type", "text/javascript" );
    js.setAttribute( "src", js_url);
    js.setAttribute( "id", "sinaPrintJsUrl");
    document.body.insertBefore( js, null);
    document.getElementById("sinaPrintJsUrl").onreadystatechange = LoadPrintJsCallBack;
   }
   else
   {
    var js_url = "manageother/inc/print.js";
    var js = document.createElement( "script" ); 
    js.setAttribute( "type", "text/javascript" );
    js.setAttribute( "src", js_url);
    js.setAttribute( "id", "sinaPrintJsUrl");
    js.setAttribute( "onload", "LoadPrintJsCallBack()");
    document.body.insertBefore( js, null);     
   }
}


//print js end
//========================= 打印正文部分 end =============

//]]>
function DrawImage(MyPic,W,H){
  var flag=false;
  var image=new Image();
  image.src=MyPic.src;
  if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= W/H){
      if(image.width>W){
        MyPic.width=W;
        MyPic.height=(image.height*W)/image.width;
      }
	  else{
        MyPic.width=image.width;
        MyPic.height=image.height;
      }
    }
    else{
      if(image.height>H){
        MyPic.height=H;
        MyPic.width=(image.width*H)/image.height;
      }
	  else{
        MyPic.width=image.width;
        MyPic.height=image.height;
      }
    }
  }
}

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=no,scrollbars=yes,menubar=no,status=no,location=no' );
}

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();
}

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 CheckAdminEdit()
{
   if (document.editAdminForm.AdminName.value.length<3 || document.editAdminForm.AdminName.value.length>10 )
   {
	  alert("请正确输入登录名称(必须为0-9,a-z,-_组合)！");
      document.editAdminForm.AdminName.focus();
	  return false;
	  exit;
   }
   var check;
   if (!voidNum(document.editAdminForm.AdminName.value))
   {
	  alert("请正确输入登录名称(必须为0-9,a-z,-_组合)！");
      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,-_组合)！");
      document.editMemForm.MemName.focus();
	  return false;
	  exit;
   }
   var check;
   if (!voidNum(document.editMemForm.MemName.value))
   {
	  alert("请正确输入登录名称(必须为0-9,a-z,-_组合)！");
      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;
}

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();
}

function test()
{
  if(!confirm('是否确定进行批量操作？操作后不能恢复！')) return false;
}

function num_1()
{
		var num_1=document.getElementById("Num_1").value;
		var num_1_str=document.getElementById("num_1_str");
		var str;
		str="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
		for(var i=0;i<num_1;i++)
		{
			str=str+"<tr><td height='28'>";
			str=str+"属性名称：<input name='attribute"+(parseInt(i)+1)+"' type='text' id='attribute"+(parseInt(i)+1)+"' size='18' /> 属性值：<input name='attribute"+(parseInt(i)+1)+"_value' type='text' id='attribute"+(parseInt(i)+1)+"_value' size='50' /></td>";
			str=str+"</tr>";
		}
		str=str+"</table>";
		num_1_str.innerHTML=str;
}

function num_1_1()
{
	var num_1=document.getElementById("Num_1").value;
	var num_1_str=document.getElementById("num_1_str");
	var str;
	str="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
	str=str+"<tr><td height='28'>";
	str=str+"属性名称：<input name='attribute"+(parseInt(num_1)+1)+"' type='text' id='attribute"+(parseInt(num_1)+1)+"' size='18' /> 属性值：<input name='attribute"+(parseInt(num_1)+1)+"_value' type='text' id='attribute"+(parseInt(num_1)+1)+"_value' size='50' /></td>";
	str=str+"</tr>";
	str=str+"</table>";
	num_1_str.innerHTML=num_1_str.innerHTML+str;
	document.getElementById("Num_1").value=(parseInt(num_1)+1);
}

function CopyWebTitle(v)
{
 document.editForm.SeoKeywords.value=v;
 document.editForm.SeoDescription.value=v;
}


