//[request]

	function _request(_action,_url,_response)
	{
		if(_url.length==0)
		{
			eval("if(window."+_action+"_request){ _url="+_action+"_request(); }");
			if(_url=="__stop") return;
		}

		var d = new Date();

		_url = _action+".php?t="+d.getTime()+_url;

		try{ if(_response.length>1) _action = _response; }catch(e){}

		//alert(_url);

		//show_loading();

		// code for Mozilla, etc.
		if (window.XMLHttpRequest)
		{
			// try{ netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); }catch(e){alert(e);}

			xmlhttp=new XMLHttpRequest();

			xmlhttp.onreadystatechange=eval(_action+'_response');
			xmlhttp.open("GET",_url,true);
			xmlhttp.setRequestHeader("Content-Type", "text");

			xmlhttp.send(null);

		}
		// code for IE
		else if (window.ActiveXObject)
		{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

			if (xmlhttp)
			{
				xmlhttp.onreadystatechange=eval(_action+'_response');
				xmlhttp.open("GET",_url,true);
				xmlhttp.setRequestHeader("Content-Type", "text");			

				xmlhttp.send();
			}
		}

	}

//[dom]

	function $(id){ return document.getElementById(id); }
	
	function getCheckedValue(radioObj) {
		if(!radioObj)
			return "";
		var radioLength = radioObj.length;
		if(radioLength == undefined)
			if(radioObj.checked)
				return radioObj.value;
			else
				return "";
		for(var i = 0; i < radioLength; i++) {
			if(radioObj[i].checked) {
				return radioObj[i].value;
			}
		}
		return "";
	}
	
	function setCheckedValue(radioObj, newValue) {
		if(!radioObj)
			return;
		var radioLength = radioObj.length;
		if(radioLength == undefined) {
			radioObj.checked = (radioObj.value == newValue.toString());
			return;
		}
		for(var i = 0; i < radioLength; i++) {
			radioObj[i].checked = false;
			if(radioObj[i].value == newValue.toString()) {
				radioObj[i].checked = true;
			}
		}
	}	