var Loading="<div class='loader'><p><img  src='/db/items/loader.gif' height='32' width='32' alt=''/><br/>Loading...</p></div>";
loadimg = new Image();loadimg.src = "/db/items/loader.gif";
vpre="<div id='innerhold'>";
vend="</div>";
function GrabItem(id) {
var xmlHttp;
try{xmlHttp=new XMLHttpRequest(); }
catch (e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch (e){alert("Sorry, but your browser does not support this feature.");return false;}}}
xmlHttp.onreadystatechange=function() {
if(xmlHttp.readyState==1) {document.getElementById('DBitem').innerHTML=Loading; }
if(xmlHttp.readyState==4) {
document.getElementById('DBitem').innerHTML=vpre+xmlHttp.responseText+vend;}}
xmlHttp.open("GET","/db/items/item.php?id="+id,true);
xmlHttp.send(null);}

function SearchItem() {
var xmlHttp;
try{xmlHttp=new XMLHttpRequest(); }
catch (e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch (e){alert("Sorry, but your browser does not support this feature.");return false;}}}
xmlHttp.onreadystatechange=function() {
if(xmlHttp.readyState==1) {document.getElementById('list').innerHTML=Loading; }
if(xmlHttp.readyState==4) {
document.getElementById('list').innerHTML=xmlHttp.responseText;}}
xmlHttp.open("GET","/db/items/item.php?term="+document.getElementById('term').value,true);
xmlHttp.send(null);}

function ResetItem() {
var xmlHttp;
try{xmlHttp=new XMLHttpRequest(); }
catch (e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch (e){alert("Sorry, but your browser does not support this feature.");return false;}}}
xmlHttp.onreadystatechange=function() {
if(xmlHttp.readyState==1) {document.getElementById('list').innerHTML=Loading; }
if(xmlHttp.readyState==4) {
document.getElementById('list').innerHTML=xmlHttp.responseText;}}
xmlHttp.open("GET","/db/items/item.php?reset=true",true);
xmlHttp.send(null);}

function CheckSubmit(e) {
e = e || window.event;
if (e.keyCode == 13) {SearchItem(); return false;}
}