var EA_Target;
var EA_Target_Frame;
var EA_Num=0;

var EA_Page = new Array();
var EA_Frame = new Array();
var EA_FlashPage = new Array();
var EA_FlashFrame = new Array();

function extNormalAction(){
  top.LEFT_CONTENTS_FRAME.location.href = top.BOOK_DIR+"contents/content"+(top.cPage-1)+"_0.htm";
  top.RIGHT_CONTENTS_FRAME.location.href = top.BOOK_DIR+"contents/content"+top.cPage+"_0.htm"; 
  top.LEFT_CONTENTS_LAYER.style.width = top.zoomWidth[top.currentZoomLevel];
  top.RIGHT_CONTENTS_LAYER.style.width =top.zoomWidth[top.currentZoomLevel];  
  
  top.LEFT_CONTENTS_LAYER.style.left = 0;
  top.LEFT_CONTENTS_LAYER.style.top = 0;  
  top.RIGHT_CONTENTS_LAYER.style.left = top.zoomWidth[top.currentZoomLevel];     
  top.RIGHT_CONTENTS_LAYER.style.top = 0;  
  
  top.CONTENTS_LAYER.style.zIndex = top.BOOK_AREA_ZINDEX+1;
}

function extZoomAction()
{	
  top.LEFT_CONTENTS_FRAME.location.href = top.BOOK_DIR+"contents/content"+(top.cPage-1)+"_"+top.currentZoomLevel+".htm";
  top.RIGHT_CONTENTS_FRAME.location.href = top.BOOK_DIR+"contents/content"+top.cPage+"_"+top.currentZoomLevel+".htm"; 
  top.LEFT_CONTENTS_LAYER.style.width = top.zoomWidth[top.currentZoomLevel];
  top.RIGHT_CONTENTS_LAYER.style.width =top.zoomWidth[top.currentZoomLevel];  
  top.LEFT_CONTENTS_LAYER.style.height = top.zoomHeight[top.currentZoomLevel];
  top.RIGHT_CONTENTS_LAYER.style.height =top.zoomHeight[top.currentZoomLevel];
  
  top.CONTENTS_LAYER.style.zIndex = top.NAVIGATOR_AREA_ZINDEX-1;  
}

function extZoomMove(){
  if(top.currentZoomLevel==0) return;
  
  if(moveYFactor > top.ZOOM_AREA_HEIGHT+top.BOOK_AREA_HEIGHT){
//    return;
  }
  
	top.LEFT_CONTENTS_LAYER.style.left = -moveXFactor;
	top.LEFT_CONTENTS_LAYER.style.top = -moveYFactor;	

	top.RIGHT_CONTENTS_LAYER.style.left = (zoomWidth[top.currentZoomLevel])-moveXFactor ;
	top.RIGHT_CONTENTS_LAYER.style.top = -moveYFactor;
}


function mouseMove(){
  alert(window.event);
}

function extactShow(){

  top.CONTENTS_LAYER.style.visibility = "visible";


}

function extactHidden()
{
  top.CONTENTS_LAYER.style.visibility = "hidden";
    
}

function extGet(_inx)
{  
	
}

var popup_left;
var popup_top;
var popup_page;

function showMsg(msg_pic,zoomDirection,_left,_top,_page)
{

	popup_left = _left;
	popup_top = _top;
	popup_page = _page;
	top.showText.style.visibility='visible';
  top.textImg.src=msg_pic;
	
}

function hideMsg()
{
	var doc = document;	
	top.showText.style.visibility='hidden';
	doc.onmousemove="";
}

function moveMsg(clientX,clientY)
{	
  if(clientX>top.zoomWidth[top.currentZoomLevel]){
    clientX = clientX - top.zoomWidth[top.currentZoomLevel];
  }
	if((popup_page%2)==0){
		clientX += top.zoomWidth[top.currentZoomLevel];
	}
  
  top.moveXFactor = eval(removePix(top.LEFT_CONTENTS_LAYER.style.left));
  top.moveYFactor = eval(removePix(top.LEFT_CONTENTS_LAYER.style.top));  
  
	if(top.currentZoomLevel==0){
		top.moveXFactor = 0;
		top.moveYFactor = 0;
	}
	
	try{

    	if(clientX + parent.textImg.width>top.zoomWidth[top.currentZoomLevel]*2)
    	{    
    		parent.showText.style.width = parent.textImg.width;
    		parent.showText.style.left = clientX-5 + top.moveXFactor - parent.textImg.width + parent.BOOK_AREA_LEFT;
    		parent.showText.align = "right";
    	}
    	else
    	{
    		parent.showText.width = parent.textImg.width;
    		parent.showText.style.left=clientX+5 + top.moveXFactor + parent.BOOK_AREA_LEFT;
    		parent.showText.align="left";
    	}
    	
    	if(clientY+parent.textImg.height > top.zoomHeight[top.currentZoomLevel]){
    		parent.showText.style.top=clientY + top.moveYFactor - parent.textImg.height - 5 + parent.BOOK_AREA_TOP;
    	}else{
    		parent.showText.style.top=clientY + top.moveYFactor + 5 + parent.BOOK_AREA_TOP;
    	}
    }catch(e){}

	window.status = top.moveXFactor+" "+top.moveYFactor+" "+clientX+" "+clientY +" "+parent.showText.style.left+" "+parent.showText.style.top; 
}

function pixRemover(_val){
	return eval(_val.substring(0,_val.length-2));
}

