document.domain='recordmania.co.kr'
var req

function searchBox(obj1,obj2) {
	return
	if(!document.getElementById("divSearchBox")) {
		var fDiv
		fDiv=document.createElement("DIV")
		fDiv.style.display='block'
		fDiv.id='divSearchBox'
		fDiv.style.left=getAbsoluteLeft(obj1)
		fDiv.style.top=getAbsoluteTop(obj1) + obj1.offsetHeight
		fDiv.style.width=obj1.offsetWidth
		fDiv.style.position='absolute'
		fDiv.style.zIndex=11
		fDiv.style.height="100"
		fDiv.innerHTML="" +
			"<table width=100% height=100% style='border-width:1px;border-color:#000000;border-style:solid;' bgcolor='white'>" +
			"	<tr><td>" +
			//"	<iframe id=iframeSearchBox name=iframeSearchBox src=/searchBox.php width=100% height=100% frameborder=0 scrolling=no></iframe>" +
			"	<script id=scriptSearchBox src=/searchBox2.php></script>" +
			"	</td></tr>" +
			"</table>";
		document.body.insertBefore(fDiv)
	}
	divSearchBox.style.display='block'
	obj1.onblur=new Function("divSearchBox.style.display='none'")
	obj1.onkeyup=new Function("searchBoxSearch(this,this.form.Field)")
	obj1.autocomplete="off"
}
function searchBoxSearch(obj1,obj2) {
	//37,38,39,40
	divSearchBox.style.display='block'
	switch (event.keyCode) {
		case 38 : //À§·Î
			return
		case 40 : //¾Æ·¡·Î
			return
		case 37 : case 39 : return
		default : 
			//var ifrm = getElementById('iframeSearchBox')
			//iframeSearchBox.location.replace("/searchBox.php?f="+obj2.options[obj2.selectedIndex].value+"&q="+obj1.value)
			//scriptSearchBox.src.replace("/searchBox2.php?f="+obj2.options[obj2.selectedIndex].value+"&q="+obj1.value)
			loadXMLDoc("/searchBox2.php?f="+obj2.options[obj2.selectedIndex].value+"&q="+obj1.value)
			return
	}
}
function getAbsoluteTop(oNode){
	var oCurrentNode=oNode;
	var iTop=0;
	while(oCurrentNode.tagName!="BODY"){
		iTop+=oCurrentNode.offsetTop;
		oCurrentNode=oCurrentNode.offsetParent;
	}
	return iTop;
}

function getAbsoluteLeft(oNode){
	var oCurrentNode=oNode;
	var iLeft=0;
	while(oCurrentNode.tagName!="BODY"){
		iLeft+=oCurrentNode.offsetLeft;
		oCurrentNode=oCurrentNode.offsetParent;
	}
	return iLeft;
}

function loadXMLDoc(str) {
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        try {
            req.onreadystatechange = processReqChange;
            req.open("GET", str, true);
            req.send(null);
        } catch (e) {
            alert(e);
        }
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", str, true);
            req.send();
        }
    } 
}
function processReqChange() {// only if req shows "loaded"
    if (req.readyState == 4) {
        if (req.status == 200) {// only if "OK"
            buildQueryList();
         }
    }
}
function buildQueryList() {
	var items = req.responseXML.getElementsByTagName("items/item");
	
	alert(items.length)
	for (var i=0;i<items.length;i++) {
		alert(items[i].firstChild.nodeValue)
	}
}