function getxmlhttp() {

var xmlhttp=false;
try {
	// if Javascript version>5
	xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
	//if not use the older ActiveX object
	try {
	//if using IE
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
	xmlhttp=false;
	}
}
// if not using IE, create a javascript instance of the object
if(!xmlhttp && typeof XMLHttpRequest != 'undefined') {
	xmlhttp=new XMLHttpRequest();
}

return xmlhttp;

}


function onCharset()
{

	var charset = document.getElementById("db_charset").value;

	var url_str="include/get_info.php?charset="+charset;

	xmlhttp=getxmlhttp();
	xmlhttp.open("GET",url_str);
	xmlhttp.onreadystatechange = function () {

		if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {

			var result=xmlhttp.responseText;
			var split_ch=result.split(",");
			var no = split_ch.length;
			document.getElementById("db_collation").options.length = 0;
			var cIndex = 0;

			for (var j=0;j<no;j++) {
				split_d=split_ch[j].split(':');
				var collation=split_d[0];
				var def=split_d[1];
				document.getElementById("db_collation").options[cIndex] = new  Option(collation, collation);
				if(def==1) { document.getElementById("db_collation").selectedIndex = cIndex; }
				cIndex++;
			}
		}
	}
	xmlhttp.send(null);
}

