// Rev. 09/07/2003

function Toggle(item) {
   obj=document.getElementById(item);
   visible=(obj.style.display!="none")
   key=document.getElementById("x" + item);
   top.RightAdmin.location.href='RightAdmin.asp';
   if (visible) {
     obj.style.display="none";
     key.innerHTML="<img src='images/folder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
   } else {
      obj.style.display="block";
      key.innerHTML="<img src='images/textfolder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
   }
}

function Expand() {
   divs=document.getElementsByTagName("DIV");
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="block";
     key=document.getElementById("x" + divs[i].id);
     key.innerHTML="<img src='images/textfolder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
   }
}

function Collapse() {
   divs=document.getElementsByTagName("DIV");
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="none";
     key=document.getElementById("x" + divs[i].id);
     key.innerHTML="<img src='images/folder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
   }
}
function OpenFile(file,id)
	{
		if(id == 0)
			{
				var openfile = file;
				var scr = 'yes';
			}
		else
			{
				var openfile = file + id;
				var scr = 'no';
			}
		var left = 0;
		var top = 0;
		var h = screen.height - 60;
		var op = window.open(openfile,"","width=800,height=" + h + ",location=0,menubar=0,status=0,scrollbars=" + scr + ",resizable=yes,top=" + top + ",left=" + left + "");
	}
function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}
function checkweb(form)
	{
		if(form.WebSiteName.value == "")
			{
				alert("Please enter web site name");
				form.WebSiteName.focus();
				return false;
			}
		for(i=0;i<form.CollID.length;i++)
			{
				if(form.CollID[i].checked)
					{
						form.ColIDCheck[i].value = form.CollID[i].value;
					}
			}
	}
//window.status = "Limite Library Access";
function Status()
	{
		//window.status = "Limite Library Access";
	}
function SetColor(some)
	{
		for(i=0;i<window.c1.length;i++)
			{
				c1[i].style.background = '#666666';
			}
		some.style.background = '#333333';
	}