<!--
//////////////////////////////////////////////////////////////////////////////////////////////
//	basic function
//////////////////////////////////////////////////////////////////////////////////////////////
function ajax_getXMLasync( url,p_callbackfunc ){
	req_async = this.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
	if( req_async ){
		//async
		/*
		req_async.onreadystatechange = function() {
			if (req_async.readyState == 4 && req_async.status == 200) {
				//return req_async;
			}
		}
		*/
		req_async.onreadystatechange = p_callbackfunc;
		req_async.open("GET", url, true);
		req_async.send( null );
	}
	return req_async;
}
function ajax_getXMLsync( url ){
	var req = this.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
	if( req ){
		//sync
		req.open("GET", url, false);
		req.send( null );
	}
	return req;
}
function ajax_getObject(obj) {
	return document.getElementById(obj);
}

//////////////////////////////////////////////////////////////////////////////////////////////
//	data loading
//////////////////////////////////////////////////////////////////////////////////////////////
function ajax_setData( dataURL,dataHolderName ){
	var req = ajax_getXMLasync( dataURL );
	var obj = ajax_getObject( dataHolderName );
	if( req && req.status==200 && obj ){
		//obj.style.display=='none' ? obj.style.display='':obj.style.display='none';
		obj.innerHTML = req.responseText;
	}
}
function ajax_setIframe( dataURL,dataHolderName,width,height,border ){
	var obj = ajax_getObject( dataHolderName );
	var newiframe = document.createElement("iframe");
	if( obj && newiframe ){
		newiframe.setAttribute( "id","iframe_topbanner" );
		newiframe.setAttribute( "frameBorder","0" );
		newiframe.style.margin = "0px";
		newiframe.style.padding = "0px";
		newiframe.style.width = width;
		newiframe.style.height = height;
		if( border=="" || border=="undefined" || border==null ){
			border = "0px";
		}
		newiframe.style.border = border;
		newiframe.setAttribute( "src",dataURL );
		obj.appendChild( newiframe );
	}
}
function ajax_setIframeWithWait( dataURL,dataHolderName,width,height,border ){
	var obj = ajax_getObject( dataHolderName );
	var newiframe = document.createElement("iframe");
	if( obj && newiframe ){
		obj.style.width = width;
		obj.style.height = height;
		newiframe.setAttribute( "id","iframe_topbanner" );
		newiframe.setAttribute( "frameBorder","0" );
		newiframe.style.margin = "0px";
		newiframe.style.padding = "0px";
		newiframe.style.width = width;
		newiframe.style.height = height;
		if( border=="" || border=="undefined" || border==null ){
			border = "0px";
		}
		newiframe.style.border = border;
		newiframe.setAttribute( "src",dataURL );
		timeoutfunc = function func_timeout(){
							//it must be changed to delete all children,and there must be an error when there is no child.
							obj.removeChild( obj.firstChild );
							obj.appendChild( newiframe )
						};
		setTimeout( "timeoutfunc()","200" );
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////
//	validate functions
//////////////////////////////////////////////////////////////////////////////////////////////
function ajax_validateRadio( radio ){
	for( var cnt=0; cnt<radio.length; cnt++ ){
		if( radio[cnt].checked ){
			return true;
		}
	}
	return false;
}


//-->
