var http = createRequestObject();
var loadingtext = innerHTML="<center><b>Loading ...</b></center>";

function createRequestObject() {
	var xmlhttp;
	try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); }
	catch(e) {
    try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
	catch(f) { xmlhttp=null; }
  }
  if(!xmlhttp&&typeof XMLHttpRequest!="undefined") {
	xmlhttp=new XMLHttpRequest();
  }
	return  xmlhttp;
}

function trim(method) {
return method.replace(/^s*(S*(s+S+)*)s*$/, "$1");
}

function showSelected()
{
	var selobj = document.getElementById('select');
	var txtValueObj = document.getElementById('get');

	var selindex = selobj.selectedIndex;
	select_categories(selobj.options[selindex].value,0);
}

function select_categories(id,check) {
		try {
			http.open('POST',  'index.php');
			http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			http.onreadystatechange = function(){
				if((http.readyState == 4)&&(http.status == 200)){
				var response = http.responseText;
					document.getElementById("show_categories").innerHTML = response;
				}
			};
			http.send('select='+id+'&check='+check);
		}
		catch(e){}
		finally{}
}