function MakeFlash(Url,Width,Height){                   
document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"" + Width + "\" height=\"" + Height + "\">");   
document.writeln("<param name=\"movie\" value=\"" + Url + "\" />");   
document.writeln("<param name=\"quality\" value=\"high\" />");       
document.writeln("<param name=\"wmode\" value=\"transparent\" />");
document.writeln("<param name=\"menu\" value=\"false\">");
document.writeln("<embed src=\"" + Url + "\" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + Width + "\"  height=\"" + Height + "\" />");   
document.writeln("</object>");     
} 

//    function ResumeError() {
//    return true;
//}
//window.onerror = ResumeError;

function ClickMenu(diving,plusing,num)
{ 
  
  if(document.getElementById(diving).style.display=="none")
  {
     document.getElementById(diving).style.display='block';
     if(plusing=="plus")
     {
       document.getElementById(plusing+num).src="/manage/images/minus.gif";
     }
     else if(plusing=="nolines")
     {
       document.getElementById(plusing+num).src="/manage/images/minus_nolines.gif";
     } 
     else if(plusing=="bottom")
     {
       document.getElementById(plusing+num).src="/manage/images/minus_bottom.gif";
     }
      document.getElementById("open"+num).src="/manage/images/close.gif";
  }
  else
  {
     document.getElementById(diving).style.display='none';
     if(plusing=="plus")
     {
       document.getElementById(plusing+num).src="/manage/images/plus.gif";
     }
     else if(plusing=="nolines")
     {
       document.getElementById(plusing+num).src="/manage/imagesplus_nolines.gif";
     } 
     else if(plusing=="bottom")
     {
       document.getElementById(plusing+num).src="/manage/imagesplus_bottom.gif";
     }
     document.getElementById("open"+num).src="/manage/images/open.gif"; 
  }
}

function ChangeColora(obj)
{
 
    
   obj.className='Node-selected';

}
function ChangeColorb(obj)
{
 
   obj.className='Node-unselect';

}

var ColumnID;

function CheckIfOnlyOneSelect()
{
    var NumSelected=SelectNum();
    if(NumSelected==1)
    {
        window.location.href="SetDptRight.aspx?ColumnID="+ColumnID;
    }
    else if(NumSelected==0)
    {
        alert("请选择栏目");
    }
    else if(NumSelected>1)
    {
        alert("只能选择一个栏目");
    }
}

function CheckIfOnlyOneSelectDel()
{
    var NumSelected=SelectNum();
    if(NumSelected==1)
    {
        window.location.href="DelColumn.aspx?ColumnID="+ColumnID;
    }
    else if(NumSelected==0)
    {
        alert("请选择要删除的栏目");
    }
    else if(NumSelected>1)
    {
        alert("一次只能删除一个栏目");
    }
}

function SelectNum()
{

    var checkboxis = document.getElementsByName("checkbox");
    var NumSelected=0;
    
    for (var i=0; i<checkboxis.length; i++)
    {
        if(checkboxis[i].checked == true)
        {
            NumSelected=NumSelected+1;
        }
    }
    
    if(NumSelected==1)
    {
        for (var i=0; i<checkboxis.length; i++)
        {
            if(checkboxis[i].checked == true)
            {
                ColumnID=checkboxis[i].value;
                break;
            }
        }
    }
    else if(NumSelected==0)
    {
        
    }
    else if(NumSelected>1)
    {
        
    }
    return NumSelected;
}



var temp, temp2, cookieArray, cookieArray2, cookieCount;

function initiate(){

  cookieCount=0;

  if(document.cookie){

    cookieArray=document.cookie.split(";");
    cookieArray2=new Array();

    for(i in cookieArray){
      cookieArray2[cookieArray[i].split("=")[0].replace(/ /g,"")]=cookieArray[i].split("=")[1].replace(/ /g,"");
    }

  }

  cookieArray=(document.cookie.indexOf("state=")>=0)?cookieArray2["state"].split(","):new Array();

  temp=document.getElementById("containerul");

  for(var o=0;o<temp.getElementsByTagName("li").length;o++){

    if(temp.getElementsByTagName("li")[o].getElementsByTagName("ul").length>0){

      temp2				= document.createElement("span");
      temp2.className			= "symbols";
      temp2.style.backgroundImage	= (cookieArray.length>0)?((cookieArray[cookieCount]=="true")?"url(/images/minus.png)":"url(/images/plus.png)"):"url(/images/plus.png)";
      temp2.onclick=function(){
        showhide(this.parentNode);
        writeCookie();
      }

      temp.getElementsByTagName("li")[o].insertBefore(temp2,temp.getElementsByTagName("li")[o].firstChild)

      temp.getElementsByTagName("li")[o].getElementsByTagName("ul")[0].style.display = "none";

      if(cookieArray[cookieCount]=="true"){
        showhide(temp.getElementsByTagName("li")[o]);
      }

      cookieCount++;

    }
    else{

      temp2				= document.createElement("span");
      temp2.className			= "symbols";
      temp2.style.backgroundImage	= "url(/images/point5.jpg)";

      temp.getElementsByTagName("li")[o].insertBefore(temp2,temp.getElementsByTagName("li")[o].firstChild);

    }

  }

}



function showhide(el){

  el.getElementsByTagName("ul")[0].style.display=(el.getElementsByTagName("ul")[0].style.display=="block")?"none":"block";

  el.getElementsByTagName("span")[0].style.backgroundImage=(el.getElementsByTagName("ul")[0].style.display=="block")?"url(/images/minus.png)":"url(/images/plus.png)";

}



function writeCookie(){		// Runs through the menu and puts the "states" of each nested list into an array, the array is then joined together and assigned to a cookie.

  cookieArray=new Array()

  for(var q=0;q<temp.getElementsByTagName("li").length;q++){

    if(temp.getElementsByTagName("li")[q].childNodes.length>0){
      if(temp.getElementsByTagName("li")[q].childNodes[0].nodeName=="SPAN" && temp.getElementsByTagName("li")[q].getElementsByTagName("ul").length>0){

        cookieArray[cookieArray.length]=(temp.getElementsByTagName("li")[q].getElementsByTagName("ul")[0].style.display=="block");

      }
    }

  }

  document.cookie="state="+cookieArray.join(",")+";expires="+new Date(new Date().getTime() + 365*24*60*60*1000).toGMTString();

}

$(document).ready(function(){
$("input[name='Tags']").click(function (){
var ss=$(this).val().charCodeAt();
    if(ss==35831)
    {    
    $(this).val("");
    }
});

});
