var url = "/EasySearch/Proc.asp?val="; 			var ajax = getCookie('ajax'); 			var y=1; 			var ymax = 0; 			
var mypix = new Array(); 			var thispic = 0; 			var isIE=document.all?true:false; 			var isNS4=document.layers?true:false; 
var isNS6=navigator.userAgent.indexOf("Gecko")!=-1?true:false; 			

function preloadImages()
{					for (i=0; i<preloadImages.arguments.length;i++)
{							mypix[i]=new Image(); 
mypix[i].src=preloadImages.arguments[i]; 
} 
}

function processnext()
{					if(!document.images)return; 					thispic=(thispic+1)%mypix.length; 					if(isIE)
document.all.pic1.src = mypix[thispic].src; 					else if(isNS4)
null; 					else if(isNS6)
null; 				} 

function initImgs()
{					preloadImages("http://book.nawayo.com/img/plus.gif",
"http://book.nawayo.com/img/minus.gif",
"http://book.nawayo.com/img/top/cen.gif",
"http://book.nawayo.com/img/top/clo.gif",
"http://book.nawayo.com/img/top/ra.gif",
"http://book.nawayo.com/img/mu_08.gif",
"http://book.nawayo.com/img/mu_11.gif",
"http://book.nawayo.com/img/mu_13.gif",
"http://book.nawayo.com/img/mu_15.gif",
"http://book.nawayo.com/img/mu_17.gif"); 				}

function allowChg()
{				if(event.offsetX >= 280)
document.all.strEasySearch.style.cursor="hand"; 				else
document.all.strEasySearch.style.cursor=""; 			}
function cookieChg()
{				if(event.offsetX >= 280)
{						if(ajax == 'on')
{								if(confirm('½Ç½Ã°£ °Ë»ö±â´ÉÀ» ²ô½Ã°Ú½À´Ï±î?'))
AJAXOff(); 							}
else
{								AJAXOn(); 								alert('½Ç½Ã°£ °Ë»ö±â´ÉÀÌ È°¼ºÈ­ µÇ¾ú½À´Ï´Ù.'); 							}
}
}
function chgListSelect()
{				if (!isWorking)
switch (event.keyCode)
{					    case 40:
document.getElementById('listBox').rows[y].bgColor='#FFFFFF'; 					        if (y==ymax){y=1;} else {y++;} 
document.getElementById('listBox').rows[y].bgColor='#F0F0F0'; 									document.frmSearch.strSearch.value = document.getElementById('listBox').rows[y].outerText; 					        document.all.tblfocus.focus(); 					    break; 					    case 38:
document.getElementById('listBox').rows[y].bgColor='#FFFFFF'; 					        if (y==1)
{											y=0; 											document.frmSearch.strSearch.focus(); 											window.RelationWord.style.display='none'; 										} 
else 
{											y--; 											document.getElementById('listBox').rows[y].bgColor='#F0F0F0'; 										}
document.frmSearch.strSearch.value = document.getElementById('listBox').rows[y].outerText; 					    break; 					    }
}
function Co(TrID)
{				TrID.style.fontWeight='bold'; 			}
function Cu(TrID)
{				TrID.style.fontWeight='normal'; 			}
function clickListSelect(txt)
{				document.frmSearch.strSearch.value = txt; 				document.frmSearch.submit(); 				window.RelationWord.style.display='none'; 			}

function keyValiDate(keyval,val,range){				if(keyval == 40 && ymax > 0 && !isWorking)
{						if(window.RelationWord.style.display == 'none')
window.RelationWord.style.display = ''; 							
y = 1; 						document.getElementById('listBox').rows[y].bgColor='#F0F0F0'; 						document.frmSearch.strSearch.value = document.getElementById('listBox').rows[y].outerText; 						document.all.tblfocus.focus(); 					}
else
{						if(keyval != 37 && keyval != 39){
if(val != '' && keyval != 38)
updateEasySearch(val,range); 						else
{								ymax = 0; 								window.RelationWord.style.display='none'; 								document.all.RelationWord.innerHTML = ''; 							}
}}
}

function AJAXOff() {				setCookie('ajax','off'); 				document.frmSearch.strSearch.AUTOCOMPLETE = 'on'; 				document.frmSearch.SearchRange.focus(); 				document.frmSearch.strSearch.focus(); 				window.RelationWord.style.display='none'; 				document.all.RelationWord.innerHTML = ''; 				ajax = 'off'; 				document.all.strEasySearch.style.backgroundImage="url(/img/plus.gif)"; 			}

function AJAXOn() {				document.frmSearch.strSearch.AUTOCOMPLETE = 'off'; 				document.frmSearch.SearchRange.focus(); 				document.frmSearch.strSearch.focus(); 				setCookie('ajax','on'); 				window.RelationWord.style.display='none'; 				document.all.RelationWord.innerHTML = ''; 				ajax = 'on'; 				document.all.strEasySearch.style.backgroundImage="url(/img/minus.gif)"; 			}

function getCookie(name)
{			    var cname = name + "=";               
var dc = document.cookie;             

if (dc.length > 0) 
{              
begin = dc.indexOf(cname);       
if (begin != -1) 
{           
begin += cname.length;       
end = dc.indexOf(";", begin); 									if (end == -1) 
end = dc.length; 									return unescape(dc.substring(begin, end)); 								} 
}
return null; 				}

function setCookie(name, value) 
{			    var now = new Date(); 			    var then = new Date(now.getTime() + 31536000000); 			    document.cookie = name + "=" + escape(value) + "; expires=" + then.toGMTString() + "; path=/"; 			  }

function qu()
{					alert("½Ç½Ã°£ °Ë»öÀÌ¶õ?\n\n°Ë»öÃ¢¿¡ ±ÛÀÚ¸¦ Ä¥¶§¸¶´Ù ½Ç½Ã°£À¸·Î Ã¥ Á¦¸ñ or ÀúÀÚ or ÃâÆÇ»ç¸¦ °Ë»öÇØÁÖ´Â ±â´ÉÀÔ´Ï´Ù.\n±âº» °Ë»ö´ë»óÀº µµ¼­Á¦¸ñÀÌ¸ç °Ë»öÃ¢¾ÕÀÇ ¼¿·ºÆ®¹Ú½º·Î ÀúÀÚ ¶Ç´Â ÃâÆÇ»ç·Î °Ë»ö´ë»óÀ» ¹Ù²Ü ¼ö ÀÖ½À´Ï´Ù.\n\n\n»ç¿ë¹æ¹ý\n\nÀ§ ¶Ç´Â ¾Æ·¡ ¹æÇâÅ°·Î ¼±ÅÃÇÏ¿© °Ë»ö ÇÏ½Ç ¼ö ÀÖÀ¸¸ç ¸¶¿ì½º·Î Å¬¸¯ÇÏ½Ç °æ¿ì¿¡´Â ¹Ù·Î ÇØ´çÃ¥À» º¸½Ç ¼ö ÀÖ½À´Ï´Ù.\nÄÑ±â ¶Ç´Â ²ô±â´Â °Ë»öÃ¢ ¿À¸¥ÂÊ¿¡ +,-¹öÆ°À» ÀÌ¿ëÇÏ½Ã¸é µË´Ï´Ù."); 				}

function handleHttpResponse() {			  if (http.readyState == 4) {			    if (http.responseText.indexOf('invalid') == -1) {						var strInnerHtml = ''; 						var range = document.frmSearch.SearchRange.value; 						results = http.responseText.split("^*/"); 
if(results.length > 0){							ymax=0; 							
strInnerHtml = "<table border=0 cellspacing=0 cellpadding=0 width=100%><tr height=20><td style='padding-left:10px;'><input type=text name=tblfocus style='width:0px;height:1px;'><img src='/img/top/ra.gif' border=0> <b>½Ç½Ã°£ "

if(range == 0 || range == 1)
strInnerHtml = strInnerHtml + "Á¦¸ñ "; 							else if(range == 2)
strInnerHtml = strInnerHtml + "ÀúÀÚ "; 							else if(range == 3)
strInnerHtml = strInnerHtml + "ÃâÆÇ»ç "; 										
strInnerHtml = strInnerHtml + "°Ë»ö</b></td><td align=right valign=top><img src='/img/top/cen.gif' style='margin-right:5px;' onMouseUp='qu()' alt='µµ¿ò¸»'><img src='/img/top/clo.gif' style='margin-right:5px;' onMouseUp=\"AJAXOff()\" alt='²ô±â'></td></tr></table>"; 							strInnerHtml = strInnerHtml + "<table id='listBox' border=0 cellspacing=0 cellpadding=0 class='listbox' width=278 bgcolor=\"#FFFFFF\">"; 							strInnerHtml = strInnerHtml + "<tr height=0 style='display:none;'><td>"+document.frmSearch.strSearch.value+"</td></tr>"; 							
if(range < 2)
{									for(i=0;i < results.length;i++)
if(results[i] != '')
{												strInnerHtml = strInnerHtml + "<tr onmouseover=\"Co(this)\" onmouseout=\"Cu(this)\"><td onMouseDown=\"winOpenDetail('"+results[i].substring(results[i].length - 13,results[i].length)+"')\">"+results[i].substring(0,results[i].length-13)+"</td></tr>"; 												ymax++; 											}
}
else
{									for(i=0;i < results.length;i++)
if(results[i] != '')
{												strInnerHtml = strInnerHtml + "<tr onmouseover=\"Co(this)\" onmouseout=\"Cu(this)\"><td onMouseDown=\"clickListSelect(this.outerText)\">"+results[i]+"</td></tr>"; 												ymax++; 											}
}		
if(ymax == 0)
strInnerHtml = strInnerHtml + "<tr height=20><td align=center>½Ç½Ã°£ °Ë»ö°á°ú°¡ ¾ø½À´Ï´Ù.</td></tr>"; 									
strInnerHtml = strInnerHtml + "</table>"; 								document.all.RelationWord.innerHTML = strInnerHtml; 								
isWorking = false; 
window.RelationWord.style.display=''; 							}
else{								window.RelationWord.style.display='none'; 								document.all.RelationWord.innerHTML = ''; 								ymax = 0; 								isWorking = false; 							}
}
}
}

var isWorking = false; 
function updateEasySearch(val,range) {			  if (!isWorking && http) {			    http.open("GET", url + encodeURI(val) + '&range=' + range, true); 			    http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 			    http.onreadystatechange = handleHttpResponse; 			    isWorking = true; 			    http.send(null); 			  }
}

function getHTTPObject() {			  var xmlhttp; 
if(xmlhttp && xmlhttp.readyState!=0) { xmlhttp.abort() ; 			 } try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP") ; 			 } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") ; 			 } catch (e) { xmlhttp = false ; 			 } } if (!xmlhttp && typeof XMLHttpRequest!=UD) _req = new XMLHttpRequest() ; 			 return xmlhttp ; 			}

var http = getHTTPObject(); 			
function initPage()
{					initImgs(); 					RightLayer('BannerLayer',68,150); 					if(!ajax) AJAXOn();
if(ajax == 'on')
{							document.frmSearch.strSearch.AUTOCOMPLETE = 'off'; 							document.all.strEasySearch.style.backgroundImage="url(/img/minus.gif)"; 						}
else
{							document.frmSearch.strSearch.AUTOCOMPLETE = 'on'; 							document.all.strEasySearch.style.backgroundImage="url(/img/plus.gif)"; 						}
}
