////////////////////////////////////////////loading index page////////////////////////
function  loaditemaname()
{
var url;
var class_code;
var obj_form=document.form2;
class_code=obj_form.category.value;
class_code2=1;
url = "loaditem.php?cuid="+class_code+"&typ="+class_code2;
if (window.XMLHttpRequest )
{
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange=loaditemnamedetails;
xmlhttp.open("GET",url,true);
xmlhttp.send (null);
}
else if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
if (xmlhttp)
{
xmlhttp.onreadystatechange=loaditemnamedetails;
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader ('Content-Type',  'application/x-www-form-urlencoded');
xmlhttp.setRequestHeader('Expires','Sat, 1 Jan 2005 05:00:00 GMT');
xmlhttp.setRequestHeader('Last-Modified','Sat, 1 Jan 2005 05:00:00 GMT');
xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");   
xmlhttp.setRequestHeader('Pragma','no-cache');
xmlhttp.setRequestHeader('Cache-Control', 'no-cache');
xmlhttp.send();
}
}
}
function loaditemnamedetails()
{
var obj_form = document.form1;
if (xmlhttp.readyState==4)
{
if ( xmlhttp.status==200)
{
resultinst = xmlhttp.responseText;
var resultsinst  = resultinst.split(":");
var stateid = resultsinst[0].split("|");
var statename = resultsinst[1].split("|");
var dropList1 = "document.form2.itemname";
dropList1 = eval(dropList1);
for(var i = dropList1.length; i>0; --i)
dropList1.options[i] = null;
for(i = 0; i<stateid.length;++i)
{
if(statename[i]!='')
dropList1.options[i] = new Option(statename[i],stateid[i]);
}
}
}
//var ccode;
//var obj_form=document.form2;
//ccode=obj_form.its.value;
//if(ccode==""){ccode=0;}else{ccode=ccode;}
//alert(ccode);
//document.getElementById('itemname').selectedIndex=ccode;
}
