function sum()
     {
       var a = window.document.getElementById("mainboard_total").value;
       var b = window.document.getElementById("cpu_total").value;
       var c = window.document.getElementById("video_total").value;
       var d = window.document.getElementById("harddisk_total").value;

       var e = window.document.getElementById("memory_total").value;

       var f = window.document.getElementById("cdrom_total").value;

       var g = window.document.getElementById("videocard_total").value;

       var h = window.document.getElementById("netcard_total").value;

       var i = window.document.getElementById("soundcard_total").value;

       var j = window.document.getElementById("modem_total").value;

       var k = window.document.getElementById("keyboard_total").value;
       var l = window.document.getElementById("mouse_total").value;
        var p = window.document.getElementById("cpufan_total").value ;
       var n = window.document.getElementById("boxfan_total").value;

       var sum = parseInt(a) +parseInt(b) +parseInt(c) + parseInt(d) + parseInt(e) + parseInt(f) + parseInt(g) + parseInt(h) +parseInt(i) + parseInt(j)  + parseInt(n) + parseInt(k) +parseInt(l) +parseInt(p);
       window.document.getElementById("alltotal").value = sum;

      createXMLHttpRequest();
	  var strurl="find.php?str="+sum;
	  xmlHttp.open("GET",strurl,true);
	  xmlHttp.onreadystatechange=handleState_AJAX;
	  xmlHttp.setRequestHeader("If-Modified-Since","0");  //清除缓存
	  xmlHttp.send(null);
     }


function createXMLHttpRequest()
{
	if(window.ActiveXObject)
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if(window.XMLHttpRequest)
		{
			xmlHttp = new XMLHttpRequest();
		}
	}

	function handleState_AJAX()
	{
		if(xmlHttp.readyState==4)
		{
			if(xmlHttp.status==200)
			{
				showajax();
			}
			else
				{
				  alert("服务端返回状态" + xmlHttp.statusText);
				}
		}
		 else
			{
			   window.document .getElementById ("findajax").innerHTML ="数据加载中";
			}
	}

			function showajax()
			{
			  window.document.getElementById("findajax").innerHTML =xmlHttp.responseText;
			}






