var search_bg_targeted = -1;

function getAbsoluteTop(oNode) { // 절대 높이 계산
	var oCurrentNode=oNode;
	var iTop=0;
	while(oCurrentNode.tagName!="TABLE") {
		//alert(1)
		iTop+=oCurrentNode.offsetTop;
		//alert(2)
		oCurrentNode=oCurrentNode.offsetParent;
	}
	return iTop;
}

function getAbsoluteLeft(oNode) { // 절대 좌측 계산
	var oCurrentNode=oNode;
	var iLeft=0;
	while(oCurrentNode.tagName!="TABLE"){
		iLeft+=oCurrentNode.offsetLeft;
		oCurrentNode=oCurrentNode.offsetParent;
	}
	return iLeft;
}

function isIE() {
	if (navigator.userAgent.indexOf("MSIE") >= 0) {
		return true;
	} else {
		return false;
	}
}

function search_strip(a) {
	if (a) {
		if ((a == "K" && document.getElementById('q').value != "") || (a == "M")) {
			document.getElementById('q').style.backgroundImage = '';
			search_bg_targeted = -1;
		}
	} else {
		document.getElementById('q').style.backgroundImage = '';
		search_bg_targeted = -1;
	}
}

function searchsubmit() {
	var check = true;
	var sugCurPos = document.frames["hFrame"].curCursorPos;
//	var nil_Search = "btn";
//	if(sugCurPos > -1) nil_Search = "sugtop";
	return check;
}


function SchSug_setcoor(id,url,width) {

	//document.write("<div id=SchSug>");
	//document.write("<iframe id=hFrame name=hFrame src='"+url+"' style='width:"+width+"px;display:none' frameborder=0 scrolling=no></iframe>");
	//document.write("</div>");
	
	
	//document.write("<div id=set_sugicn style='width:200px; height:200px; position:absolute; left:50px; top:50px; z-index:1;'><img src='images/sug_down.gif' width=13 height=13 style='cursor:pointer' id=sugicn></div>");
	//document.write("<div id=set_sugicnUP style='width:200px; height:200px; position:absolute; left:50px; top:50px; z-index:1;'><img src='images/sug_up.gif' width=13 height=13 style='cursor:pointer' id=sugicnUP></div>");

	
var div2_1 = document.getElementById("div2_0");

	var a=document.createElement('div');
	a.setAttribute('id','SchSug');
	a.style.ZIndex=12;
	a.style.position="absolute";

	var b=document.createElement('iframe');
	b.id='hFrame';
	b.name='hFrame';
	b.src=url;
	b.style.width=width+"px";
	b.style.display='none';
	b.scrolling='no';
	b.frameBorder='0';

	a.appendChild(b);

	div2_1.appendChild(a)

	var c=document.createElement('div');
	c.id='set_sugicn';
	c.style.width="270px";
	c.style.height="200px";
	c.style.position="absolute";
	c.style.left="50px";
	c.style.top="50px";
	c.innerHTML="<img src='OUTPUT/IMAGE/sug_down.gif' width=13 height=13 style='cursor:pointer' id=sugicn>";
	div2_1.appendChild(c)

	var d=document.createElement('div');
	d.id='set_sugicnUP';
	d.style.width="270px";
	d.style.height="200px";
	d.style.position="absolute";
	d.style.left="50px";
	d.style.top="50px";
	d.innerHTML="<img src='OUTPUT/IMAGE/sug_up.gif' width=13 height=13 style='cursor:pointer' id=sugicnUP>";
	div2_1.appendChild(d)

	var obj = document.getElementById("SchSug");
	//alert(obj)
	obj.style.top = "107px";
	obj.style.left = getAbsoluteLeft(document.getElementById("q")) - 0;

	var obj_set_sugicn = document.getElementById("set_sugicn");
	

	obj_set_sugicn.style.top = "87px";
	obj_set_sugicn.style.left = getAbsoluteLeft(document.getElementById("q")) + document.getElementById("q").offsetWidth - 17;
	
	var obj_set_sugicnUP = document.getElementById("set_sugicnUP");
	obj_set_sugicnUP.style.top = "87px";
	obj_set_sugicnUP.style.left = getAbsoluteLeft(document.getElementById("q")) + document.getElementById("q").offsetWidth - 17;

	if(isIE()) document.getElementById('set_sugicn').style.display = '';
}

function onload21(){
	SchSug_setcoor('q','ENG/XML_PHP/ajax_suggest.php',329)
}

