	cPage=startPage+1;
	categoryStart = 0;	
	categoryOverColor = "#ffffff";
	var extraPageInput ;
	function goExtPage(_content_num){
		goPage(view.extPage[_content_num]);
	}
	
	function extPopupWindow(width,height,scroll,mf){
		popupWindowVar= window.open("","","width="+width+",height="+height+",scrollbars="+scroll);
		popupWindowVar.document.writeln("<embed src=content/"+mf+" width="+width+" height="+height+"></embed>");
	}
	
	function removePix(str){
		return str.substring(0,str.length-2);
	}
	
	function bodyKeyCheck(){
		if(event.keyCode==32){
			next();
		}else if(event.keyCode==39){
			next();
		}else if(event.keyCode==37){
			prev();
		}else if(event.keyCode==36){
			goPage(0);
		}else if(event.keyCode==35){
			goPage(totalPage);
		}
	}

	function catCode(catStr){
		if(catStr.length>categoryStringLength) catStr = catStr.substr(0,categoryStringLength-2)+"...";

		return catStr;
	}

	function initWindow(){
		if(screen.availWidth!=1024)
		{
			left1=(screen.availWidth-1024-5)/2;
			top1=(screen.availHeight-768-10)/2;
			window.resizeTo(1024,768);
			window.moveTo(left1,top1);			
		}
	}
	
	function slideAction(){
		if(slideLayer.style.visibility=='hidden'){
			slideLayer.style.visibility = "visible";
			slideFrameLayer.style.visibility = "visible";
			var width = slideLayer.style.width;
			width = width.substring(0,width.length-2);
			if(width<310){
				slideLayer.style.width = 312;
				slideFrameLayer.style.visibility = "visible";
				slideHandleImg.src = "img/slide/small_handle.gif";
			}
		}else{
			slideLayer.style.visibility = "hidden";			
			slideFrameLayer.style.visibility = "hidden";
			slideFrame.slideClear()
		}
	}
	
	function searchAction(){
		if(searchLayer.style.visibility=="hidden")
		{
			searchLayer.style.visibility = "visible";
		}else{
			searchField.value='';
			searchLayer.style.visibility = "hidden";
		}
	}

	function categoryMove(){
		if (category3.style.left =='2px'){
			document.all['category3'].style.left = 866;
			document.all['category4'].style.left = 866;
			categoryMoveImg.src = "img/etc/left_icon.gif";

			for(i=0;i<category_length;i++){
				eval("up_category"+i+".style").left = 886;
			}
		}
		else{
			document.all['category3'].style.left = 2;
			document.all['category4'].style.left = 2;
			categoryMoveImg.src = "img/etc/right_icon.gif";

			for(i=0;i<category_length;i++){
				eval("up_category"+i+".style").left = 2;
			}
		}
	}
	
	function categoryRewrite()
	{
		newHTML = "<table cellpadding='0' cellspacing='0' border=0 width=156>\n";
		for(i=0+categoryStart;i<category_length&&i-categoryStart<15;i++)
		{
			if(category[i])
			{
				newHTML+="<tr>";
				newHTML+="	<td width=20 align=right></td>";
				newHTML+="	<td width=123 height=25 onMouseOver='categoryWordVisible("+i+")'>";
				newHTML+="		<a OnClick='goCategory("+i+")' style='cursor:hand' align='left'>";
				newHTML+=" &nbsp; "+catCode(category[i]);
				newHTML+="		</a></td><td width=13>&nbsp;</td></tr>";
				newHTML+="		<tr><td colspan=6><img src='img/etc/line.gif' width='145' height='1'></td></tr> ";
			}
		}
		newHTML +="</table>";

		category4.innerHTML = newHTML;
	}	
	
	function categoryUp()
	{
		if (categoryStart>0) categoryStart--;		
		categoryRewrite();
		
		for(i = 0;i<category_length;i++){
			var newTop = eval("up_category"+i+".style").top;
			newTop = newTop.substring(0,newTop.length-2);

			eval("up_category"+i+".style").top = eval(eval(newTop) +25);
		}

	}
	
	function categoryDown()
	{
		if (category[categoryStart+15] == null) return;
		categoryStart++;
		categoryRewrite();		

		for(i = 0;i<category_length;i++){
			var newTop = eval("up_category"+i+".style").top;
			newTop = newTop.substring(0,newTop.length-2);

			eval("up_category"+i+".style").top = eval(eval(newTop) -25);
		}
	}
	function help()
	{
		window.open('help/help.htm','','width=500,height=616,scrollbars=yes');
	}
	function mail()
	{
		window.open('mail/mail.htm','','width=350,height=563');
	}
	
	function prepare()
	{
		alert(STRINGS["ALERT_READY"]);
	}
	function goCompany(link)
	{
		window.open(link,"","left=0,top=0,width=800,height=640,location=yes,directories=yes,menubar=yes,resizable=yes,toolbar=yes,scrollbars=yes");
	}
	function inquiry()
	{
	
		for(i=0;i<inquiry_length;i++)
		{
			if(inquiryStartPage[i]<=cPage&&cPage<=inquiryEndPage[i])
			{

				goCompany(inquiryLink[i]);
			}
		}
	}
	function goCategory(target)
	{
		if(category[target])
		{
			goPage(categoryPage[target]-1);
		}
	}
	
	function zoomCheckForGoPage(_targetPage){
	  if(cPage==_targetPage || cPage-1==_targetPage) return;
	  if(currentZoomLevel>0){
  	  view.zoomOut();
    }
  }
	
	function goPage(_targetPage){
	  zoomGlass1.style.visibility = "hidden";		
	  if(isFlashBook){
      zoomCheckForGoPage(_targetPage);
	    goFlashPage(_targetPage);
	  }else{
	    _goPage(_targetPage);
	  }
	}
	
	function _goPage(targetPage)
	{
	  zoomGlass1.style.visibility = "hidden";		
		viewPage = targetPage; 

		if(view.status!=0)
		{
			return;
		}

		if(targetPage==0)
		{
			targetPage=1;
		}

  		if(targetPage=="")
  		{  
  			alert(STRINGS["ALERT_SET_PAGE"] );
  
  			return;  
  		}
  
  		dPage=Math.floor(targetPage/2)*2;

		if(targetPage<0)
		{

			alert(STRINGS["ALERT_NO_PAGE"]);

			return;

		}

		else if(targetPage>totalPage)
		{

			alert(STRINGS["ALERT_NO_PAGE"]);

			return;

		}

		else if(dPage==cPage-1)
		{		  
			return;
		}
  	
  	pageValue=eval(eval(viewPage)+1)-coverPages;
	  pageUpdate();
		cPage=dPage+1;
		  
  	view.goPage(dPage);
		
	}
	
	function prev()
	{
	  
		if(view.status!=0)
		{
			return;
		}

   	if(cPage<=1) 
   	{   
   	  if(top.flip_reverse){
		  	alert(STRINGS["ALERT_NO_NEXT_PAGE"]);
    	}else{
     		alert(STRINGS["ALERT_NO_PREV_PAGE"]);
    	}
   		return;    
  	}	


		zoomGlass1.style.visibility = "hidden";				
		if(isFlashBook){		  
        zoomCheckForGoPage(cPage-2);
        goFlashPage(cPage-2);
	  }else{		
		  cPage-=2;
	  	pageValue=cPage-coverPages;
  		pageUpdate();	    
 		
	  	view.goPage(cPage-1);		
		}
	}
	function next()
	{
		if(view.status!=0)
		{
			return;
		}
		
 		if(cPage==totalPage)
  	{
  	  if(flip_reverse){
  	    alert(STRINGS["ALERT_NO_PREV_PAGE"]);
  	  }else{
  	  	alert(STRINGS["ALERT_NO_NEXT_PAGE"]);
  	  }
		  return;
 		}

				zoomGlass1.style.visibility = "hidden";		
		if(isFlashBook){		  
      zoomCheckForGoPage(cPage+2);
      goFlashPage(cPage+2);
	  }else{
  		cPage+=2;
	  	pageValue=cPage-coverPages;
 		  pageUpdate();   
	  	view.goPage(cPage-1);   
    }
	}

	function viewCategory()
	{
		if(!category[0]){
			alert(STRINGS["ALERT_NO_CATEGORY"]);
			return;
		}
	
		if(category_display==1)
		{
	
			if(category1.style.visibility=='hidden')
			{
				category1.style.visibility='visible';
				category2.style.visibility='visible';
			}
			else
			{
			
				category1.style.visibility='hidden';
				category2.style.visibility='hidden';
			}
			
		}
		else
		{
			if(category3.style.visibility=='hidden')
			{
				category3.style.visibility='visible';
				category4.style.visibility='visible';
			}
			else
			{
				category3.style.visibility='hidden';
				category4.style.visibility='hidden';
			}
				
		}
	}
	function viewZoomRect()
	{
		zoomRectFr.Img1.src="page/small/"+view.page[view.cPage];
		zoomRectFr.Img2.src="page/small/"+view.page[view.cPage+1];
		NAVIGATOR_LAYER.style.visibility='visible';
		moveZoomRect();
	}
	function hideZoomRect()
	{
		NAVIGATOR_LAYER.style.visibility='hidden';
	}
	
	function moveZoomRect()
	{
		zoomRectFr.ZR_glassX=view.moveXFactor/zoomWidth[currentZoomLevel]*zoomRectWidth/2;
		zoomRectFr.zoomRect2.style.left=zoomRectFr.ZR_glassX;

		zoomRectFr.ZR_glassY=view.moveYFactor/zoomHeight[currentZoomLevel]*zoomRectHeight;
		zoomRectFr.zoomRect2.style.top=zoomRectFr.ZR_glassY;

	}
	function finishZoomRect()
	{
		if(zoomRectFr.test.style.top=="10px")	zoomRectFr.test.style.top=20;
		else zoomRectFr.test.style.top=10;
	}

	function zoomRectValid()
	{
		zoomRect.style.top=115;
	}
	
	function searchKeyCheck(){
		if(event.keyCode==13){ 
			searchIt(searchField.value);
		}
	}
	
	function pageUpdate(){
	  if(top.flip_reverse){
        top.page.value = top.view.page.length-top.pageValue;
	    if(extraPageInput && extraPageInput!="undefined"){
	      extraPageInput.value = top.view.page.length - top.pageValue;
	      
    	}	    
	  }else{
      	top.page.value = top.pageValue;
	    if(extraPageInput && extraPageInput!="undefined"){
	      extraPageInput.value = top.pageValue;
	    }
  	}
  	
  	if(!top.VOICE_COMPONENT || top.VOICE_COMPONENT==undefined) return;  
	  top.voiceAction(top.pageValue);
  }
	
	function enterCheck(){
		if (event.keyCode == 13) {
			if(page.value==""){
				page.value=cPage-coverPages;
				return;
			}
			__goPage(eval(page.value-1+coverPages));
		}
	}	
	
	if(top.zoomHeight[0]>top.zoomWidth[0]){
		zoomRectWidth = 240*top.zoomWidth[0]/top.zoomHeight[0];
		zoomRectHeight = 120;
	}else{
		zoomRectWidth = 240;
		zoomRectHeight = 120*top.zoomHeight[0]/top.zoomWidth[0];
	}
	
	function __goPage(_target){
	  if(flip_reverse){
	    goPage(top.view.page.length - _target-1);
	  }else{
	    goPage(_target);
	  }
	}
	
	
	function ebook_loading_complete(){
	  if(location.href.toLowerCase().indexOf("file://")==0){
      if(navigator.systemLanguage=="ko"){
        top.FLASH_CHECK_FRAME.location.href = "flashPlayerCheck/FlashPlayerCheck_ko.htm";
      }else{
        top.FLASH_CHECK_FRAME.location.href = "flashPlayerCheck/FlashPlayerCheck_eng.htm";
     } 
      top.FLASH_CHECK_LAYER.style.visibility = 'visible'    
    }	 
    
		if(isFlashBook){
			view.status = 1;
			MarginControl(BOOK_AREA_WIDTH/2,BOOK_AREA_HEIGHT,BOOK_AREA_LEFT,BOOK_AREA_TOP,0,crossFlash,totalPage);
			flipStartPage();
		}else{
		  _loading_layer.style.visibility='hidden';
		}
		if(location.href.toLowerCase().indexOf("http://")<0){
		}

 		view.initLoad(); 
 
	}
	
	function flipStartPage(){
		if(!document.Page || view.status !=0){
			setTimeout("flipStartPage()",10);
			return;
		}
		
		if(flip_reverse){
  		goPage(top.view.page.length-2 - startPage);
	  	}else{
  			goPage(startPage);
	  	}
	  	if(!top.VOICE_COMPONENT || top.VOICE_COMPONENT==undefined) return;
	  	voiceAction(cPage);
// 		top.view.mouseup();
    top.view.extNormalAction();
	}
	
	function eventPatch(event,isRight){
	    if(!event||event.button==null) return;
	    
  		top.flashEventButton = event.button;
	  	top.flashEventX = event.clientX;// - bookLeft;
		  top.flashEventY = event.clientY;// - bookTop;	  		
		  
      if(isRight){
        top.flashEventX += top.BOOK_AREA_WIDTH/2;
      }
        
	}

