//THIS IS VERY IMP (VALIDATES) THIS PART IS COMMON
function GetXmlHttpObject()
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch(e)
  {
  // Internet Explorer
	  try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
			try
			  {
			  xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			  }
			catch (e)
			  {
			  alert("Your browser does not support AJAX!");
			  return false;
			  }
		}
  }
return xmlHttp;
}


function getsubcat(str)
{ 
//alert(str);
var row = document.getElementById("category_1");
row.style.display = 'block';

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request")
	 return
	 }
	var url= SITEROOT+"/project/ajax_getsubcat.php";
	url = url+"?parent_id="+str
	xmlHttp.onreadystatechange=category;
	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);
}
	



function category() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 		{ 
				// document.getElementById("sb").style.display = "none";
				 var html = '';
				 html +=xmlHttp.responseText;
				 html += '';
				 document.getElementById("postcat").innerHTML=html;
	 		} 
	}
