function doSub() { 
	document.forms[0].submit();
}

function doEtcPrice() 
{
    if (window.XMLHttpRequest) // browser has native support for XMLHttpRequest object
        http_request = new XMLHttpRequest();
    else if (window.ActiveXObject) // try XMLHTTP ActiveX (Internet Explorer) version
        http_request = new ActiveXObject("Microsoft.XMLHTTP");
 
    if (http_request)
    {
    
        http_request.open("GET", "etc_price.php", true);
        http_request.onreadystatechange = notesResponseHandler;
        //http_request.setRequestHeader("content-type", "application/x-www-form-urlencoded");
        http_request.setRequestHeader("Connection", "close");
        http_request.send("");
    } 
}

function getElById(idVal)
{
  if (document.getElementById != null)
    return document.getElementById(idVal)

  if (document.all != null)
    return document.all[idVal]

  alert("Problem getting element by id")
  return null
}

function notesResponseHandler()
{
    // Make sure the request is loaded (readyState = 4)
    if (http_request.readyState == 4)
    {
        // Make sure the status is "OK"
        if (http_request.status == 200)
        {
        	var targetObj = getElById("etc");
        	var result = http_request.responseText;
        	var html = "Actual average SELL price in <a href=\"http://www.eveonline.com/ingameboard.asp?a=channel&channelID=544711\" target=\"_blank\"><span class=\"yellow_dark\">Timecode Bazaar</span></a> : " + result + " ML. ISK";
        	
        	var div = document.createElement("div");
        	div.innerHTML = html;
        	
        	targetObj.appendChild(div);
        } 
        //else
           // alert("There was a problem retrieving the XML data:\n" +http_request.statusText);
    }
}


function doCancel() {
	if( confirm("Would you like to cancel this order?") )
		location.href ="/";
}
