
	function UpdateTotal(f) {
		var current = document.addtocanoeform.qty_total.value * 1;
		var addme = document.addtocanoeform[f].value * 1;
		var newval = current + addme;
		document.addtocanoeform.qty_total.value = newval;
	}
	function Left(str, n){
		if (n <= 0)
			return "";
		else if (n > String(str).length)
			return str;
		else
			return String(str).substring(0,n);
	}
	function UpdateTotal2() {
		var current = 0;
		for(i=0; i<document.addtocanoeform.elements.length; i++) {
			if (Left(document.addtocanoeform.elements[i].name,4) == 'qty_' && document.addtocanoeform.elements[i].name != 'qty_total') {
				var addme = document.addtocanoeform.elements[i].value * 1;
				current += addme;
			}
		}
		document.addtocanoeform.qty_total.value = current;
	}
	//this is the old one - pre fall 2006
	function UpdateClipart_Pic(on_state) {
		if (on_state == 'on') {
			document.addtocanoeform.clipart_pic.disabled = false;
		} else {
			document.addtocanoeform.clipart_pic.disabled = true;
		}
	}
	//this is the new one - post fall 2006
	function UpdateClipart_Pic2() {
		//check selected item for "graphic" - if 
		var selected_index = document.addtocanoeform.graphic.selectedIndex;
		if (selected_index == 5) {
			document.addtocanoeform.clipart_pic.disabled = false;
		} else {
			document.addtocanoeform.clipart_pic.disabled = true;
		}
	}
	function UpdateFont(on_state) {
		if (on_state == 'on') {
			document.addtocanoeform.typeface_other.disabled = false;
		} else {
			document.addtocanoeform.typeface_other.disabled = true;
		}
	}
	function PopUpHelp(section) {
		optionsStr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=350,left=10,top=10,screenX=10,screenY=10';
		window.open('help.php#' + section, 'helpwindow', optionsStr);
	}
	//this is the old one - pre fall 2006
	function PopUpClipArtChooser() {
		document.addtocanoeform.graphic[5].checked=true;
		document.addtocanoeform.clipart_pic.disabled = false;
		optionsStr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=350,left=10,top=10,screenX=10,screenY=10';
		window.open('clipart_directories.php', 'clipartwindow', optionsStr);
	}
	//this is the new one - post fall 2006
	function PopUpClipArtChooser2() {
		document.addtocanoeform.graphic.selectedIndex = 5;
		document.addtocanoeform.clipart_pic.disabled = false;
		optionsStr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=350,left=10,top=10,screenX=10,screenY=10';
		window.open('clipart_directories.php', 'clipartwindow', optionsStr);
	}
	function PopUpClipArtBrowser() {
		optionsStr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=350,left=10,top=10,screenX=10,screenY=10';
		window.open('browse_clipart_directories.php', 'clipartwindow', optionsStr);
	}
	//this is the old one - pre fall 2006
	function PopUpFontChooser() {
		document.addtocanoeform.typeface[4].checked=true;
		document.addtocanoeform.typeface_other.disabled = false;
		optionsStr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=350,left=10,top=10,screenX=10,screenY=10';
		window.open('typestyle_directories.php', 'fontwindow', optionsStr);
	}
	//this is the new one - post fall 2006
	function PopUpFontChooser2() {
		document.addtocanoeform.typeface_other.disabled = false;
		optionsStr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=350,left=10,top=10,screenX=10,screenY=10';
		window.open('typestyle_directories.php', 'fontwindow', optionsStr);
	}
	function PopUpFontBrowser() {
		optionsStr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=350,left=10,top=10,screenX=10,screenY=10';
		window.open('browse_typestyle_directories.php', 'fontwindow', optionsStr);
	}
