/**
 * Select Image Controller Component 1.0
 * by Shawn Neumann, Feb 1999
 * Copyright (c) 1999 EPIC Solutions International Inc.
 *
 */
 
 
function MoveDown(obj) {
//cs added these
//used for swapping order of items in a multi-select box.
	if (obj.selectedIndex  < 0 ) { return; }
	if (obj.selectedIndex == obj.length - 1) { return; }
	if (obj.length == 1) { return; }

	a = obj[obj.selectedIndex].value;
	b = obj[obj.selectedIndex].text;

	obj[obj.selectedIndex].value = obj[obj.selectedIndex + 1].value;
	obj[obj.selectedIndex].text = obj[obj.selectedIndex + 1].text;


	obj[obj.selectedIndex + 1].value = a;
	obj[obj.selectedIndex + 1].text = b;
	obj[obj.selectedIndex + 1].selected = true;
}

function MoveUp(obj){
//cs added these
	if (obj.selectedIndex  < 0 ) { return; }
	if (obj.selectedIndex == 0) { return; }
	if (obj.length == 1) { return; }

	a = obj[obj.selectedIndex].value;
	b = obj[obj.selectedIndex].text;

	obj[obj.selectedIndex].value = obj[obj.selectedIndex - 1].value;
	obj[obj.selectedIndex].text = obj[obj.selectedIndex - 1].text;

	obj[obj.selectedIndex - 1].value = a;
	obj[obj.selectedIndex - 1].text = b;
	obj[obj.selectedIndex - 1].selected = true;

}



	function serialize_select(sel, el) {
		//by chris
		    //sel is the name of the select box,
		    // el is the element in which to store the serialized value


		    finalanswer = "";
		    for (i=0; i < sel.length; i++){

			finalanswer += sel[i].value;

			if (i != sel.length-1){
			    finalanswer += "?";
			}
		    }

		    el.value = finalanswer;

	    return 1;

		    //sel.form.submit();

		}



        var popupWin;

        function openWindow(url, name, rs, w, h, sc, tb) {
                var resize = (rs) ? "resizable=yes," : "";
                var scrollbars = (sc) ? "scrollbars=yes," : "";
                var toolbars = (tb) ? "menubar=yes," : "";
                var repalceStr = toolbars + resize + scrollbars + "width=" + w + ",height=" + h;

                popupWin = window.open(url, name, repalceStr);

            popupWin.focus();
            //return popupWin; //- this was causing problems...
        }

        var dialogueWin = 0;

        function openDialogue(url, name, w, h, e) {

                dialogueWin = window.open(url, name,'resizable=yes,width=' + w + ',height=' + h + ",left="+( e.screenX + 10) + ",top="+(e.screenY  + 10));
                dialogueWin.focus();
        }


        function close_POPs() {
            //   if (typeof(dialogueWin) != 'undefined' && typeof(dialogueWin) == 'object')
             //  {
		if (dialogueWin && !dialogueWin.closed)
		{

			     dialogueWin.close();
                             dialogueWin.opener = null;
		}//dialogueWin was not closed
            //   }//dialogueWin was a valid object
        }


	function open_window_safely(winname, arg1, arg2, arg3)
	{
        /// arg1 arg 2 and arg 3 are the three arguments of the normal window.open() function.

		var handle;
		if (typeof(winname) == 'undefined')
		{

                        handle = window.open(arg1, arg2, arg3);
		}
		else
		{
			if (winname.closed) {
				handle = winname;
				handle.opener = null;
				handle = window.open(arg1, arg2, arg3);
			}
			else
			{
				handle = winname;
				handle.document.location = arg1;

			}

		}
		return handle;
	}//end function open_win_safely




/**
 * Select Image Controller Component 1.0
 * by Shawn Neumann, Feb 1999
 * Copyright (c) 1999 EPIC Solutions International Inc.
 *
 */
       function MM_preloadImages() {
                if (document.images) {
                        var imgFiles = MM_preloadImages.arguments;
                        var preloadArray = new Array();
                        for (var i=0; i<imgFiles.length; i++) {
                                preloadArray[i] = new Image;
                                preloadArray[i].src = imgFiles[i];
                        }
                }
        }



        function MM_swapImage() {
                var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
                for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
                        objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
                          if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
                                (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
                                objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
                                obj = eval(objStr);
                                if (obj != null) {
                                        swapArray[j++] = obj;
                                        swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
                                        obj.src = MM_swapImage.arguments[i+2];
                                }
                        }
                document.MM_swapImgData = swapArray; //used for restore
        }


        function MM_swapImgRestore() { //v1.2
                if (document.MM_swapImgData != null)
                for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
                document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
        }

        function WM_imageSwap(daImage, daSrc){
            var objStr,obj;

            // Check to make sure that images are supported in the DOM.
            if(document.images){
                // Check to see whether you are using a name, number, or object
                if (typeof(daImage) == 'string') {
                    // This whole objStr nonesense is here solely to gain compatability
                    // with ie3 for the mac.
                    objStr = 'document.' + daImage;
                    obj = eval(objStr);
                    obj.src = daSrc;
                } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
                    daImage.src = daSrc;
                }
            }
        }

/**
 * Select Box Movement Component 1.0
 * by Shawn Neumann, Feb 1999
 * Copyright (c) 1999 EPIC Solutions International Inc.
 *
 */

function MM_showHideLayers() { //v1.0
  var i, visStr, args;
  args = MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) { //with arg triples (objNS,objIE,visStr)
    visStr   = args[i+2];
    if (navigator.appName == 'Netscape') {
      if (document.layers != null) eval(args[i]+".visibility = '"+visStr+"'");
    } else { //IE
      if (visStr == 'show') visStr = 'visible'; //convert vals
      if (visStr == 'hide') visStr = 'hidden';
      if (document.all != null) eval(args[i+1]+".style.visibility = '"+visStr+"'");
  } }
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}



function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}










function getRadioValue(rad)
   ///given  radio object, this function returns the value of the currently selected item
{

   //alert(rad.length);
   for (i=0; i< rad.length; i++)
	{
           if (rad[i].checked == true){ return rad[i].value; }
	}
	if (rad && !rad.length) {
		return rad.value;
	}

  return(0)
}

function selectAll(obj, deselect, noRefresh)
{
   ///this function selects all items in a given listbox, indicated by obj.
   ///if deselect is 1, the select will be deselected rather than selected.
   /// if norefresh is 1, the function will be suppressed from refreshing the page.  This is so if the list is in another page,
   //// the user script can take care of which page needs to be refreshed.


  for (i=0; i < obj.length; i++)
	{
		deselect ? obj[i].selected = false : obj[i].selected = true;
	}

 if (noRefresh){  history.go(0); }

}

function checkAll(docForm, flag) {
	for (i = 0; i < docForm.elements.length; i++) {
		formElem = docForm.elements[i];
		switch (formElem.type) {
			case 'checkbox':
				if (flag.checked) {
					formElem.checked = true;								
				}
				else {
					formElem.checked = false;												
				}
		}
	}
}

function getAllFromSelect(ItemList) {
	var FormSelected = ItemList;
        if (FormSelected) {
                var i=FormSelected.length -1;
        }
	var ReturnImages;
	while (i >= 0) {
		if (i == FormSelected.length -1) {
			ReturnImages = FormSelected.options[i].value + "|";
		}
		else if (i == 0) {
			ReturnImages = ReturnImages + FormSelected.options[i].value + "|";
		}
		else {
			ReturnImages = ReturnImages + FormSelected.options[i].value + "|";
		}
		i--;
	}
        if (ReturnImages) {
                return(ReturnImages);
        }
        else {
                return(0)
        }
}

function getAllSelectedItems(FormSelected) {
        if (FormSelected) {
                var i=FormSelected.length -1;
        }
  var ReturnImages = "";
	while (i >= 0) {
    if ( FormSelected.options[i].selected ) {
        ReturnImages = ReturnImages + FormSelected.options[i].value + "|";
    }
    i--;
	}
        if (ReturnImages) {
                return(ReturnImages);
        }
        else {
                return(0)
        }
}






/**
 * Select Image Controller Component 1.0
 * by Shawn Neumann, Feb 1999
 * Copyright (c) 1999 EPIC Solutions International Inc.
 *
 */

        function checkEmail(checkStringForm) {
                checkString = checkStringForm.value;
                //alert("Hello " + checkStringForm.value);
                var newstr = "";
                var at = false;
                var dot = false;
                if ( checkString.length == 0) {
                        return true;
                }
                //DO SOME PRELIMINARY CHECKS ON THE DATA
                // IF EMAIL ADDRESS HAS A '\@' CHARACTER
                if (checkString.indexOf("\@") != -1) {
                        at = true;
                        //    IF EMAIL ADDRESS HAS A '.' CHARACTER
                }
                else if (checkString.indexOf(".") != -1) {
                        dot = true;
                }
                // PARSE REMAINDER OF STRING
                for (var i = 0; i < checkString.length; i++) {
                        ch = checkString.substring(i, i + 1)
                        if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z") || (ch == "\@") || (ch == ".") || (ch == "_")
                        || (ch == "-") || (ch >= "0" && ch <= "9")) {
                                newstr += ch;
                                if (ch == "\@") {
                                        at=true;
                                }
                                if (ch == ".") {
                                        dot=true;
                                }
                        }
                }
                if ((at == true) && (dot == true)) {
                        return newstr;
                }
                else {
                // DISPLAY ERROR MESSAGE
                        alert ("Sorry, the email address you entered is not in the correct format.");
                        checkStringForm.value = "";
                        checkStringForm.focus();
                        return false;
                }

        }

function clearDate(FormElement) {
        //alert(FormElement);
        if (FormElement.value == "YYYY-MM-DD") {
                FormElement.value = "";
        }
}



function toggleSelectAll(CB_form, Base_checkbox, checkbox_prefix) {
//selects all checkboxes in a form:

    for (var i=0; i< CB_form.elements.length; i++) {
      e = CB_form.elements[i];

                if (e.type == "checkbox" && e.name.search(checkbox_prefix) != -1 ) {

                        e.checked = Base_checkbox.checked;
                }
        }
}

var scrollbox_flag;
function scrollbox_selectRow(d) {
    if (scrollbox_flag) {
            scrollbox_flag.style.color="#000000";
            scrollbox_flag.style.backgroundColor='';
    }
    d.style.color='#ffffff';
    d.style.backgroundColor='#999999';
    scrollbox_flag = d;    
}


function getCurrentStyle(el,styleProp)
{
	var x = document.getElementById(el);
	if (window.getComputedStyle) {
		var y = window.getComputedStyle(x,null).getPropertyValue(styleProp);
	}
	else if (x.currentStyle) {
		var y = eval('x.currentStyle.' + styleProp);
	}
	return y;
}

function showDiv(d,id) {
	var h = d.height;
	if (!h) {
		h = 'auto';
	}
	d.style.height = h;	
	if (d.marginTop) {
		d.style.marginTop = d.marginTop;
	}
	if (d.marginBottom) {
		d.style.marginBottom = d.marginBottom;
	}
	if (d.paddingTop) { 
		d.style.paddingTop = d.paddingTop;
	}
	if (d.paddingBottom) {
		d.style.paddingBottom = d.paddingBottom;
	}
	if (d.marginRight) {
		d.style.marginRight = d.marginRight;
	}
	if (d.marginLeft) {
		d.style.marginLeft = d.marginLeft;
	}
	if (d.paddingRight) { 
		d.style.paddingRight = d.paddingRight;
	}
	if (d.paddingLeft) {
		d.style.paddingLeft = d.paddingLeft;
	}
	d.style.visibility = 'visible';
}

function hideDiv(d,id) {
	// store values for restoring later
	
	if (!d.height)
		d.height = getCurrentStyle(id, "height");
	if (!d.marginTop)
		d.marginTop = getCurrentStyle(id, "margin-top");
	if (!d.marginBottom)	
		d.marginBottom = getCurrentStyle(id, "margin-bottom");
	if (!d.marginRight)		
		d.marginRight = getCurrentStyle(id, "margin-right");
	if (!d.marginLeft)		
		d.marginLeft = getCurrentStyle(id, "margin-left");
	if (!d.paddingBottom)			
		d.paddingBottom = getCurrentStyle(id, "padding-bottom");
	if (!d.paddingTop)
		d.paddingTop = getCurrentStyle(id, "padding-top");
	if (!d.paddingRight)		
		d.paddingRight = getCurrentStyle(id, "padding-right");
	if (!d.paddingLeft)		
		d.paddingLeft = getCurrentStyle(id, "padding-left");

	d.style.height = '0px';
	d.style.marginTop = '0px';
	d.style.paddingTop = '0px';
	d.style.marginBottom = '0px';
	d.style.paddingBottom = '0px';
	d.style.visibility = 'hidden';
}

function showDiv(d,id) {
	var h = d.height;
	if (!h) {
		h = 'auto';
	}
	d.style.height = h;	
	if (d.marginTop) {
		d.style.marginTop = d.marginTop;
	}
	if (d.marginBottom) {
		d.style.marginBottom = d.marginBottom;
	}
	if (d.paddingTop) { 
		d.style.paddingTop = d.paddingTop;
	}
	if (d.paddingBottom) {
		d.style.paddingBottom = d.paddingBottom;
	}
	if (d.marginRight) {
		d.style.marginRight = d.marginRight;
	}
	if (d.marginLeft) {
		d.style.marginLeft = d.marginLeft;
	}
	if (d.paddingRight) { 
		d.style.paddingRight = d.paddingRight;
	}
	if (d.paddingLeft) {
		d.style.paddingLeft = d.paddingLeft;
	}
	d.style.visibility = 'visible';
}

function hideDiv(d,id) {
	// store values for restoring later
	
	if (!d.height)
		d.height = getCurrentStyle(id, "height");
	if (!d.marginTop)
		d.marginTop = getCurrentStyle(id, "margin-top");
	if (!d.marginBottom)	
		d.marginBottom = getCurrentStyle(id, "margin-bottom");
	if (!d.marginRight)		
		d.marginRight = getCurrentStyle(id, "margin-right");
	if (!d.marginLeft)		
		d.marginLeft = getCurrentStyle(id, "margin-left");
	if (!d.paddingBottom)			
		d.paddingBottom = getCurrentStyle(id, "padding-bottom");
	if (!d.paddingTop)
		d.paddingTop = getCurrentStyle(id, "padding-top");
	if (!d.paddingRight)		
		d.paddingRight = getCurrentStyle(id, "padding-right");
	if (!d.paddingLeft)		
		d.paddingLeft = getCurrentStyle(id, "padding-left");

	d.style.height = '0px';
	d.style.marginTop = '0px';
	d.style.paddingTop = '0px';
	d.style.marginBottom = '0px';
	d.style.paddingBottom = '0px';
	d.style.visibility = 'hidden';
}


// AJAX // The following are some basic universal AJAX functions

function formData2QueryString(docForm) {

	if (!docForm) {
		docForm = document.forms[0];
	}

		
	var strSubmitContent = '';
	var formElem;
	var strLastElemName = '';
	
	for (i = 0; i < docForm.elements.length; i++) {
		
		formElem = docForm.elements[i];
		switch (formElem.type) {
			// Text fields, hidden form elements
			case 'text':
			case 'hidden':
			case 'password':
			case 'textarea':
			case 'select-one':
				strSubmitContent += formElem.name + '=' + escape(formElem.value) + '&'
				break;
				
			// Radio buttons
			case 'radio':
				if (formElem.checked) {
					strSubmitContent += formElem.name + '=' + escape(formElem.value) + '&'
				}
				break;
				
			// Checkboxes
			case 'checkbox':
				if (formElem.checked) {
					// Continuing multiple, same-name checkboxes
					//alert(formElem.name);
					strSubmitContent += formElem.name + '=' + escape(formElem.value) + '&'
					//if (formElem.name == strLastElemName) {
					//	alert(strLastElemName);
					//	// Strip of end ampersand if there is one
					//	if (strSubmitContent.lastIndexOf('&') == strSubmitContent.length-1) {
					//		alert('here');
					//		strSubmitContent = strSubmitContent.substr(0, strSubmitContent.length - 1);
					//	}
					//	// Append value as comma-delimited string
					//	strSubmitContent += ',' + escape(formElem.value);
					//	alert(strSubmitContent);
					//}
					//else {
					//	strSubmitContent += formElem.name + '=' + escape(formElem.value);
					//}
					////alert(strSubmitContent);
					//strSubmitContent += '&';
				}
				break;
				
		}
		strLastElemName = formElem.name
	}
	
	// Remove trailing separator
	strSubmitContent = strSubmitContent.substr(0, strSubmitContent.length - 1);
	return strSubmitContent;
}

// This is the actual AJAX Posting mechanism.  It will tell you which js function will get triggered with the response
function xmlhttpPost(strURL, strSubmit, strResultFunc) {

        var xmlHttpReq = false;
        
        // Mozilla/Safari
        if (window.XMLHttpRequest) {
                xmlHttpReq = new XMLHttpRequest();
                //commenting until FF1.5 fixed
                xmlHttpReq.overrideMimeType('text/xml');
				//xmlHttpReq.overrideMimeType('text/plain');                
        }
        // IE
        else if (window.ActiveXObject) {
                xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
        }
        
		xmlHttpReq.open('POST', strURL, true);
        xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        xmlHttpReq.onreadystatechange = function() {
                if (xmlHttpReq.readyState == 4) {
	                //alert(xmlHttpReq.responseText.length);
					if (!d7_ajax_hook(xmlHttpReq.responseText)){
						//cs 2005-06-16 minimum code for login and error handling...	
						return;
					}
                    eval(strResultFunc + '(xmlHttpReq.responseText, xmlHttpReq);');
                }
        }
        xmlHttpReq.send(strSubmit);        
}



function d7_ajax_hook(responseText) {

	login_exp = new RegExp("AJAXLOGIN")  

//	if (responseText.substr(0,9) == "AJAXLOGIN"){
	if (responseText.match(login_exp)) {

		ajaxlogin();
		return 0;
	}

	error_exp = new RegExp("AJAXERROR")  

//	if (responseText.substr(0,9) == "AJAXERROR"){
	if (responseText.match(error_exp)) {
		ajaxerror(responseText);
		return 0;
	}

	return 1;

}

function ajaxlogin() {
//cs 2005-06-16

	top.document.location.reload();

}

function ajaxerror(err) {
//cs 2005-06-16
	err = err.replace(/AJAXERROR\: /g,"");
	var w = window.open("", "RouteOne_Error", 'toolbar,width=500,height=400,scrollbars');
	w.document.write(err);
	//alert(err);

}

function MoveItems(FormFrom, FormTo, FormSource, FormReturn, NoRemoveFrom, Unique, HistoryNoGo, MoveAll) {
// PLEASE REMOVE THIS CODE - DO NOT USE THIS FUNCTION
//why? it's used by the SelectBox class.
//formfrom, formto: the form to transfer from and to
//formsource, form return: source is  a list , retrun a textbox. the text box is filled with all the list text.
//noremove from prevents item from source from being deleted.
//unique won't copy from -> to if from is already in to.
//HistoryNoGo prevents listbox from resizing. Useful if you haven't deleted an item from the list.

	var i=FormFrom.length -1;
        var z=FormTo.length; // = +1; // - 1;
	if (z == -1) { z = 0; }
        var initlen = FormTo.length - 1;
        var j=initlen;

        var uniqueflag = 1;

        // var oneSelected = FormFrom[FormFrom.selectedIndex].text;



	while (i >= 0) {

                if (MoveAll || FormFrom.options[i].selected) { //
                        // alert(FormFrom.options[i].text);

			if (Unique == 1) {
                                for (j=initlen; j>=0; j--) {
                                  if (FormTo.options[j].value == FormFrom.options[i].value) {
					uniqueflag = 0;
                                  }

				}
                        }
                	if (uniqueflag == 1) {


                                FormTo.options[z] = new Option(FormFrom.options[i].text, FormFrom.options[i].value);
                                z++;

                        }
      			else {
			 uniqueflag = 1;
			}

                        if (NoRemoveFrom !=  1) {
                          FormFrom.options[i] = null;
                        }
      		}

                i--;
	}
    if (!HistoryNoGo) {
        history.go(0);
       }
        getItemsList(FormSource, FormReturn);
}


var selectedItems;
var previousSelected;
var classMatch = /selected/;
var multiselect = '0';
function toggleTableRow(r, id, newFunction) {

	if (previousSelected && multiselect != 1) {
		var p = previousSelected;
		changeClass('remove', p, 'selected');
		if (previousSelected.id == id) {
			previousSelected = null;	
			return;
		}	
	}
	if (r.className.search(classMatch) != -1) {
		changeClass('remove', r, 'selected');
		}
	else {
		changeClass('add', r, 'selected');
		}

	if (!previousSelected || (previousSelected && previousSelected.id != id)) {
		previousSelected = r;	
	}
	eval(newFunction + '(id)');
}

function changeClass(a,o,c1,c2)
{
// a is is the action we want to do
// o is the DOM element 
// c1 is first class
// c2 is second class
  switch (a){
    case 'swap':
      o.className=!changeClass('check',o,c1)?o.className.replace(c2,c1): o.className.replace(c1,c2);
    break;
    case 'add':
      if(!changeClass('check',o,c1)){o.className+=o.className?' '+c1:c1;}
    break;
    case 'remove':
      var rep=o.className.match(' '+c1)?' '+c1:c1;
      o.className=o.className.replace(rep,'');
    break;
    case 'check':
      return new RegExp('\\b'+c1+'\\b').test(o.className)
    break;
  }
}


// This section should seemlessly manage the clicking of tr's in table lists.  
// Passing off the results to a pre-determined function

var table_list_page;

var tableList = function() {

	this.env = new Object();

	table_list_page = this;
	this.ref = 'table_list_page';

	// set environment variable
  	this.set_env = function(name, value) {
	      this.env[name] = value;    
    	};

	this.env.testenv = 'shawn';

	this.init = function() {
		var tl = document.getElementById('theTable');
		var row;
	    for(var r=0; r<tl.tBodies[0].childNodes.length; r++) {   	
	        row = tl.tBodies[0].childNodes[r];
			
	        if (!row.id) { 
	        	continue; 
	        }
			row.targetFunction = this.env.targetFunction;
	        row.onmouseup = function (e) {
			func = e.target.parentNode.targetFunction; 
			toggleTableRow(e.target.parentNode, findRowID(e), func); 
		};
        }
	}
	//alert(row);
	
}


findRowID = function(e, id)
    {
    
	return e.target.parentNode.id;
    };

// set onload handler
window.onload = function(e)
  {
  if(typeof initMenus!="undefined") {
	  eval ( initMenus() );
  }
  if (window.table_list_page)
    table_list_page.init();
  };

// set onload handler
//window.onload = tableList;


function savePrefs(action, f) {
	items = formData2QueryString(f);	
	items = items +'&action='+action;
	f.disabled = true;
	xmlhttpPost("/index.html?action=ajax", items , "gotSavedPrefs" );	
	return false;
}

function gotSavedPrefs() {
	//f.disabled = false;
}