	function MM_jumpMenu(targ,selObj,restore){ //v3.0
		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		if (restore) selObj.selectedIndex=0;
	}
	
	function menuSelectAll (theCheckbox, theMenu){
		var menuItemsCnt = theMenu.length ; //number of elements in menu
		var selectAll = theCheckbox.checked; //select all checkbox checked?
		for (i=0;i<menuItemsCnt;i++) {
			theMenu.options[i].selected = selectAll;
		}	
	}
	
	function setMenus (selObj,setObjPrefix,offset) {
	// Sets value of one or more identical select menus on a form
	// having names beginning with setObjPrefix to selected index
	// of selObj. Offset accounts for cases where selObj may have
	// a default option, e.g. "Select..." that is not in the target
	// menus
		thisForm = selObj.form;
		selIndex = selObj.options[selObj.selectedIndex].index;
		for (var i = 0 ; i < thisForm.length ; i++ ) {
			if (thisForm[i].name.indexOf(setObjPrefix) == 0) {
				thisForm[i].options[selIndex + offset].selected = true;
			}
		}
	}
	
	function cb_CheckAll(obj) {
			
		boxChecked	= obj.checked 	// checkbox check state
		checkBoxName	= obj.name		// checkbox name. all other checkboxes w/ names starting
										// with "checkBoxName" will be set to boxChecked

		
		thisForm   		= obj.form				
		for (var i = 0 ; i < thisForm.length ; i++ ) {
			if (thisForm[i].name.indexOf(checkBoxName) == 0) {
				thisForm[i].checked = boxChecked
			}
		}
	}
	
	function cb_ParentName (clicked) {
		for (var i = (clicked.length - 1); i >= 0; i-- ) {
			 if (clicked.charAt(i) == '_') {
			 	return (clicked.substring(0,i))
			 }			  
		}		
	}
	
	function cb_CheckParent(obj) {
	
		boxChecked	= obj.checked 	// checkbox check state
		checkBoxName	= obj.name		// checkbox name. all other checkboxes w/ names starting
										// with "checkBoxName" will be set to boxChecked
												
		thisForm 		= obj.form
		parentCheckBox	= cb_ParentName (checkBoxName)
		
		if (boxChecked) {
			for (var i = 0 ; i < thisForm.length ; i++ ) {
				if (thisForm[i].name ==  parentCheckBox) {
					thisForm[i].checked = boxChecked
				}
			}
		}
	}
	
	
	var newwindow;
	function MM_openBrWindow(theURL,winName,features) { //v2.0
  		newwindow=window.open(theURL,winName,features); 
		if (window.focus){
			newwindow.focus(); // sbring to front if already open
		}
	}
	
	function hide(id){
		//
		// Hides an element with id = passed id.
		//
		// 23-Nov-2005, bdp, created
		//
		
		document.getElementById(id).style.display = 'none';
	}
	
	function show(id){
		//
		// Shows an element with id = passed id.//
		//
		// 23-Nov-2005, bdp, created
		//
		
		if (document.getElementById(id).style.display == 'none'){
			document.getElementById(id).style.display = '';
		}
	}
	
	function toggle(icon,webroot,id) {
		//
		// similar to function's show() and hide(), but toggles display
		// of the element referenced by id.
		// icon refers to the graphical <a> used as the toggling mechanism
		// webroot is required so that this function can be portable.
		//
		// 23-Nov-2005, bdp, created
		//
		if (document.getElementById(id).style.display == 'none'){
			document.getElementById(id).style.display = '';
			icon.childNodes.item(0).src = webroot + "/img/hide.gif";
		} else {
			document.getElementById(id).style.display = 'none';
			icon.childNodes.item(0).src = webroot + "/img/show.gif";
		}
		
	}
	
	
	function setFieldFromMenu(selMenu,setField) {
		//
		// Sets field text to contain selected menu text.
		// 13-Mar-2006, bdp, created
		//
		// Note: This doesn't always work on Safari.
		//

		//The selected menu index.
		var selIndex = selMenu.options[selMenu.selectedIndex].index; 
		
		// The selected menu text. Note that using .value works on most
		// browsers but breaks on IE. THIS WOULD PRESENT A PROBLEM IF YOU
		// NEED <option value="somevalue">sometext</option>. I'm not sure
		// how to work around this.
		var selMenuText = selMenu.options[selIndex].text; 
		
		// Set fields value
		setField.value = selMenuText;
		
	}

   /**
   	* If clipBoard (a JSON) exists, use its object values to 
	* 'paste' corresponding values into component form fields
	* 
	* @created: 28-Nov-2006
	* @author:  bdp
	* 
	* 28-Mar-2006, removed part number copy
	* 04-Dec-2008, added is_expendable copy
	*/
	function pasteComponentData(selObj,clipBoard) {
		
		if (clipBoard) {

			thisForm = selObj.form;
			var theJSON   = unescape(clipBoard);
			var cb = eval('(' + theJSON + ')');
			
			// Set input text and textarea fields
			thisForm.f_component_name.value = cb.component_name != null ? cb.component_name : '';
			thisForm.f_component_descript.value = cb.component_descript != null ? cb.component_descript: '';
			thisForm.f_manufacturer.value = cb.manufacturer != null ? cb.manufacturer : '';
			// thisForm.f_manuf_part_num.value = cb.manuf_part_num;
			thisForm.f_manuf_model_num.value = cb.manuf_model_num != null ? cb.manuf_model_num : '';
			thisForm.f_manuf_model_name.value = cb.manuf_model_name != null ? cb.manuf_model_name : '';
			thisForm.f_manuf_address.value = cb.manuf_address != null ? cb.manuf_address : '';
			thisForm.f_component_cost_usd.value = cb.component_cost_usd != null ? cb.component_cost_usd : '';
			thisForm.f_calib_interval_days.value = cb.calib_interval_days != null ? cb.calib_interval_days : '';
			
			// Check Is Comp. Calibrated checkbox?
			thisForm.f_calibration_flag_cb.checked = (cb.calibration_flag == 1);
			
			// Check Is Expendable checkbox
			thisForm.f_is_expendable_cb.checked = (cb.is_expendable == 1);
			
			// Set Initial Location menu if pasted value is in options
			var locationsOptsCnt = thisForm.f_component_location_menu.length;
			for (var i = 0; i < locationsOptsCnt ; i++) {
				var optionTxt = thisForm.f_component_location_menu.options[i].text;
				if (optionTxt == cb.location_name) {
					thisForm.f_component_location_menu.selectedIndex = i;
				}
			}
			
			// Set Property Owner menu if pasted value is in options
			var ownerOptsCnt = thisForm.f_property_owner_menu.length;
			for (var i = 0; i < ownerOptsCnt ; i++) {
				var optionTxt = thisForm.f_property_owner_menu.options[i].text;
				if (optionTxt == cb.property_owner) {
					thisForm.f_property_owner_menu.selectedIndex = i;
				}
			}
			
			// Set Export Ctl. No (ECCN) menu if pasted value is in options
			var eccnOptsCnt = thisForm.f_export_ctl_class_num_menu.length;
			for (var i = 0; i < eccnOptsCnt ; i++) {
				var optionTxt = thisForm.f_export_ctl_class_num_menu.options[i].text;
				if (optionTxt == cb.export_ctl_class_num) {
					thisForm.f_export_ctl_class_num_menu.selectedIndex = i;
				}
			}
			
		} else {
			alert ('Sorry, there is nothing to paste.');
		}
		
	} // end pasteComponentData