// <!-- Hide from old browsers
	function CAItem(ITEM_NUM) {
		var ITEM = document.forms[0].elements[ITEM_NUM].value;
		Window("http://www.constantauction.com/cgi-bin/osa/ViewPage.cgi?templateName=item_form.htx&itemNumber="+ITEM);
	}

	function Window(page) {
    	sub = window.open(page,"sub","toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=400,width=450")
		sub.focus();
    }
    
	 function AddImg(IMG) {
	  	var Idx = document.forms["LightBoxName"].LB.selectedIndex;
		var Box = document.forms["LightBoxName"].LB.options[Idx].value;
		document.forms["LightBoxName"].ImgID.value = IMG;
		var comm = prompt("Add "+IMG+" to light box: "+Box+".\nWould you like to enter a comment with this entry:"," ")
		if (comm != null) {
			document.forms["LightBoxName"].COMMENT.value = comm;		
			document.forms["LightBoxName"].submit();
		}	
	  }

	 function OpenLB(USER) {
	  	var Idx = document.forms["LightBoxName"].LB.selectedIndex;
		var Box = document.forms["LightBoxName"].LB.options[Idx].value;

		document.forms["OpenBox"].USR.value = USER;	
		document.forms["OpenBox"].LB.value = Box;
		document.forms["OpenBox"].submit();					
	  }

	 function DelImg(IMG) {
		var Box = document.forms["RemoveImage"].LB.value;
		document.forms["RemoveImage"].ImgID.value = IMG;
		if (confirm("Remove "+IMG+" from light box: "+Box)) {
			document.forms["RemoveImage"].submit();
		}
	  }

	 function Change(USR) {
	  	var Idx = document.forms["LightBoxName"].LB.selectedIndex;
		var Box = document.forms["LightBoxName"].LB.options[Idx].value;
	  	var Idx2 = document.forms["ChangeLightBox"].ACT.selectedIndex;
		var Act = document.forms["ChangeLightBox"].ACT.options[Idx2].value;
		var Name = document.forms["ChangeLightBox"].NAME.value;
		document.forms["ChangeLightBox"].LB.value = Box;

		if (Act == "Open") {
			OpenLB(USR);
		} else if ((Act == "New" || Act == "Rename") && !Name) {
			alert("You nead to specify a Name to use this function");	
		} else {
			if (Act == "New") {
				var conf = "Are you sure you want to create light box:\n"+Name;
			} else if (Act == "Rename") {
				var conf = "Are you sure you want to rename:\n"+Box+" with "+Name;
			} else if (Act == "Remove") {
				var conf = "Are you sure you want to remove light box:\n"+Box;
			} 
			
			if (!conf) {
				alert("You have not selected a proper action.");
			} else if (confirm(conf)) {
				document.forms["ChangeLightBox"].submit();
			}		
		}

	 }

	 function Search() {
	 	var LOOK = document.forms["search_with"].KEYWORDS.value

		if (document.forms["search_with"].Action[1].checked) {
			var SendTo = "/stock/fview.pl"
		 	document.forms["search_with"].KEYWORDS.name = "ImgID"
		} else {
			var SendTo = "/stock/search.pl"
		}
		document.forms["search_with"].action = SendTo
//		document.forms["search_with"].submit();
	  }

// Stop hiding from old browsers -->
