	var readStateFocusControl;
	var readStateFocusControl2;

	function saveState(stateName, stateControlnames) {
		var p = stateControlnames.split('|');
		var c;
		var l;
		var j;
		var k;
		var sState = '';
		for (var i = 0; i < p.length; i = i + 1) {
			c = document.getElementById(p[i]);
			if (c) {
				j = '' + c.selectedIndex + '';
				k = '' + c.checked + '';
				l = '' + c.value + '';
				sState = sState + p[i];
				sState = sState + '°'; 
				if (j!='undefined') sState = sState + j;
				sState = sState + '°';
				if (k!='undefined') sState = sState + k;
				sState = sState + '°';
				if (l!='undefined') sState = sState + l;
				sState = sState+ '|';
			}
		}
		AjaxPro.timeoutPeriod = 60000; 
		Rainbow.DesktopModules.ecpPostbackHandlerControl.SetSetting(stateName,sState);
	}
	// ---------------------------------------------------------------------
	function readState(stateName) {
		AjaxPro.timeoutPeriod = 60000; 
		Rainbow.DesktopModules.ecpPostbackHandlerControl.GetSetting(stateName, readState_Response);
	}
	function readState_Response(response)
	{
		var sState = response.value;
		if (sState) {
			var p = sState.split('|');
			var c;
			var s;
			var cName;
			for (var i = 0; i < p.length; i = i + 1) {
				if (p[i]) {
					s = p[i].split('°');
					cName = s[0];
					c = document.getElementById(cName);
					if (c) {
						if (s[1]!='') {
							c.selectedIndex = s[1];
						} 
						if (s[2]!='') {
							if (s[2]=='true') {
								c.checked = true;
							} else {
								c.checked = false;
							}
						}
						c.value = s[3];
					}
				}
			}
		}
		if (readStateFocusControl) {
			if (readStateFocusControl.value!='') {
				readStateFocusControl.focus();
				readStateFocusControl.select();
			} else {
				if (readStateFocusControl2) {
					if (readStateFocusControl2.value!='') {
						readStateFocusControl2.focus();
						readStateFocusControl2.select();
					} else {
						readStateFocusControl.focus();
						readStateFocusControl.select();
					}
				} else {
					readStateFocusControl.focus();
					readStateFocusControl.select();
				}
			}
		}
		checkStateAll();
		try {
			afterReadState();
		} catch (e) {
		} finally {
		}
	}
	function resetState(stateName) {
		AjaxPro.timeoutPeriod = 60000; 
		Rainbow.DesktopModules.ecpPostbackHandlerControl.SetSetting(stateName,'');
	}
	// ---------------------------------------------------------------------

