  var http_request = false;
  
   function makePOSTRequest(url, parameters, resulted, btn) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      
      http_request.onreadystatechange = function()
	  {
		  
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
			off(btn);
			loading(resulted);//loading
            result = http_request.responseText;
		    document.getElementById(resulted).innerHTML = result; 
			on(btn);
		    } else {
            alert('A Problem Occurred.');
         }
      }
		  
	  }
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	  http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function loading(ob)
     {
     document.getElementById(ob).innerHTML = '<img src="images/loading.gif" width="16px" height="16px"     align="absmiddle" />';
    }
	
	
   function get(resulted, obj, btn, act, target, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10) {
	var poststr = "";
	if(field1 != null){
    field_1=document.getElementById(field1).value;
    poststr += "field_1=" + field_1;
	}
	if(field2 != null){
    field_2=document.getElementById(field2).value;
    poststr += "&field_2=" + field_2;
	}
	if(field3 != null){
    field_3=document.getElementById(field3).value;
    poststr += "&field_3=" + field_3;
	}
	if(field4 != null){
    field_4=document.getElementById(field4).value;
    poststr += "&field_4=" + field_4;
	}
	if(field5 != null){
    field_5=document.getElementById(field5).value;
    poststr += "&field_5=" + field_5;
	}
	if(field6 != null){
    field_6=document.getElementById(field6).value;
    poststr += "&field_6=" + field_6;
	}
	if(field7 != null){
    field_7=document.getElementById(field7).value;
    poststr += "&field_7=" + field_7;
	}
	if(field8 != null){
    field_8=document.getElementById(field8).value;
    poststr += "&field_8=" + field_8;
	}
	if(field9 != null){
    field_9=document.getElementById(field9).value;
    poststr += "&field_9=" + field_9;
	}
	if(field10 != null){
    field_10=document.getElementById(field10).value;
    poststr += "&field_10=" + field_10;
	}
	if(target != null){
    	target_page = target;
	}else{
		target_page = 'item.php';
	}

    makePOSTRequest(target_page + act, poststr, resulted, btn);
   }
//-------------------


	function off(itm)
	{
	 obj1=document.getElementById(itm);
	 obj1.disabled=true;
	 }
	 
	function on(itm)
	{
	 obj2=document.getElementById(itm);
	 obj2.disabled=false;
	 }

//---------------------------