	var arOpenFolders 		= new Array();
	var strSelectedItem 	= 0;

	function LockPage()
	{
		$("Blocker").className = $("Blocker").className.replace(/Hidden/g,"");
	}

	function UnlockPage()
	{
		$("Blocker").className += " Hidden";
	}

	function RefreshDir(nParentID)
	{
		if(nParentID != "root")
		{
			nParentID = parseInt(nParentID, 10);
			if(nParentID > 0)
			{
				LockPage();
				new Ajax.Request("AjaxDirRefresh.php",
				{
					onComplete:function(oRes)
					{
						var oJSON = oRes.responseText.evalJSON();
						if(oJSON.Error == null)
						{
							$("SUBDIV"+nParentID).innerHTML = oJSON.HTML;
							if($F("ActionFolderID") != null)
							{
								//alert("trying click "+$F("ActionFolderID"));
								$("PlusMinus"+$F("ActionFolderID")).onclick();
							}
						}
						else
							alert(oJSON.Error);
						
						HideAddPanel();
						HideEditPanel();
						UnlockPage();
					},
					
					onFailure:function(oRes)
					{
						alert("Error: "+oRes.responseText);
						UnlockPage()
					},
					
					parameters:
					{
						"FolderID":		nParentID
					}
				});
			}
			else 
			{
				window.location.href = unescape(window.location.href);
				return;
				//alert("No Parent ID given for DirRefresh("+nParentID+")");
				UnlockPage();
			}
		}
		else 
		{
			window.location.href = unescape(window.location.href);
			return;
			//alert("No Parent ID given for DirRefresh("+nParentID+")");
			UnlockPage();
		}
	}
	
	function ToggleCollege(nID)
	{
		if($("College"+nID) != null)
		{
			var eTarget = $("College"+nID);
			var eIcon	= $("CollegeName"+nID);
			if(eTarget.className.search(/Hidden/i) > -1)
			{
				eTarget.className 	= eTarget.className.replace(/Hidden/gi, "");
				eIcon.className		= "CollegeName OpenCollege";
			}
			else
			{
				eTarget.className += ' Hidden ';
				eIcon.className		= "CollegeName ClosedCollege";
			}
		}
	}

	function ToggleFolder(eCaller, nID)
	{
		if($("SUBDIV"+nID).className.search(/Hidden/gi) > -1)
		{
			/** Opening **/
//			console.log("Open");
			eCaller.className 					= eCaller.className.replace(/ Expand/," Collapse ");
			$("SUBDIV"+nID).className 				= $("SUBDIV"+nID).className.replace(/Hidden/, "");
			//$("LI"+nID).className 				= $("LI"+nID).className.replace(/FolderHidden/, "FolderOpenHidden");
			//$("LI"+nID).className 				= $("LI"+nID).className.replace(/FolderDeleted/, "FolderOpenDeleted");
			//$("LI"+nID).className 				= $("LI"+nID).className.replace(/FolderClosed/, "FolderOpen");
			arOpenFolders[nID] 					= nID;
			GetFolderContents(nID);
		}
		else
		{
			/** Closing **/
//			console.log("Close");
			eCaller.className 					= eCaller.className.replace(/ Collapse/," Expand ");
			$("SUBDIV"+nID).className 				= $("SUBDIV"+nID).className.replace("", " Hidden ");
			//$("LI"+nID).className 				= $("LI"+nID).className.replace(/FolderOpenHidden/, "FolderHidden");
			//$("LI"+nID).className 				= $("LI"+nID).className.replace(/FolderOpenDeleted/, "FolderDeleted");
			//$("LI"+nID).className 				= $("LI"+nID).className.replace(/FolderOpen/, "FolderClosed");
			arOpenFolders.splice(nID, 1);
		}
	}
	
	function GetFolderContents(nFolderID)
	{
		nFolderID = parseInt(nFolderID, 10);
		if(nFolderID > 0)
		{
			LockPage();
			new Ajax.Request("AjaxGetFolderContents.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						$("SUBDIV"+nFolderID).innerHTML = oJSON.Result;
					}
					else
					alert(oJSON.Error);
				UnlockPage()
				},
				parameters:{"FolderID":nFolderID}
			});
		}
	}
	
	function SelectFolder(eElement, nID, bDeleted, bHidden)
	{
		ResetInputs();
		
		/** Mark current **/
		$("FolderName"+nID).className += ' Selected';
		
		/** Store value **/
		strSelectedItem = "Folder|"+nID;
		$("ActionFolderID").value = nID;
		
		$("FolderPanelHeader").innerHTML = "You selected folder \"<strong> "+ eElement.innerHTML +"</strong>\"";
		
		if($("FolderButtons") != null)$("FolderButtons").className = $("FolderButtons").className.replace(/hidden/gi, " ");
		
		if($("AddPanel") != null)ShowAddPanel(nID);
		if($F("FolderID") != nID)
		{
			if($("EditPanel") != null)ShowEditPanel(nID, bDeleted, bHidden);
			if($("RootWarningPanel") != null)$('RootWarningPanel').className += ' Hidden ';
		}
		else
		{
			/** No editing root **/
			if($("EditPanel") != null)$("EditPanel").style.display 	= 'none';
			if($("RootWarningPanel") != null)$('RootWarningPanel').className = $('RootWarningPanel').className.replace(/Hidden/g,"");
		}
		if($("PlaceholderPanel") != null)HidePlaceholderPanel();
	}
	
	function WinDirSpecialCharCheck(eCaller)
	{
		var strPattern = /(\?|\||\:|\\|\/|\"|\*|\<|\>|`)/g;
		if(eCaller.value.search(strPattern) > -1)
		{
			alert("Please do not use the following characters: \ / < > : * ? | \ `");
			eCaller.value = eCaller.value.replace(strPattern, "");
		}
	}
	
	function DeselectFolder(nID)
	{
		if($("FolderName"+nID) != null)$("FolderName"+nID).className = $("FolderName"+nID).className.replace(/Selected($| )/, '');
	}

	function SelectDocument(eElement, nID, bDeleted, bHidden)
	{
		ResetInputs();
		$("FolderPanelHeader").innerHTML = "You selected folder \"<strong> "+ eElement.innerHTML+"</strong>\"";
		
		/** Mark current **/
		$("DocumentName"+nID).className += ' Selected';

		/** Store value **/
		strSelectedItem = "Document|"+nID;
		$("ActionDocumentID").value = nID;
		if($("DocumentButtons") != null) $("DocumentButtons").className = $("DocumentButtons").className.replace(/hidden/gi, " ");
		if($("AddPanel") != null)HideAddPanel(nID);
		if($("EditPanel") != null)ShowEditPanel(nID, bDeleted, bHidden);
		if($("PlaceholderPanel") != null)HidePlaceholderPanel();
	}

	function DeselectDocument(nID)
	{
		if($("DocumentName"+nID) != null)$("DocumentName"+nID).className = $("DocumentName"+nID).className.replace(/Selected($| )/, '');
	}
	
	function ResetInputs()
	{
		/** Clear previous Folder **/
		if($("ActionFolderID") != null)
		{
			if($F("ActionFolderID") != 'x')
			{
				DeselectFolder($F("ActionFolderID"));
			}
		}
		
		/** Clear previous Document **/
		if($("ActionDocumentID") != null)
		{
			if($F("ActionDocumentID") != 'x')
			{
				DeselectDocument($F("ActionDocumentID"));
			}
		}
		
		if($("DocumentButtons") != null)	$("DocumentButtons").className 			= " Hidden ";
		if($("DocumentPanel") != null)		$("DocumentPanel").className 			= " Hidden ";
		if($("FolderButtons") != null)		$("FolderButtons").className 			= " Hidden ";
		if($("FolderPanel") != null)		$("FolderPanel").className 				= " Hidden ";
		if($("FolderRenamePanel") != null)	$("FolderRenamePanel").className 		= " Hidden ";
		if($("DocumentRenamePanel") != null)$("DocumentRenamePanel").className 		= " Hidden ";
		if($("FolderFinalDelete") != null)	$("FolderFinalDelete").className 		+= " Hidden ";
		if($("DocumentFinalDelete") != null)$("DocumentFinalDelete").className 		+= " Hidden ";
		if($("FolderUnhide") != null)		$("FolderUnhide").className 			+= " Hidden ";
		if($("DocumentUnhide") != null)		$("DocumentUnhide").className 			+= " Hidden ";
		if($("FolderUndelete") != null)		$("FolderUndelete").className 			+= " Hidden ";
		if($("DocumentUndelete") != null)	$("DocumentUndelete").className 			+= " Hidden ";
		
		if($("FolderHide") != null)			$("FolderHide").className 				= $("FolderHide").className.replace(/Hidden/gi, '');
		if($("FolderDelete") != null)		$("FolderDelete").className 			= $("FolderDelete").className.replace(/Hidden/gi, '');	
		if($("DocumentHide") != null)		$("DocumentHide").className 			= $("DocumentHide").className.replace(/Hidden/gi, '');
		if($("DocumentDelete") != null)		$("DocumentDelete").className 			= $("DocumentDelete").className.replace(/Hidden/gi, '');	
	}

	function ShowAddPanel(nID)
	{
		$("AddPanel").style.display 	= 'block';
		$("FolderAdd").className 		= $("FolderAdd").className.replace(/Hidden/gi, "");
		$("DocumentAdd").className 		= $("DocumentAdd").className.replace(/Hidden/gi, "");
	}

	function ShowEditPanel(nID, bDeleted, bHidden)
	{
		if($("EditPanel") != null)
		{
			$("EditPanel").style.display 	= 'block';
			if(!bDeleted && !bHidden)
			{
				if($("DocumentFinalDelete") != null)$("DocumentFinalDelete").className 		+= " Hidden ";
				if($("FolderFinalDelete") != null)	$("FolderFinalDelete").className 		+= " Hidden ";
			}
			else
			{
				if(!bHidden && !bDeleted)
				{
					if($("FolderImport") != null)		$("FolderImport").className 			= $("FolderImport").className.replace(/Hidden/gi, "");
				}
				
				if(bHidden)
				{
					if($("FolderUnhide") != null)		$("FolderUnhide").className 			= $("FolderUnhide").className.replace(/Hidden/gi, "");
					if($("FolderHide") != null)			$("FolderHide").className 				+= " Hidden";
					if($("DocumentUnhide") != null)		$("DocumentUnhide").className 			= $("DocumentUnhide").className.replace(/Hidden/gi, "");
					if($("DocumentHide") != null)		$("DocumentHide").className 			+= " Hidden";
				}
				
				if(bDeleted)
				{
					if($("FolderFinalDelete") != null)	$("FolderFinalDelete").className 		= $("FolderFinalDelete").className.replace(/Hidden/gi, "");
					if($("FolderUndelete") != null)		$("FolderUndelete").className 			= $("FolderUndelete").className.replace(/Hidden/gi, "");
					if($("FolderDelete") != null)		$("FolderDelete").className 			+= " Hidden";
					if($("DocumentFinalDelete") != null)$("DocumentFinalDelete").className 		= $("DocumentFinalDelete").className.replace(/Hidden/gi, "");
					if($("DocumentUndelete") != null)	$("DocumentUndelete").className 		= $("DocumentUndelete").className.replace(/Hidden/gi, "");
					if($("DocumentDelete") != null)		$("DocumentDelete").className 			+= " Hidden";
				}
			}
		}
	}

	function HideAddPanel(nID)
	{
		$("AddPanel").style.display 	= '';
		$("FolderAdd").className 		+= " Hidden";
		$("DocumentAdd").className 		+= " Hidden";
	}

	function HideEditPanel(nID)
	{
		$("EditPanel").style.display 	= '';
		$("FolderAdd").className 		+= " Hidden";
		$("DocumentAdd").className 		+= " Hidden";
	}
	
	function HidePlaceholderPanel()
	{
		$("PlaceholderPanel").className += ' Hidden';	
	}

	function DocumentAdd(eCaller)
	{
		$("DocumentPanel").className = $("DocumentPanel").className.replace(/Hidden/gi, "");
		$("FolderAdd").className += " Hidden";
	}
	
	function FolderAdd(eCaller)
	{
		$("FolderPanel").className = $("FolderPanel").className.replace(/Hidden/gi, "");
		$("DocumentAdd").className += " Hidden";
		$("FolderName").value = '';
		$("FolderHidden").checked = false;
		$("FolderDesc").value = '';
		$("FolderName").focus();
	}

	function DocumentRename(eCaller)
	{
		$("DocumentRenamePanel").className = $("DocumentRenamePanel").className.replace(/Hidden/gi, "");
		$("DocumentRenameName").value = JS_Utils_Trim($("DocumentName"+$F("ActionDocumentID")).innerHTML);
		$("DocumentHide").className += ' Hidden ';
		$("DocumentDelete").className += ' Hidden ';
	}

	function FolderRename(eCaller)
	{
		$("FolderRenamePanel").className = $("FolderRenamePanel").className.replace(/Hidden/gi, "");
		$("FolderRenameName").value = JS_Utils_Trim($("FolderName"+$F("ActionFolderID")).innerHTML);
		$("FolderHide").className += ' Hidden ';
		$("FolderDelete").className += ' Hidden ';	
	}

	function FolderDelete(eCaller)
	{
		LockPage()
		if(confirm("Are you sure you want to delete the selected folder?"))
		{
			var nID = $F("ActionFolderID");
			new Ajax.Request("AjaxDeleteFolder.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage();
				},
				parameters:{"ActionFolderID":nID}
			});
		}
		else
		{
			UnlockPage();
		}
	}

	function FolderScan(eCaller)
	{
		LockPage()
		if(confirm("Are you sure you want to check this folder for added files?\nNote: You will need to delete files and folders via this website interface"))
		{
			var nID = $F("ActionFolderID");
			new Ajax.Request("AjaxScanFolder.php",
					{
				onComplete:function(oRes)
				{
				var oJSON = oRes.responseText.evalJSON();
				if(oJSON.Error == null)
				{
					if(oJSON.AddedFiles > 0)
						alert("Successfully added "+oJSON.AddedFiles+" new file/s");
					else
						alert(oJSON.Info);
						
					RefreshDir(oJSON.ParentID);
				}
				else
					alert(oJSON.Error);
				UnlockPage();
				},
				parameters:{"ActionFolderID":nID}
			});
		}
		else
		{
			UnlockPage();
		}
	}

	function FolderFinalDelete(eCaller)
	{
		LockPage();
		if(confirm("Are you sure you want to delete the selected folder?"))
		{
			var nID = $F("ActionFolderID");
			new Ajax.Request("AjaxFinalDeleteFolder.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage();
				},
				parameters:{"ActionFolderID":nID}
			});
		}
		else
		{
			UnlockPage();
		}
	}

	function FolderUndelete(eCaller)
	{
		LockPage();
		if(1 ||confirm("Are you sure you want to undelete the selected folder?"))
		{
			var nID = $F("ActionFolderID");
			new Ajax.Request("AjaxUndeleteFolder.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage();
				},
				parameters:{"ActionFolderID":nID, "Action":1}
			});
		}
		else
		{
			UnlockPage();
		}
	}
	
	function FolderHide(eCaller)
	{
		LockPage();
		if(1 || confirm("Are you sure you want to hide the selected folder?"))
		{
			var nID = $F("ActionFolderID");
			new Ajax.Request("AjaxHideFolder.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage();
				},
				parameters:{"ActionFolderID":nID, "Action":1}
			});
		}
		else
		{
			UnlockPage();
		}
	}
	
	function DocumentDelete(eCaller)
	{
		LockPage();
		if(confirm("Are you sure you want to delete the selected folder?"))
		{
			var nID = $F("ActionDocumentID");
			new Ajax.Request("AjaxDeleteDocument.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage()
				},
				parameters:{"ActionDocumentID":nID}
			});
		}
		else
		{
			UnlockPage();
		}
	}

	function DocumentFinalDelete(eCaller)
	{
		LockPage();
		if(confirm("Are you sure you want to delete the selected folder?"))
		{
			var nID = $F("ActionDocumentID");
			new Ajax.Request("AjaxFinalDeleteDocument.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage()
				},
				parameters:{"ActionDocumentID":nID}
			});
		}
		else
		{
			UnlockPage();
		}
	}
	
	function DocumentUndelete(eCaller)
	{
		LockPage();
		if(1 || confirm("Are you sure you want to delete the selected folder?"))
		{
			var nID = $F("ActionDocumentID");
			new Ajax.Request("AjaxUndeleteDocument.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage()
				},
				parameters:{"ActionDocumentID":nID}
			});
		}
		else
		{
			UnlockPage();
		}
	}

	function DocumentHide(eCaller)
	{
		LockPage();
		if(1 || confirm("Are you sure you want to hide the selected document?"))
		{
			var nID = $F("ActionDocumentID");
			new Ajax.Request("AjaxHideDocument.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					
					UnlockPage()
				},
				parameters:{"ActionDocumentID":nID, "Action":1}
			});
		}
		else
		{
			UnlockPage();
		}
	}

	function FolderUnhide(eCaller)
	{
		LockPage();
		if(1 ||  confirm("Are you sure you want to unhide the selected folder?"))
		{
			var nID = $F("ActionFolderID");
			new Ajax.Request("AjaxUnhideFolder.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
	//					alert("Document has been marked as deleted");
					}
					else
						alert(oJSON.Error);
					UnlockPage();
				},
				parameters:{"ActionFolderID":nID, "Action":0}
			});
		}
		else
		{
			UnlockPage();
		}
	}

	function DocumentUnhide(eCaller)
	{
		LockPage();
		if(1 || confirm("Are you sure you want to unhide the selected document?"))
		{
			var nID = $F("ActionDocumentID");
			new Ajax.Request("AjaxHideDocument.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage();
				},
				parameters:{"ActionDocumentID":nID, "Action":0}
			});
		}
		else
		{
			UnlockPage();
		}
	}

	function AjaxAddFolder()
	{
		LockPage();
		if($F("FolderName") != '')
		{
			var oParams =
			{
				"ActionFolderID":$F("ActionFolderID"),
				"Name"			:$F("FolderName"),
				"Description"	:$F("FolderDesc"),
				"Hidden"		:$("FolderHidden").checked
			};

			new Ajax.Request("AjaxNewFolder.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage();
				},
				parameters:oParams
			})
		}
		else
		{
			alert("You must include a folder name");
			UnlockPage();
		}
	}

	function AjaxDocumentRename(eCaller)
	{
		LockPage();
		if(confirm("Are you sure you want to rename this?"))
		{
			var nID = $F("ActionDocumentID");
			var strNewName = $F("DocumentRenameName");
			
			new Ajax.Request("AjaxRenameDocument.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage();
				},
				parameters:{"ActionDocumentID":nID, "NewName":strNewName}
			});
		}
		else
		{
			UnlockPage();
		}
	}

	function AjaxFolderRename(eCaller)
	{
		LockPage();
		if(confirm("Are you sure you want to rename this?"))
		{
			var nID = $F("ActionFolderID");
			var strNewName = $F("FolderRenameName");
			
			new Ajax.Request("AjaxRenameFolder.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						//alert("Parent = "+oJSON.ParentID)
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage();
				},
				parameters:{"ActionFolderID":nID, "NewName":strNewName}
			});
		}
		else
		{
			UnlockPage();
		}
	}
	
	function FolderUnhide(eCaller)
	{
		LockPage();
		if(1 ||  confirm("Are you sure you want to unhide the selected folder?"))
		{
			var nID = $F("ActionFolderID");
			new Ajax.Request("AjaxHideFolder.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage();
				},
				parameters:{"ActionFolderID":nID, "Action":0}
			});
		}
		else
		{
			UnlockPage();
		}
	}

	function DocumentUnhide(eCaller)
	{
		LockPage();
		if(1 || confirm("Are you sure you want to unhide the selected document?"))
		{
			var nID = $F("ActionDocumentID");
			new Ajax.Request("AjaxHideDocument.php",
			{
				onComplete:function(oRes)
				{
					var oJSON = oRes.responseText.evalJSON();
					if(oJSON.Error == null)
					{
						RefreshDir(oJSON.ParentID);			
					}
					else
						alert(oJSON.Error);
					UnlockPage();
				},
				parameters:{"ActionDocumentID":nID, "Action":0}
			});
		}
		else
		{
			UnlockPage();
		}
	}

	function NewFileInput()
	{
		var eTarget	 	= $("NewFileInputButton");
		var newFile 	= document.createElement("input");
		var newBR 		= document.createElement("br");
		newFile.type	= "file";
		newFile.name	= "UploadFile[]";
		JS_Utils_GetParent(eTarget).insertBefore(newFile, eTarget);
		JS_Utils_GetParent(eTarget).insertBefore(newBR, eTarget);
	}

	function UploadFiles(strInfo, nParentID)
	{
		if(nParentID == 'root')
		{
			window.location.href = unescape(window.location.href);
			return;
		}
		RefreshDir(nParentID);
		arInputs 		= $("DocumentPanel").getElementsByTagName("input")
		arFileInputs	= new Array();
		/** Add a blank **/
		NewFileInput();

		/** Sort **/
		for(var i=0; i<arInputs.length; i++)
		{
			eInput = arInputs[i];
			if(eInput.type == "file")
			{
				arFileInputs[arFileInputs.length] = eInput;
			}
		}
		
		/** Remove all but one **/
		for(var j=0; j<arFileInputs.length-1; j++)
		{
			eInput = arFileInputs[j];
			eParent = JS_Utils_GetParent(eInput);
			eParent.removeChild(eInput);
			eParent.removeChild(eParent.getElementsByTagName("br")[0]);
		}
		
		if(strInfo != null && strInfo != '')
		{
			alert(strInfo);
		}
	}
	
	function ValidateAddSchool()
	{
		if($F("SchoolName").length > 3 && $F("CollegeID") > 0)
		{
			return true;	
		}	
		else
		{
			alert("Please give the school a name and a college");
			return false;
		}
	}
	
	function AjaxFindNonAttachedUsers(eCaller)
	{
		if(eCaller.value > 0)
		{
			new Ajax.Request("AjaxFindNonAttachedUsers.php",
			{
				onComplete:function(oRes)
				{
					$("UsersBody").innerHTML = oRes.responseText;
				},
				parameters:{"SchoolID":eCaller.value}
			});
		}
	}
	
