function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) {
		if ((obj=MM_findObj(args[i]))!=null) { 
			v=args[i+2];
			if (obj.style) { 
				obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
			}
			obj.visibility=v; 
		}
	}
}

//°Å·¡Ã³°Ë»ö/µµ¼­°Ë»ö, ÃâÆÇ´º½º/ÀÚ·á½Ç ·¹ÀÌ¾î º¸ÀÌ±â
function showLayer(layerName)
{
	if (layerName == "customer")
	{
		customer.style.display = "block";
		book.style.display = "none";
	}
	else if (layerName == "book")
	{
		book.style.display = "block";
		customer.style.display = "none";
	}
	else if (layerName == "news")
	{
		news.style.display = "block";
		morgue.style.display = "none";
	}
	else if (layerName == "morgue")
	{
		morgue.style.display = "block";
		news.style.display = "none";
	}
}

function go_search()
{
    var form = document.frmSearch;
    if(form.keyword.value==""){
        alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
        form.keyword.focus();
    } else {
        form.submit();
    }
}

function go_member_search()
{
    var form = document.memberSearch;
    if(form.keyword.value==""){
        alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
        form.keyword.focus();
    }
	else
	{
		if( form.field.value == "pub" )
		{
			form.action = "/npublication/publication_search.jsp";
			form.submit();
		}
		else if( form.field.value == "store" )
		{
			form.action = "/npublication/bookstore_search.jsp";
			form.submit();
		}
		else if( form.field.value == "cir" )
		{
			form.action = "/npublication/circulation_search.jsp";
			form.submit();
		}
		else if( form.field.value == "lib" )
		{
			form.action = "/npublication/library_search.jsp";
			form.submit();
		}
	}
}

function login() 
{
    var form = document.frmLogin;
    if(form.login_id.value == "") {
        alert("ID¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
        form.login_id.focus();
    }
    else if(form.login_pwd.value == "") {
        alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
        form.login_pwd.focus();
    }
    else {
        form.submit();
    }
}

function onix_data() 
{
	window.open("/info/onixdata.jsp","","width=620,height=495, status=no,toolbar=no,location=no,scrollbars=no");
}

function goStatistics()
{ 
	alert ("Åë°èÁ¤º¸¸¦ ÀÛ¼º ÁßÀÌ¿À´Ï È®ÀÎ¹öÆ° Å¬¸¯ÈÄ Àá½Ã¸¸ ±â´Ù·ÁÁÖ¼¼¿ä.");
}

function goBookapply()
{ 
	alert ("¡Ø¿ì¼öÇÐ¼úµµ¼­ ½ÅÃ»Àº 5¿ù 8ÀÏºÎÅÍ °¡´ÉÇÕ´Ï´Ù");
}

function mail_popup() 
{	
	URL = 'newbook/mail_pop.jsp';
	window.open( URL, 'mail_popup','width=340,height=350');
}

function webzine_popup() 
{	
	URL = 'newsletter/webzineSubscribe.jsp';
	window.open( URL, 'webzine_popup','width=340,height=350');
}

function statics_popup() 
{	
	URL = '/batchprocess/batch_sys.html';
	window.open( URL, 'statics_popup','width=680,height=1200');
}

function popup() 
{	
	URL = 'popup.htm';
	window.open( URL,'','width=589,height=341,status=no,toolbar=no,location=no,scrollbars=no');
}

function edu_popup() 
{	
	URL = 'edu/edu_regi.jsp';
	window.open( URL, 'edu_regi','width=340,height=380');
}

function isbn_popup() 
{	
	URL = 'rfid/isbn/BarCodeMake.jsp';
	window.open( URL, 'edu_regi','width=700,height=600, scrollbars=yes');
}

function marc_popup() 
{	
	URL = 'marclib/RegistBook.jsp';
	window.open( URL, 'edu_regi','width=700,height=600, scrollbars=yes');
}




ns4 = (document.layers)? true:false 
ie4 = (document.all)? true:false 
if (ie4) 
{ 
	if (navigator.userAgent.indexOf('MSIE 5')>0) 
	{
		ie5 = true; 
	}
	else 
	{
		ie5 = false; 
	} 
} 
else 
{ 
	ie5 = false; 
} 

var x = 0; 
var y = 0; 
var snow = 0; 
var sw = 0; 
var cnt = 0; 


function ndisp() 
{ 
	if ( cnt >= 1 ) { sw = 0 }; 
	if ( (ns4) || (ie4) ) 
	{ 
		if ( sw == 0 ) 
		{ 
			snow = 0; 
			hideObject(over); 
		} 
		else 
		{ 
			cnt++; 
		} 
	} 
} 

//¸»Ç³¼± ¹Ú½º µµ¿ò¸» µðÀÚÀÎÀº ¿©±â¿¡¼­
function retMemo(memo) 
{
	return '<div style=margin-left:10;margin-top:10><table border=2 cellspacing=0 cellpadding=0 width=240 height=30 bordercolor=#FFFFCC bgcolor=#FFFFCC class="table"><tr><td>'+memo+'</td></tr></table></div>';
}

function msgdisp(text) 
{ 
	txt = retMemo(text);
	layerWrite(txt); 
	disp(); 
} 

function disp() 
{ 
	if ( (ns4) || (ie4) ) 
	{ 
		if (snow == 0) 
		{ 
			moveTo(over,x,y+10);
			showObject(over); 
			snow = 1; 
		} 
	} 
} 

function mouseMove(e) 
{ 
	if (ns4) {x=e.pageX; y=e.pageY;} 
	if (ie4) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
	if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;} 
	if (snow) {moveTo(over,x,y+10);} 
} 


	
function showObject(obj) 
{ 
	if (ns4) obj.visibility = "show" 
	else if (ie4) obj.visibility = "visible" 
} 

function hideObject(obj) 
{ 
	if (ns4) obj.visibility = "hide" 
	else if (ie4) obj.visibility = "hidden" 
}

function moveTo(obj,xL,yL) 
{ 
	obj.left = xL 
	obj.top = yL 
} 

/*******error Ã³¸®À§ÇÑ ½ºÅ©¸³Æ® ½ÃÀÛ ***************/
window.onerror = ErrorSetting 
var e_msg="";
var e_file="";
var e_line=""; 

function ErrorSetting(msg, file_loc, line_no) 
{
     e_msg=msg;
     e_file=file_loc;
     e_line=line_no;
     return true; 
} 
/*******error Ã³¸®À§ÇÑ ½ºÅ©¸³Æ® ³¡ ***************/

/***********½Å°£µµ¼­ ¸ñ·Ï ¹Þ±â ·¹ÀÌ¾î ¼³Á¤ ½ÃÀÛ************/
var lastScrollY = 0;
var layerLeftPosition = 0;
function initlayerPostion() {
	layerLeftPosition = document.body.offsetWidth/2 + 465;

	if (layerLeftPosition <= 955) {
		layerLeftPosition = 955;
	}
	document.getElementById("productView").style.top = 57;
	document.getElementById("productView").style.left = layerLeftPosition;
	document.getElementById("nowSeeList").style.left = layerLeftPosition - 298;
}
	
function layerPostion() {
	layerLeftPosition = document.body.offsetWidth/2 + 465;

	if (layerLeftPosition <= 955) {
		layerLeftPosition = 955;
	}
	document.getElementById("productView").style.left = layerLeftPosition;
	document.getElementById("nowSeeList").style.left = layerLeftPosition - 298;
}

function heartBeat() {
	var diffY = document.body.scrollTop;

	if (diffY != lastScrollY) {
		percent = .2 * (diffY - lastScrollY);
		if (percent > 0) {
			percent = Math.ceil(percent);
		} else {
			percent = Math.floor(percent);
		}
		document.all.productView.style.pixelTop += percent;
		document.all.nowSeeList.style.pixelTop += percent;
		lastScrollY = lastScrollY + percent;
	}
}

function layerNowSeeOn(){
 document.getElementById("nowSeeList").style.display = "";
}
function layerNowSeeOff(){
 document.getElementById("nowSeeList").style.display = "none";
}

initlayerPostion();
window.setInterval('heartBeat()',5);
window.onresize = layerPostion;
/***********½Å°£µµ¼­ ¸ñ·Ï ¹Þ±â ·¹ÀÌ¾î ¼³Á¤ ³¡************/


