<!--
	/*GENERAL FUNCTIONS*/
	function IfParentExists(){
		if(window.opener){
			self.close();
			window.opener.history.go();
			window.opener.focus();
		} 
	}

	function OpenWindowInCentralLocation(width, height)
	{
		//screenY = document.body.offsetHeight;
		screenY = window.screen.availHeight;
		screenX = window.screen.availWidth;
		leftvar = (screenX - width) / 2;
		rightvar = (screenY  - height) / 2;
		window.moveTo(leftvar, rightvar);
	}
	
	function show_movie(str)
	{
		movewin = window.open("show_movie.asp?video="+str, "image", "width=319,height=238,toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no");
	}
	
	function show_image(str){
		
		movewin = window.open("show_image.asp?image="+str, "image", "width=350,height=450,toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no");
	}
	
	function OpenMoveWindow(menuID,parentID,action){
		movewin = window.open("../move/index.asp?strMenuID="+menuID+"&action="+action+"&strParentID="+parentID, "moveAdm", "width=350,height=450,toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no");
	}

	function OpenMenuEditWindow(menuID,action,path){
		linkwin = window.open(path+"menu_edit.asp?MenuID="+menuID+"&action="+action, "moveAdm", "width=480,height=250,toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no");
	}

	function OpenPollEditWindow(menuID,pollID,pageID,path){
		pollwin = window.open(path+"edit.asp?MenuID="+menuID+"&pageID="+pageID+"&pollID="+pollID, "pollAdm", "width=480,height=200,toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no");
	}
	
	function setStatus(strValue){
		window.status = strValue;
	}
	
	function gotoPage(intMenuID)
	{
		window.location.href='page.asp?menuID='+intMenuID;
	}
	/*CONTENT EDITOR RELATED FUNCTIONS*/
	
	/*Close open element windows when submitting*/
	function checkOpenWin(){
		var newLinkWin = window.linkwin;
		var newDocWin = window.docwin;
		var newImageWin = window.imagewin;
		
		var linkIsClosed = true;
		var imageIsClosed = true;
		var docIsClosed = true;
		
		if(typeof(newLinkWin) != 'undefined') linkIsClosed = false;
		if(typeof(newImageWin) != 'undefined') imageIsClosed = false;
		if(typeof(newDocWin) != 'undefined') docIsClosed = false;
		
		if(!linkIsClosed) newLinkWin.close();
		if(!imageIsClosed) newImageWin.close();
		if(!docIsClosed) newDocWin.close();
	}
	
	/*Assign selected image to content*/
	function assign(){
		var el = window.event.srcElement;
		window.opener.SetIMAGE(el.value, 'HTMLEditor1',window);
		window.opener.focus();
	}
	
	/*Assign selected image to content*/
	function assignThumb(folderID, filename, filetype, siteURL){
		var el = window.event.srcElement;
		parent.window.opener.SetThumb(folderID, filename, filetype, siteURL, 'HTMLEditor1', window);
	}

	/*Assign selected video to content*/
	function assignVideo(folderID, filename, siteURL){
		var el = window.event.srcElement;
		parent.window.opener.SetVideo(folderID, filename, siteURL, 'HTMLEditor1', window);
		parent.window.opener.focus();
	}

	/*Assing selected documents to content*/
	function assignDoc(fileNameRef,siteURL,fileDescRef){
		var el = window.event.srcElement;
		window.opener.SetDOC(fileNameRef, siteURL, fileDescRef, el.value, 'HTMLEditor1', window);
		window.opener.focus();
	}
	
	/*Assing selected links to content*/
	function assignLink(menuID, menuName, siteURL){
		var el = window.event.srcElement;
		parent.window.opener.SetLink(menuID, menuName, siteURL, 'HTMLEditor1', window);
		parent.window.opener.focus();
	}
	
	/*MENU FUNCTIONS*/
	/*Activate-Deactivate menus (pages)*/
	function setActiveStatus(menuID, parentID, status){
		var thisStatus;
		if (status){
			//answer = confirm("Activate this page?");
			thisStatus = true;
		}else{
			//answer = confirm("Dectivate this page and sub pages?");
			thisStatus = false;
		}
		//if (answer){
			location.href='execute/menu_execute.asp?menuID='+menuID+'&parentID='+parentID+'&action=activate&status='+thisStatus;
		//}
	}
	
	/*Activate-Deactivate sites*/
	function setSiteActiveStatus(status, siteID, siteName){
		var thisStatus;
		if (status){
			answer=confirm("Activate ''"+siteName+"'' page?");
			thisStatus = true;
		}else{
			answer=confirm("Dectivate ''"+siteName+"'' page?");
			thisStatus = false;
		}
		if (answer){
			location.href="execute/site_execute.asp?siteID="+siteID+"&action=activate&status="+thisStatus;
		}
	}
	/*PAGE FUNCTIONS*/
	function setPageActiveStatus(activeStatus, pageID, menuID){
		var text;
		if(!activeStatus){
			text = "Activate";
		}else{
			text = "Deactivate";			
		}
		answer=confirm(text + " this paragraph")
		if (answer){
			document.pageForm.menuID.value = menuID;
			document.pageForm.pageID.value = pageID;
			document.pageForm.status.value = !activeStatus;
			document.pageForm.action.value = "setActive";
			document.pageForm.submit();
		}
	}
	
	function setPageTopStatus(topStatus, pageID, menuID){
		var text;
		if(!topStatus){
			text = "Insert";
		}else{
			text = "Remove";
		}
		answer=confirm(text + " 'to top' link")
		if (answer){
			document.pageForm.menuID.value = menuID;
			document.pageForm.pageID.value = pageID;
			document.pageForm.status.value = !topStatus;
			document.pageForm.action.value = "setTopLink";
			document.pageForm.submit();
		}
	}
	
	function setPageDividerStatus(dividerStatus, pageID, menuID){
		var text;
		if(!dividerStatus){
			text = "Insert";
		}else{
			text = "Remove";
		}
		answer=confirm(text + " divider?")
		if (answer){
			document.pageForm.menuID.value = menuID;
			document.pageForm.pageID.value = pageID;
			document.pageForm.status.value = !dividerStatus;
			document.pageForm.action.value = "setDivider";
			document.pageForm.submit();
		}
	}
	
	function setPageSort(menuID, fromID, toID, direction){
			document.pageForm.menuID.value = menuID;
			document.pageForm.fromID.value = fromID;
			document.pageForm.toID.value = toID;
			document.pageForm.action.value = "sort";
			document.pageForm.direction.value = direction;
			document.pageForm.submit();		
	}
	
	function publishPage(menuID,action){
		userlink = "../menu/publish.asp?menuID="+menuID+"&action="+action;
		winname = "UserpEditor";
		winsetting = "scrollbars=no,width=350,height=175";
		groupWin = window.open(userlink,winname,winsetting);
	}
	
	/*CONTENT FUNCTIONS*/
	function editItem(menuID, pageID, contentID){
			window.open("../content/content_editor.asp?menuID="+menuID+"&pageID="+pageID+"&contentID="+contentID+"", "edit", "width=625,height=550,toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no");
	}
	
	function previewItem(contentID){
		window.open("../content/preview.asp?contentID="+contentID+"", "preview", "width=610,height=550,toolbar=no,location=no,menubar=no,status=no,scrollbars=yes,resizable=no");
	}
	
	function previewAll(menuID){
		window.open("../content/preview.asp?menuID="+menuID+"", "previewAll", "width=610,height=550,toolbar=no,location=no,menubar=no,status=no,scrollbars=yes,resizable=no");
	}
	
	function addItem(menuID, pageID){
		//answer=confirm("This will add a new paragraph here and move the current paragraph down\n Press OK to continue");
		//if (answer){
			window.open("../content/elements.asp?menuID="+menuID+"&pageID="+pageID+"", "add", "width=550,height=520,toolbar=no,location=no,menubar=no,status=no,scrollbars=yes,resizable=no");
		//}
	}
	
	/*FILE FUNCTIONS*/
	function executeFile(fileID, categoryID){
		if	(fileID = ""){
			action = "add";
		}else{
			action = "update"
		}
		document.fileForm.action.value = action;
		document.fileForm.fileID.value = fileID;
		document.fileForm.categoryID.value = categoryID;
		document.fileForm.submit();
	}
	
	function showCategory(obj,ting){
		if (obj.selectedIndex >= 0) {
			var category;
			var Current = document.ThisForm.categoryID.selectedIndex;
			category = document.ThisForm.categoryID.options[Current].value;
			location.href = 'fileList.asp?categoryID=' + category + '&areaID='+ting;
		}
	}
	
	/*FAQ CATEGORY FUNCTIONS*/
	function editFaqCategory(menuID, pageID, faqID){
		document.pageForm.menuID.value = menuID;
		document.pageForm.pageID.value = pageID;
		document.pageForm.faqID.value = faqID;
		document.pageForm.action.value = "updateCategory";
		document.pageForm.submit();

	}
	
	/*FAQ CATEGORY FUNCTIONS*/
	function editFaq(menuID, pageID, faqID){
		document.pageForm.menuID.value = menuID;
		document.pageForm.pageID.value = pageID;
		document.pageForm.faqID.value = faqID;
		document.pageForm.action.value = "updateFAQ";
		document.pageForm.submit();
	}
	
	
	function readContact(contactID) {
		theURL="../contact/read.asp?contactID="+contactID;
		features ="scrollbars=yes,width=600,height=575";
		winName = contactID;
		window.open(theURL,winName,features);
	}
	
	function addContact(categoryID) {
		theURL="../contact/read.asp?categoryID="+categoryID;
		features ="scrollbars=yes,width=500,height=575";
		winName = categoryID;
		window.open(theURL,winName,features);
	}
	/*NEWS FUNCTIONS*/
	function readNews(newsID) {
		theURL="read_news.asp?newsID="+newsID;
		features ="scrollbars=yes,width=500,height=375";
		winName = newsID;
		window.open(theURL,winName,features);
	}

	/*FORUM FUNCTIONS*/
	function ReadMessage(menuID,messageID,parentID) {
		theURL="read.asp?sct=read&menuID="+menuID+"&messageID="+messageID+"&parentID="+parentID+"&folderID=";
		features ="scrollbars=yes,width=500,height=375";
		winName = messageID;
		window.open(theURL,winName,features);
	}
	
	function AddNewMessage(menuID) {
		theURL="add.asp?menuID="+menuID+"&parentID=0";
		features ="scrollbars=yes,width=500,height=375";
		winName = menuID;
		window.open(theURL,winName,features);
	}
	
	/*USER FUNCTIONS*/
	function addUser(){
		userlink = "add_user.asp";
		winname = "UserEditor";
		winsetting = "scrollbars=no,width=320,height=400";
		userWin = window.open(userlink,winname,winsetting);
	}
	
	function editUser(userID){
		userlink = "edit_user.asp?userID="+userID;
		winname = "UserEditor";
		winsetting = "scrollbars=no,width=320,height=400";
		userWin = window.open(userlink,winname,winsetting);
	}
	
	function userManager(){
		userlink = "../users/index.asp";
		winname = "UserpEditor";
		winsetting = "scrollbars=no,width=450,height=450";
		groupWin = window.open(userlink,winname,winsetting);	
	}
	
	/*GROUP FUNCTIONS*/
	function addGroup(){
		userlink = "add_group.asp";
		winname = "GruopEditor";
		winsetting = "scrollbars=no,width=400,height=175";
		groupWin = window.open(userlink,winname,winsetting);
	}
	
	function editGroup(groupID){
		userlink = "edit_group.asp?groupID="+groupID;
		winname = "GruopEditor";
		winsetting = "scrollbars=no,width=400,height=275";
		groupWin = window.open(userlink,winname,winsetting);
	}
	
	function getAccessList(menuID){
		userlink = "access.asp?menuID="+menuID;
		winname = "AccessEditor";
		winsetting = "scrollbars=no,width=400,height=275";
		groupWin = window.open(userlink,winname,winsetting);	
	}
	
	function move(fbox, tbox) {
		var arrFbox = new Array();
		var arrTbox = new Array();
		var arrLookup = new Array();
		var i;
		for (i = 0; i < tbox.options.length; i++) {
			arrLookup[tbox.options[i].text] = tbox.options[i].value;
			arrTbox[i] = tbox.options[i].text;
		}
		var fLength = 0;
		var tLength = arrTbox.length;
		for(i = 0; i < fbox.options.length; i++) {
			arrLookup[fbox.options[i].text] = fbox.options[i].value;
			if (fbox.options[i].selected && fbox.options[i].value != "") {
				arrTbox[tLength] = fbox.options[i].text;
				tLength++;
			}else{
				arrFbox[fLength] = fbox.options[i].text;
				fLength++;
		   }
		}
		arrFbox.sort();
		arrTbox.sort();
		fbox.length = 0;
		tbox.length = 0;
		
		var c;
		for(c = 0; c < arrFbox.length; c++) {
			var no = new Option();
			no.value = arrLookup[arrFbox[c]];
			no.text = arrFbox[c];
			fbox[c] = no;
		}
		for(c = 0; c < arrTbox.length; c++) {
			var no = new Option();
			no.value = arrLookup[arrTbox[c]];
			no.text = arrTbox[c];
			tbox[c] = no;
	   }
	}

	function setAllSelected(fbox){
		var i;
		for (i = 0; i < fbox.options.length; i++) {
			fbox.options[i].selected = true
		}

	}
	
	/*Contact category functions*/
	function addContactCat(pageID,menuID){
		userlink = "add_category.asp?action=add&pageID="+pageID+"&menuID="+menuID;
		winname = "Contact";
		winsetting = "scrollbars=no,width=320,height=185";
		catWin = window.open(userlink,winname,winsetting);		
	}
	
	function updateContactCat(categoryID){
		userlink = "add_category.asp?action=update&categoryID="+categoryID;
		winname = "Contact";
		winsetting = "scrollbars=no,width=320,height=185";
		catWin = window.open(userlink,winname,winsetting);		
	}
	
	function editContact(pageID,menuID){
		c = "../contact/add.asp?pageID="+pageID+"&menuID="+menuID;
		d = "ContactEdit";
		e = "scrollbars=yes,width=520,height=485";
		cWin = window.open(c,d,e);		
	}
	
	/*Sitemap functions*/
	function popSitemap(){
		userlink = "sitemap.asp";
		winname = "Sitemap";
		winsetting = "scrollbars=yes,width=230,height=375";
		groupWin = window.open(userlink,winname,winsetting);	
	}
//-->
