function saveItemstateChanged() 
{ 
   if (xmlHttp.readyState==4)
   { 
	  if(xmlHttp.responseText.match("SUCCESS"))   
	     alert("The Item has been saved.");
	  else
	     alert("Your have already save the item");
   }
}
function saveItem(companycode,itemNo)
{
    xmlHttp=getXmlHttpObject();                                                            
   if (xmlHttp==null)
   {
      alert ("Your browser does not support AJAX!");
      return;
   }
   var getAddress =   window.location.href.substr(7);
   var addresses = getAddress.split("/");
   var mainPage = addresses[1].split("?");
   var url=window.location.href.substr(0,7) + addresses[0]+"/interface/saveItem.php"; 
   url=url+"?itemNo="+itemNo+"&companycode="+companycode;
   xmlHttp.onreadystatechange=saveItemstateChanged;
   xmlHttp.open("GET",url,true);
   xmlHttp.send(null);
}

