   var http_request = false;
   
   function POSTRequest(URL, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
      } 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 = alertContents2;
      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 alertContents2() {
   	if (http_request.readyState == 4) {  // The response has been sent and it is complete
      	//document.getElementById('busy').style.display = 'none';
      	if (http_request.status == 200) {  // It was a good response, 200 OK
					result = eval( "(" + http_request.responseText + ")" );
					//Parse the JSON reply
					//good = 1
					Unique = result.response.Unique;

					//Build status message
					response = ""
					error = 0;
						
					if (Unique == 0){
						alert('This Already Exists in the Database');
					}else{
						alert('Inserting - ' + Unique);
					}
       } else {
          alert('There was a problem with the request. Please try again - ' + http_request.status);
          document.getElementById('submit').disabled= '';
       }
    }
 }
 
  function addmanuf(obj) {
  	var poststr = "&name=" + encodeURI( document.getElementById("s_desc").value )  +
                  "&descrip=" + encodeURI( document.getElementById("l_desc").value )  +
                  "&action=" + encodeURI("newmanuf");
    var URL = 'http://www.gissit.com/forms/modbike.php'
    POSTRequest(URL, poststr);
  }   
  
   function editmanuf(obj) {
  	var poststr = "&manuf=" + encodeURI( document.getElementById("manuf").value )  +
  								"&name=" + encodeURI( document.getElementById("s_desc").value )  +
                  "&descrip=" + encodeURI( document.getElementById("l_desc").value )  +
                  "&action=" + encodeURI("editmanuf");  
    var URL = 'http://www.gissit.com/forms/modbike.php'
    POSTRequest(URL, poststr);
  }   
  
  function addmodel(obj) {
  	var poststr = "&model_manuf=" + encodeURI( document.getElementById("manuf").value )  +
  								"&model=" + encodeURI( document.getElementById("model_s_desc").value )  +
  								"&syear=" + encodeURI( document.getElementById("syear").value )  +
                  "&eyear=" + encodeURI( document.getElementById("eyear").value )  +
                  "&model_descrip=" + encodeURI( document.getElementById("model_l_desc").value )  +
                  "&action=" + encodeURI("newmodel");
    var URL = 'http://www.gissit.com/forms/modbike.php'
    POSTRequest(URL, poststr);
  }   
  
	function editmodel(obj) {
  	var poststr = "&model=" + encodeURI( document.getElementById("model_s_desc").value )  +
  								"&model_id=" + encodeURI( document.getElementById("model_id").value )  +
                  "&model_descrip=" + encodeURI( document.getElementById("model_l_desc").value )  +
                  "&action=" + encodeURI("editmodel");
    var URL = 'http://www.gissit.com/forms/modbike.php'
    POSTRequest(URL, poststr);
  }
  
	function addcomp(obj) {
  	var poststr = "&sdesc=" + encodeURI( document.getElementById("s_desc").value )  +
  								"&ldesc=" + encodeURI( document.getElementById("l_desc").value )  +
  								"&btips=" + encodeURI( document.getElementById("b_tips").value )  +
                  "&action=" + encodeURI("newcomp");
    var URL = 'http://www.gissit.com/forms/modcomp.php'
    POSTRequest(URL, poststr);
  }
  
	function editcomp(obj) {
		var poststr = "&sdesc=" + encodeURI( document.getElementById("s_desc").value )  +
  								"&ldesc=" + encodeURI( document.getElementById("l_desc").value )  +
  								"&btips=" + encodeURI( document.getElementById("b_tips").value )  +
                  "&comp_id=" + encodeURI( document.getElementById("comp_id").value )  +
                  "&action=" + encodeURI("editcomp");
		var URL = 'http://www.gissit.com/forms/modcomp.php'
    POSTRequest(URL, poststr);
  }