function Total()
{

 var a4 = document.getElementById("A3") ; //+ 
 var b4 = document.getElementById("B3") ;
//alert(a4.value);
 tots = eval(a4.value) + eval(b4.value);
 milo.totalmiles.value =    tots.toFixed(2);
}



function GetXmlHttpObject(handler) 
{ 
  var objXmlHttp = null;
  if (navigator.userAgent.indexOf("MSIE")>=0)
  { 
   //alert("ie");
   var strName="Msxml2.XMLHTTP";
   
   if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
   {
	   //alert("5.5");
       strName="Microsoft.XMLHTTP";	 
   } 

   try
	{ 
		objXmlHttp=new ActiveXObject(strName);
		objXmlHttp.onreadystatechange=handler;
		return objXmlHttp;
	} 
   catch(e)
	{ 
		alert("Error. Scripting for ActiveX might be disabled");
	} 
   }
 else  
 if (navigator.userAgent.indexOf("Mozilla")>=0)
	{
		objXmlHttp=new XMLHttpRequest();
		objXmlHttp.onreadystatechange=handler;
		objXmlHttp.onload=handler;
		objXmlHttp.onerror=handler;
		return objXmlHttp;
	}
}
 
function PostSearch() 
{
 var objSearch = document.getElementById("txtSearchBox");

 try
{ 
 alert("here")
 xmlHttp=GetXmlHttpObject(stateChanged);
 xmlHttp.open("GET", "http://www.3g4u.co.uk/single.html", true);
 xmlHttp.send(null);
 var str= xmlHttp.responseText;
 }
 catch(e)
 {
	 alert(e);
	 }
} 

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("txtSearchBox").value=xmlHttp.responseText;
	}
} 

function stateChanged2() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    {
        //var xmlDoc=xmlHttp.responseXML.documentElement;
	    //var data = xmlDoc.documentElement.
		document.getElementById("TextArea1").value=xmlHttp.responseText; 
	}
} 

function stateChanged1() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    {
	
		if (xmlHttp.status==200)
                {
                  document.getElementById("TextArea1").value=xmlHttp.responseText; 
                }
              else
                {                 
                 alert("Problem retrieving XML data - ERROR CODE: "+xmlHttp.status+" "+xmlHttp.statusText);
                }				
	}

} 


function DoService()
{
 alert("here")
 try
 {
 xmlHttp=GetXmlHttpObject(stateChanged2);
 var url = "service1.asmx/HelloWorld";
 
    var xmlToSend = "<?xml version='1.0' encoding='utf-8'?>";
        xmlToSend += "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' ";
        xmlToSend += "xmlns:xsd='http://www.w3.org/2001/XMLSchema' ";
        xmlToSend += "xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>";
        xmlToSend += "<soap:Body><HelloWorld xmlns='http://tempuri.org/' />";
        xmlToSend += "</soap:Body></soap:Envelope>";  
                      
var buf = ''+
                '< ?xml version="1.0" encoding="utf-8"?>' +
                '< soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
                "< <soap:Body><HelloWorld xmlns='ZAFTEST' />" +
                '< /HelloWorld>< /soap:Body>' +
                '< /soap:Envelope> ';     
                                            
    xmlHttp.onreadystatechange=stateChanged2;         
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xmlHttp.setRequestHeader("Content-Length", "2555");
    xmlHttp.setRequestHeader("SOAPAction", "ZAFTEST/HelloWorld");
    xmlHttp.send(buf);
 }
 catch(e)
 {
   alert(e);
 }  
}


function AddItems()
{
 alert("here2")
 try
 {
 xmlHttp=GetXmlHttpObject(stateChanged1);
 var url = "WebService.asmx/AddItem"; 
 var buf =      '<?xml version="1.0" encoding="utf-8"?>' +
                '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
                "<soap:Body><AddItem xmlns='TEST' />" +
				"<SessionId>a</SessionId>" +
      		    "<ItemName>a</ItemName>" +
      			"<ItemPrice>a</ItemPrice>" +
     	        "<ItemQty>a</ItemQty>" +
				"<ItemExtras>a</ItemExtras>" +
      	        "<ItemNotes>a</ItemNotes>" +
                "</AddItem></soap:Body>" +
                "</soap:Envelope> ";     
                                            
    xmlHttp.onreadystatechange=stateChanged1;         
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xmlHttp.setRequestHeader("Content-Length", "2555");
    xmlHttp.setRequestHeader("SOAPAction", "TEST/AddItem");
    xmlHttp.send(buf);
 }
 catch(e)
 {
   alert(e);
 }  
}
// JavaScript Document





