
		var strLastValue = "";
		var currentValueSelected = -1;
		var countForId = 0;
		var selectSpanStart = "<span style='width:100%;display:block;height:20;' class='spanNormalElement' ";
		var selectSpanEnd =" </span>";
		var searFlag=true;
		var memoryFlag=true;
		var reAuto=true;
		var autoOnOff=true;

		var form;
		var txtUserInputClintId;
		searchStr = new Array();
		
		function init()
		{
			document.forms(0).SearchAutoComplite1_txtUserInput.value="";
			document.forms(0).SearchAutoComplite1_txtUserInput.focus();
		}		

		function popLayer()
		{

			linkarray='';
			
			if (document.forms(0).SearchAutoComplite1_hidauto.value == "0")
			{
				linkarray ="<tr height='20'><td align='right' onmouseover='autoOnOffFlag(1)' onmouseout='autoOnOffFlag(0)'><a href='javascript:AutoComplete()'><font color='#330000'>ÀÚµ¿¿Ï¼ºÄÑ±â</font>&nbsp;</a></td></tr>";
			}
			else
			{
				linkarray ="<tr height='20'><td align='right' onmouseover='autoOnOffFlag(1)' onmouseout='autoOnOffFlag(0)'><a href='javascript:AutoComplete()'><font color='#330000'>ÀÚµ¿¿Ï¼º²ô±â</font>&nbsp;</a></td></tr>";
			}
			desc = 	"<table id=tdid_503 cellspacing=0 cellpadding=0 border=0  bgcolor=#e7d7be width='100%' style='overflow:hidden;absolute:relative;left:0px;top:0px;table-layout:fixed'><tr><td>\n"
				+"<table cellspacing=0 cellpadding=0 border=0 width=100% ><tr><td><center><font size=-1>\n"
				+linkarray
				+"\n</td></tr></table>\n"
				+"</td></tr></table>";

			object1.innerHTML=desc;
			document.forms(0).image1.src="/image/btn_atcmp_on_op2.gif";

		}
		
		function Auto()
		{
			if (object1.innerHTML =="")
			{
				popLayer();
				document.forms(0).image1.src="/image/btn_atcmp_on_op2.gif";
			}
			else
			{
				object1.innerHTML =""
				document.forms(0).image1.src="/image/btn_atcmp_on2.gif";
			}
		}
		
		function autoOnOffFlag(Flag)
		{
			if (Flag == 1)
			{
				autoOnOff=true;
			}
			else
			{
				autoOnOff=false;
			}
		}

	
		function MouseClick(theTextBox)
		{
			SetHighColor(theTextBox);
			SearchImg();
			__doPostBack('SearchAutoComplite1:imgbtn_Search','')
		}

		function MoveHighlight(xDir)
		{
			var userInput=document.forms(0).SearchAutoComplite1_txtUserInput.value;

			if((currentValueSelected >= -1) && (memoryFlag == true) && (userInput.length >=2))
			{
				newValue = parseInt(currentValueSelected) + parseInt(xDir);
				if(newValue > -1 && newValue < countForId)
				{
					currentValueSelected = newValue;
					document.forms(0).SearchAutoComplite1_txtUserInput.value=searchStr[newValue];
					SetHighColor (null);
					
				}
			}		
		}

		function SetHighColor(theTextBox)
		{
			if(theTextBox)
			{
				currentValueSelected =theTextBox.id.slice(theTextBox.id.indexOf("_")+1,theTextBox.id.length);
				document.forms(0).SearchAutoComplite1_txtUserInput.value = searchStr[currentValueSelected];; //set text value
			}

			for(i = 0; i < countForId; i++)
			{
				document.getElementById('OptionsList_' + i).className ='spanNormalElement';
			}
			
			document.getElementById('OptionsList_' + currentValueSelected).className = 'spanHighElement';
		}

		function SetMouseOVer(theTextBox)
		{
			if(theTextBox)
			{
				currentValueSelected =theTextBox.id.slice(theTextBox.id.indexOf("_")+1,theTextBox.id.length);
			}

			for(i = 0; i < countForId; i++)
			{
				document.getElementById('OptionsList_' + i).className ='spanNormalElement';
			}
			
			document.getElementById('OptionsList_' + currentValueSelected).className = 'spanHighElement';
		}

		function AutoComplete()
		{
			if (document.forms(0).SearchAutoComplite1_hidauto.value == "0")
			{
				document.forms(0).SearchAutoComplite1_hidauto.value = "1";
				popLayer();
				
				var searchKind=document.forms(0).SearchAutoComplite1_ddl_SearchKind.value;
				var searchStr=document.forms(0).SearchAutoComplite1_txtUserInput.value;
				document.forms(0).image1.src="/image/btn_atcmp_on_op2.gif";				
				
				if ((searchKind == "RecordName") || (searchKind == "SongTitle") || (searchKind == "RecordId") || (document.forms(0).SearchAutoComplite1_hidauto.value =="0"))
				{
					return;
				}
				else
				{
					memoryFlag=true;
					searFlag=true;
					reAuto=false;
					FindMatches(searchStr);
					reAuto=true;
				}
			}
			else
			{
				document.forms(0).SearchAutoComplite1_hidauto.value ="0";
				object1.innerHTML="";
				object2.innerHTML="";
				document.all.iframe1.style.visibility="hidden";
				document.forms(0).image1.src="/image/btn_atcmp_on2.gif";
			}

		}
		
		function SearchOut()
		{
			searFlag =false;
			memoryFlag=false;
			if (autoOnOff == false)
			{
				object1.innerHTML="";
			}
			object2.innerHTML= "";
			document.all.iframe1.style.visibility="hidden";
			currentValueSelected = -1;
			document.forms(0).image1.src="/image/btn_atcmp_on2.gif";

		}

		function KeyDown()
		{
			if((event.keyCode == 40) )
			{
				popLayer();
				MoveHighlight(1);
				return;
			}
			else if(event.keyCode == 38)
			{
				MoveHighlight(-1);
				return;
			}
			else
			{
				searFlag=true;
			}
		}
		
		function mousedown()
		{
			searFlag=true;
		}
		
		function FindMatches(searchCriteria)
		{
			var searchKind=document.forms(0).SearchAutoComplite1_ddl_SearchKind.value;
			var searchStr=document.forms(0).SearchAutoComplite1_txtUserInput.value;
			
			searchCriteria=document.forms(0).SearchAutoComplite1_txtUserInput.value;
			
			if ((searchKind == "RecordName") || 
				(searchKind == "SongTitle") || 
				(searchKind == "SelNo") || 
				(searchKind == "Dvd") ||
				(document.forms(0).SearchAutoComplite1_hidauto.value =="0") ||
				(searchCriteria.length < 2 ))
			{
				SearchOut();
				object1.innerHTML="";
				return;
			}
			
			if (reAuto == true)
			{
				if((event.keyCode == 40) ||(event.keyCode == 38))
				{
					return;
				}
				else if(event.keyCode == 13)
				{
					return;
				}
			}
			
			if (document.forms(0).SearchAutoComplite1_hidauto.value =="1")
			{	
				popLayer();
			}

			memoryFlag=true;
			SearchAutoComplite.FindMatches(searchKind , searchCriteria ,FindMatches_CallBack);

			strLastValue=searchCriteria;
			
		}
		
		function FindMatches_CallBack(response)
		{
			currentValueSelected = -1;

			if(searFlag == false)
			{
				return;
			}
			
			if (response.error != null)
			{    
				alert(response.error); 
				return;
			}  
			  
			if (response.value == null || response.value.length == 0)
			{
				object2.innerHTML= "";
				document.all.iframe1.style.visibility="hidden";
				return;
			}

			searchWord=document.forms(0).SearchAutoComplite1_txtUserInput.value;
			searchStr = new Array(response.value.length-1);
			var linkarray='';
			countForId = 0;

			for (var i=0; i<=response.value.length-1;i++)
			{
				searchStr[i]= response.value[i];
				linkarray= linkarray +  selectSpanStart + " id=OptionsList_" + i +"  onmousedown='MouseClick(this)' onmouseover='SetMouseOVer(this)' style=FONT-WEIGHT: normal;font-size:18;cursor:hand nowrap >" 
				+ "&nbsp;" +MatchWordReplace(searchWord,searchStr[i]) + selectSpanEnd;
				
				countForId++;
			}

			desc = 	"<table id=tdid_503 cellspacing=0 cellpadding=0 border=0 height='20' width='100%'><tr><td >\n"
				+"<table cellspacing=0 cellpadding=0  width=100% style='LEFT: 0px; POSITION: absolute; TOP: 20px'><tr><td bgcolor=ffffdd ><left>\n"
				+linkarray
				+"\n</td></tr></table>\n"
				+"</td></tr></table>";
			object2.innerHTML= desc;
			document.all.iframe1.style.height=20*countForId;
			document.all.iframe1.style.visibility="visible";
		}
		
		
		function MatchWordReplace(searWord,searStr)
		{
			
			var regExp = new RegExp(searWord,"i");
			var theMatch = searStr.match(regExp);
			
			returnStr=searStr.replace(theMatch,"<font color='#64207d'>" + theMatch +"</font>");
			return returnStr;
			
		}
		
		function MemordCash()
		{
			currentValueSelected = -1;
			var linkarray='';
			countForId = 0;
			for (var i=0; i<=searchStr.length-1;i++)
			{
				linkarray= linkarray + selectSpanStart + " id=OptionsList_" + i +"  onmousedown='MouseClick()' onmouseover='SetHighColor(this)' style=font-size:20;cursor:hand;TEXT-INDENT: 2px; >" + searchStr[i] + selectSpanEnd;
				countForId++;
				
			}
			
			desc = 	"<table id=tdid_503 cellspacing=0 cellpadding=0 border=0  bgcolor=#ffcc66 width='70%'><tr><td>\n"
				+"<table cellspacing=0 cellpadding=0 border=0 width=100% style='LEFT: 0px; POSITION: absolute; TOP: 20px'><tr><td height='20'><center><font size=-1>\n"
				+linkarray
				+"\n</td></tr></table>\n"
				+"</td></tr></table>";
			object2.innerHTML= desc;		
		}
		
		function PopUpLogin( ReturnURL )
		{
			var iHight = (window.screen.height - 260) / 2;
			var iWidth = (window.screen.width - 400) / 2;
			var win2 = window.open("/evan/member/login.aspx?ReturnURL="+ReturnURL,"·Î±×ÀÎ","height=260,width=400,status=yes,directories=no,status=no,toolbar=no,resizable=no,menubar=no,location=no,screenX='+iWidth+',screenY='+iHight+'");
			win2.focus();
			return false;
		}
		
		function PopUpLoginBuy( ReturnURL )
		{
			var iHight = (window.screen.height - 310) / 2;
			//var iHight = (window.screen.height - 260) / 2;
			var iWidth = (window.screen.width - 400) / 2;
			var win2 = window.open("/evan/member/loginFromBuy.aspx?ReturnURL="+ReturnURL,"È¸¿ø·Î±×ÀÎ¹×ºñÈ¸¿ø±¸¸Å","height=310,width=400,status=yes,directories=no,status=no,toolbar=no,resizable=no,menubar=no,location=no,screenX='+iWidth+',screenY='+iHight+'");
			//var win2 = window.open("/evan/member/loginFromBuy.aspx?ReturnURL="+ReturnURL,"È¸¿ø·Î±×ÀÎ¹×ºñÈ¸¿ø±¸¸Å","height=260,width=400,status=yes,directories=no,status=no,toolbar=no,resizable=no,menubar=no,location=no,screenX='+iWidth+',screenY='+iHight+'");
			
			win2.focus();
		}
		// ¾Ù¹ü »ó¼¼ º¸±â ÆäÀÌÁö¿¡¼­ È£Ãâ
		function PopUpLoginBuy2( ReturnURL )
		{
			var iHight = (window.screen.height - 310) / 2;
			//var iHight = (window.screen.height - 260) / 2;
			var iWidth = (window.screen.width - 400) / 2;
			var win2 = window.open("/evan/member/loginFromBuy.aspx?pop=parent&ReturnURL="+ReturnURL,"È¸¿ø·Î±×ÀÎ¹×ºñÈ¸¿ø±¸¸Å","height=310,width=400,status=yes,directories=no,status=no,toolbar=no,resizable=no,menubar=no,location=no,screenX='+iWidth+',screenY='+iHight+'");
			//var win2 = window.open("/evan/member/loginFromBuy.aspx?pop=parent&ReturnURL="+ReturnURL,"È¸¿ø·Î±×ÀÎ¹×ºñÈ¸¿ø±¸¸Å","height=260,width=400,status=yes,directories=no,status=no,toolbar=no,resizable=no,menubar=no,location=no,screenX='+iWidth+',screenY='+iHight+'");
			
			win2.focus();
			return false;
		}
		
		function PopUpLogin1( ReturnURL )
		{
			var iHight = (window.screen.height - 260) / 2;
			var iWidth = (window.screen.width - 400) / 2;
			var win2 = window.open("/evan/member/login.aspx?ReturnURL="+ReturnURL,"·Î±×ÀÎ","height=260,width=400,status=yes,directories=no,status=no,toolbar=no,resizable=no,menubar=no,location=no,screenX='+iWidth+',screenY='+iHight+'");
			win2.focus();
		}
		
		
		// ¾Ù¹ü »ó¼¼ º¸±â ÆäÀÌÁö¿¡¼­ È£Ãâ
		function PopUpLogin2( ReturnURL )
		{
			var iHight = (window.screen.height - 260) / 2;
			var iWidth = (window.screen.width - 400) / 2;
			var win2 = window.open("/evan/member/login.aspx?pop=parent&ReturnURL="+ReturnURL,"·Î±×ÀÎ","height=260,width=400,status=yes,directories=no,status=no,toolbar=no,resizable=no,menubar=no,location=no,screenX='+iWidth+',screenY='+iHight+'");
			win2.focus();
			return false;
		}

		// ¾Ù¹ü »ó¼¼ º¸±â ÆäÀÌÁö¿¡¼­ È£Ãâ(ºÎ¸ðÀÇ ºÎ¸ð ÆäÀÌÁö ±îÁö... 1:1 ¹®ÀÇÀÏ°æ¿ì¿Í ¾Ë¸²¸ÞÀÏ)
		function PopUpLogin3( ReturnURL )
		{
			var iHight = (window.screen.height - 260) / 2;
			var iWidth = (window.screen.width - 400) / 2;
			var win2 = window.open("/evan/member/login.aspx?pop=ques&ReturnURL="+ReturnURL,"·Î±×ÀÎ","height=260,width=400,status=yes,directories=no,status=no,toolbar=no,resizable=no,menubar=no,location=no,screenX='+iWidth+',screenY='+iHight+'");
			win2.focus();
			return false;
		}
		
		function GotoURL( URL )
		{
			//document.location.href = URL;
			opener.document.location.href=URL;
			ChildeClose()
			return false;
		}
		
		function GotoOpenerURL()
		{
			opener.document.location.href=window.opener.document.location.href;
			return false;
		}
		
		function click() 
		{
			if ((event.button==2) || (event.button==3)) 
			{
				//alert('ÁË¼ÛÇÕ´Ï´Ù. ¿À¸¥ÂÊ Å¬¸¯Àº ¾ÈµË´Ï´Ù.');
			}
		}

		function EvanPopUp()
		{
			var iMyWidth;
			var iMyHeight;
			var windowHeight;
			iMyWidth = (window.screen.width - 498)/2; 
			iMyHeight = (window.screen.height - 740)/2; 
			windowHeight=window.screen.availHeight - 30;
			noticeWindow1 = window.open("/Image/PopUp/Konzession.html","popup1","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=498,height=740 , left==" + iMyWidth + ",top=" + iMyHeight); 
			noticeWindow1.opener = self;
			noticeWindow1.focus();
		}

		document.onmousedown=click

