var subMenuTimerArray = new Array(); //¼­ºê¸Þ´º º¸ÀÌ±â/¼û±â±â ¿¡¼­ »ç¿ëÇÒ Å¸ÀÓ¾Æ¿ô ID ¹è¿­
var extraMinimizeAssginArray = new Array(); //¿ÜºÎ ÆäÀÌÁö ÃÖ¼ÒÈ­½Ã¿¡ °ø°£ ÇÒ´çÀ» ´ã´çÇÏ´Â ¹è¿­

function toggleSliderVisibility(){
	if(SLIDER_LAYER.style.width=="0px"){
		slideVisible();
		SLIDER_LAYER.style.width = top.SLIDE_MAXIMUM_WIDTH;
	}else{
		SLIDER_LAYER.style.width = 0;
	}
}

function viewMoveMenu(){
	if(MENU_LAYER.style.visibility=="hidden"){
		MENU_LAYER.style.visibility = "visible";
	}else{
		MENU_LAYER.style.visibility = "hidden";
	}
}

function toggleLayerVisibility(layer_name){
	var _layer = eval(layer_name);
	if(_layer.style.visibility=="hidden"){
		_layer.style.visibility = "visible";
	}else{
		_layer.style.visibility = "hidden";
	}
}

//¸Þ´º ¸®½ºÆ® ·Îµù °ü·Ã ÇÔ¼öµé
function menuListLoadingCategory(){
	MENU_LIST_FRAME.document.clear();
	MENU_LIST_FRAME.document.open();
	MENU_LIST_FRAME.document.writeln("<head>");
	MENU_LIST_FRAME.document.writeln("	<style type='text/css'>");
	MENU_LIST_FRAME.document.writeln("<!--");
	MENU_LIST_FRAME.document.writeln("a:link {text-decoration:none; color:#000000;}");
	MENU_LIST_FRAME.document.writeln("a:visited {text-decoration:none; color:#666666;}");
	MENU_LIST_FRAME.document.writeln("a:hover {text-decoration:none; color:#000000;} ");
//	MENU_LIST_FRAME.document.writeln("th { font-size:9pt; font-family:±¼¸²; font-color:#000000; }");
//	MENU_LIST_FRAME.document.writeln("td { font-size:9pt; font-family:±¼¸²; font-color:#000000;}");
	MENU_LIST_FRAME.document.writeln("body { font-size:9pt; font-family:±¼¸²; SCROLLBAR-FACE-COLOR: #f6f6f6; SCROLLBAR-HIGHLIGHT-COLOR: #d5d5d5; SCROLLBAR-SHADOW-COLOR: #d5d5d5; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #d5d5d5; SCROLLBAR-TRACK-COLOR: #ffffff; SCROLLBAR-DARKSHADOW-COLOR: #ffffff;filter: Chroma(Color=#000001)}");
//	MENU_LIST_FRAME.document.writeln("th { font-size:9pt; font-family:±¼¸²; }");
//	MENU_LIST_FRAME.document.writeln("td { font-size:9pt; font-family:±¼¸²; }");
	MENU_LIST_FRAME.document.writeln("//-->");
	MENU_LIST_FRAME.document.writeln("</style>");
	MENU_LIST_FRAME.document.writeln("</head>");
	MENU_LIST_FRAME.document.writeln("<body bgcolor='#000001' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");
	MENU_LIST_FRAME.document.writeln("<table style=' font-size: 11px;'>");
	for(inx = 0;inx<category.length;inx++){
		if(!categoryPage[inx] || categoryPage[inx].length == 0) break;
		MENU_LIST_FRAME.document.writeln("<tr onClick='top.goPage("+eval(categoryPage[inx]-1)+")' style='cursor:hand'>");
		MENU_LIST_FRAME.document.writeln("<td align='right' width='"+_menu_row_img.width+"'  height='"+_menu_row_img.height+"' background='"+_menu_row_img.src+"'>"+category[inx]+"</td>");
		MENU_LIST_FRAME.document.writeln("</tr>");
	}
	MENU_LIST_FRAME.document.writeln("</table>");
	MENU_LIST_FRAME.document.writeln("</body>");
	MENU_LIST_FRAME.document.close();
}
function menuListLoadingContent(){
	MENU_LIST_FRAME.document.clear();
	MENU_LIST_FRAME.document.open();
	MENU_LIST_FRAME.document.writeln("<head>");
	MENU_LIST_FRAME.document.writeln("	<style type='text/css'>");
	MENU_LIST_FRAME.document.writeln("<!--");
	MENU_LIST_FRAME.document.writeln("a:link {text-decoration:none; color:#000000;}");
	MENU_LIST_FRAME.document.writeln("a:visited {text-decoration:none; color:#666666;}");
	MENU_LIST_FRAME.document.writeln("a:hover {text-decoration:none; color:#000000;} ");
	MENU_LIST_FRAME.document.writeln("th { font-size:9pt; font-family:±¼¸²; font-color:#000000; }");
	MENU_LIST_FRAME.document.writeln("td { font-size:9pt; font-family:±¼¸²; font-color:#000000;}");
	MENU_LIST_FRAME.document.writeln("body { font-size:9pt; font-family:±¼¸²; SCROLLBAR-FACE-COLOR: #f6f6f6; SCROLLBAR-HIGHLIGHT-COLOR: #d5d5d5; SCROLLBAR-SHADOW-COLOR: #d5d5d5; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #d5d5d5; SCROLLBAR-TRACK-COLOR: #ffffff; SCROLLBAR-DARKSHADOW-COLOR: #ffffff;filter: Chroma(Color=#000001)}");
	MENU_LIST_FRAME.document.writeln("th { font-size:9pt; font-family:±¼¸²; }");
	MENU_LIST_FRAME.document.writeln("td { font-size:9pt; font-family:±¼¸²; }");
	MENU_LIST_FRAME.document.writeln("//-->");
	MENU_LIST_FRAME.document.writeln("</style>");
	MENU_LIST_FRAME.document.writeln("</head>");
	MENU_LIST_FRAME.document.writeln("<body bgcolor='#000001' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");
	MENU_LIST_FRAME.document.writeln("<table style=' font-size: 11px;'>");	
	for(inx = 0;inx<top.view.extNum;inx++){
		MENU_LIST_FRAME.document.writeln("<tr onClick='top.goExtPage("+inx+")' style='cursor:hand'>");
//		MENU_LIST_FRAME.document.writeln("<td align='center' width='40'><b>"+eval(inx+1)+"</b></td>");
//		MENU_LIST_FRAME.document.writeln("<td align='center' width='50'><b>"+eval(top.view.extPage[inx]+1)+"</b></td>");
		if(top.view.extType[inx]!='5'&&top.view.extZoomLevel[inx]==0){
			MENU_LIST_FRAME.document.writeln("<td align='right' width='"+_menu_row_img.width+"'  height='"+_menu_row_img.height+"' background='"+_menu_row_img.src+"'>"+top.view.extName[inx]+"</td>");
		}
//		MENU_LIST_FRAME.document.writeln("<td align='right' width='100'>content"+inx+"</td>");
		MENU_LIST_FRAME.document.writeln("</tr>");
	}
	MENU_LIST_FRAME.document.writeln("</table>");
	MENU_LIST_FRAME.document.writeln("</body>");
	MENU_LIST_FRAME.document.close();	
}

function menuListLoadingIndex(){
	MENU_LIST_FRAME.document.clear();
	MENU_LIST_FRAME.document.open();
	MENU_LIST_FRAME.document.writeln("<head>");
	MENU_LIST_FRAME.document.writeln("	<style type='text/css'>");
	MENU_LIST_FRAME.document.writeln("<!--");
	MENU_LIST_FRAME.document.writeln("a:link {text-decoration:none; color:#000000;}");
	MENU_LIST_FRAME.document.writeln("a:visited {text-decoration:none; color:#666666;}");
	MENU_LIST_FRAME.document.writeln("a:hover {text-decoration:none; color:#000000;} ");
	MENU_LIST_FRAME.document.writeln("th { font-size:9pt; font-family:±¼¸²; font-color:#000000; }");
	MENU_LIST_FRAME.document.writeln("td { font-size:9pt; font-family:±¼¸²; font-color:#000000;}");
	MENU_LIST_FRAME.document.writeln("body { font-size:9pt; font-family:±¼¸²; SCROLLBAR-FACE-COLOR: #f6f6f6; SCROLLBAR-HIGHLIGHT-COLOR: #d5d5d5; SCROLLBAR-SHADOW-COLOR: #d5d5d5; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #d5d5d5; SCROLLBAR-TRACK-COLOR: #ffffff; SCROLLBAR-DARKSHADOW-COLOR: #ffffff;filter: Chroma(Color=#000001)}");
	MENU_LIST_FRAME.document.writeln("th { font-size:9pt; font-family:±¼¸²; }");
	MENU_LIST_FRAME.document.writeln("td { font-size:9pt; font-family:±¼¸²; }");
	MENU_LIST_FRAME.document.writeln("//-->");
	MENU_LIST_FRAME.document.writeln("</style>");
	MENU_LIST_FRAME.document.writeln("</head>");
	MENU_LIST_FRAME.document.writeln("<body bgcolor='#000001' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");
	MENU_LIST_FRAME.document.writeln("<table style=' font-size: 11px;'>");	
	for(inx = 0;inx<top.view.extNum;inx++){
		if(top.view.extType[inx]=='5'){		
			MENU_LIST_FRAME.document.writeln("<tr onClick='top.goIndex("+inx+")' style='cursor:hand'>");
			MENU_LIST_FRAME.document.writeln("<td align='right' width='"+_menu_row_img.width+"'  height='"+_menu_row_img.height+"' background='"+_menu_row_img.src+"'>"+top.view.extName[inx]+"</td>");
			MENU_LIST_FRAME.document.writeln("</tr>");
		}			
	}
	MENU_LIST_FRAME.document.writeln("</table>");
	MENU_LIST_FRAME.document.writeln("</body>");
	MENU_LIST_FRAME.document.close();	
}

function goIndex(_inx){
	var target_page = view.extPage[_inx];
	var original_page = cPage;
	top.goPage(view.extPage[_inx]);
	
	indexNumber = -1;
	if(!isFlashBook){
		indexView(_inx);
	}else{
		if(original_page==target_page|| original_page==eval(target_page+1)){
			indexView(_inx);
		}else{
			indexNumber = _inx;
		}
	}
}

function indexView(_inx){
	if(!isFlashBook){
    	view.INDEX_TABLE.width = view.extWidth[_inx];
    	view.INDEX_TABLE.height = view.extHeight[_inx];
    	if((view.extPage[_inx]%2)==0){
    		view.INDEX_LAYER.style.left = 1000+view.extX[_inx];
    	}else{
    		view.INDEX_LAYER.style.left = 1000+p_width + view.extX[_inx];
    	}
    	view.INDEX_LAYER.style.top = view.extY[_inx];
    	view.INDEX_LAYER.style.visibility = "visible";
	}else{
    	INDEX_TABLE.width = view.extWidth[_inx];
    	INDEX_TABLE.height = view.extHeight[_inx];
    	if((view.extPage[_inx]%2)==0){
    		INDEX_LAYER.style.left = view.extX[_inx];
    	}else{
    		INDEX_LAYER.style.left = p_width + view.extX[_inx];
    	}
    	INDEX_LAYER.style.top = view.extY[_inx];
    	INDEX_LAYER.style.visibility = "visible";
	}
}

//¸Þ´º ¸®½ºÆ® ·Îµù °ü·Ã ÇÔ¼öµé ³¡

//ÇÁ¸°Æ® °ü·Ã ÇÔ¼öµé
var printWin;

function printAllPage(){
	if(!isPrintable){
		alert(STRINGS["PRINT_NO_PRINT_ALERT"]);
		return;
	}	
	
	printPage = cPage - 1;
	
	printImg1.src = "page/print/"+view.page[cPage-1];
	printImg1.width = top.PRINT_WIDTH;
	printImg1.height = top.PRINT_HEIGHT;
	printImg2.src = "page/print/"+view.page[cPage];
	printImg2.width = top.PRINT_WIDTH;
	printImg2.height = top.PRINT_HEIGHT;
	showLayer('PRINT_ALL');	

	printWin=window.open("PRINT2.HTM","","width=10 height=10 left=300 top=0");
	closeLoop();
}

function printLeftPage(){
	if(!isPrintable){
		alert(STRINGS["PRINT_NO_PRINT_ALERT"]);
		return;
	}
	printHalfImg.src = printImg1.src = "page/print/"+view.page[cPage-1];
	printHalfImg.width = top.PRINT_WIDTH;
	printHalfImg.height = top.PRINT_HEIGHT;	
	showLayer('PRINT_HALF');
	
	printPage=cPage-1;
	printWin=window.open("PRINT.HTM","","width=10 height=10 left=300 top=0");	
	closeLoop();
}

function printRightPage(){
	if(!isPrintable){
		alert(STRINGS["PRINT_NO_PRINT_ALERT"]);
		return;
	}
	printHalfImg.src = printImg1.src = "page/print/"+view.page[cPage];
	printHalfImg.width = top.PRINT_WIDTH;
	printHalfImg.height = top.PRINT_HEIGHT;	
	showLayer('PRINT_HALF');
	
	printPage=cPage;
	printWin=window.open("PRINT.HTM","","width=10 height=10 left=300 top=0");
	closeLoop();
}

function closeLoop()
{
	if(printWin.closed==false)
	{
		setTimeout("closeLoop()",100);
	}
	else
	{
		hideLayer("PRINT_ALL");
		hideLayer("PRINT_HALF");
	}
}
//ÇÁ¸°Æ® °ü·Ã ÇÔ¼öµé ³¡

//ÃßÃµ ¸ÞÀÏ º¸³»´Â ÇÔ¼ö
function recommandMailSend(){
//	top.SEND_MAIL_FRAME.history.back();
	
	if(top.SEND_MAIL_FRAME.src!="MAIL.HTM"){
		top.SEND_MAIL_FRAME.src='MAIL.HTM';
		setTimeout('recommandMailSend()',200);
		return;
	}
	
	MAIL_FORM_RECOMMAND.ebooklink.value=top.ebookLink;
	MAIL_FORM_RECOMMAND.ebookimg.value=top.ebookImg;
	MAIL_FORM_RECOMMAND.ebookdesc.value=top.ebookDesc;

	if(!MAIL_FORM_RECOMMAND.currentPageCheck || MAIL_FORM_RECOMMAND.currentPageCheck.checked){
		MAIL_FORM_RECOMMAND.ebooklink.value = MAIL_FORM_RECOMMAND.ebooklink.value +"?page="+ cPage+"&mail=true";
	}else{
		MAIL_FORM_RECOMMAND.ebooklink.value = MAIL_FORM_RECOMMAND.ebooklink.value +"?mail=true";
	}	

	SEND_MAIL_FRAME.MAIL_FORM.ebooklink.value = MAIL_FORM_RECOMMAND.ebooklink.value;
	SEND_MAIL_FRAME.MAIL_FORM.ebookimg.value = MAIL_FORM_RECOMMAND.ebookimg.value;
	SEND_MAIL_FRAME.MAIL_FORM.ebookdesc.value = MAIL_FORM_RECOMMAND.ebookdesc.value;
	SEND_MAIL_FRAME.MAIL_FORM.sendName.value = MAIL_FORM_RECOMMAND.sendName.value;
	SEND_MAIL_FRAME.MAIL_FORM.sendAddr.value = MAIL_FORM_RECOMMAND.sendAddr.value;
	SEND_MAIL_FRAME.MAIL_FORM.recvName.value = MAIL_FORM_RECOMMAND.recvName.value;
	SEND_MAIL_FRAME.MAIL_FORM.recvAddr.value = MAIL_FORM_RECOMMAND.recvAddr.value;
	SEND_MAIL_FRAME.MAIL_FORM.content.value = MAIL_FORM_RECOMMAND.content.value;
	SEND_MAIL_FRAME.MAIL_FORM.title.value = MAIL_FORM_RECOMMAND.title.value;
	SEND_MAIL_FRAME.MAIL_FORM.mailType.value = "recommand";

	SEND_MAIL_FRAME.MAIL_FORM.action = mailServer;
	SEND_MAIL_FRAME.MAIL_FORM.submit();
	MAIL_LAYER_RECOMMAND.style.visibility = "hidden";
	formCancel(MAIL_FORM_RECOMMAND,MAIL_LAYER_RECOMMAND);
}
//¹®ÀÇ ¸ÞÀÏ º¸³»´Â ÇÔ¼ö
function adminMailSend()
{
//	top.SEND_MAIL_FRAME.history.back();

	if(top.SEND_MAIL_FRAME.src!="MAIL.HTM"){
		top.SEND_MAIL_FRAME.src='MAIL.HTM';
		setTimeout('adminMailSend()',200);
		return;
	}
	MAIL_FORM_ADMIN.ebooklink.value=top.ebookLink;
	MAIL_FORM_ADMIN.ebookimg.value=top.ebookImg;
	MAIL_FORM_ADMIN.ebookdesc.value=top.ebookDesc;
	if(!top.adminMail||top.adminMail.length==0){
		MAIL_FORM_ADMIN.recvAddr.value = "info@exform.com";
	}else{
		MAIL_FORM_ADMIN.recvAddr.value = top.adminMail;
	}

	if(!MAIL_FORM_ADMIN.currentPageCheck || MAIL_FORM_ADMIN.currentPageCheck.checked){
		MAIL_FORM_ADMIN.ebooklink.value = MAIL_FORM_ADMIN.ebooklink.value +"?page="+ cPage+"&mail=true";
	}else{
		MAIL_FORM_ADMIN.ebooklink.value = MAIL_FORM_ADMIN.ebooklink.value +"?mail=true";
	}
		
	SEND_MAIL_FRAME.MAIL_FORM.ebooklink.value = MAIL_FORM_ADMIN.ebooklink.value;
	SEND_MAIL_FRAME.MAIL_FORM.ebookimg.value = MAIL_FORM_ADMIN.ebookimg.value;
	SEND_MAIL_FRAME.MAIL_FORM.ebookdesc.value = MAIL_FORM_ADMIN.ebookdesc.value;
	SEND_MAIL_FRAME.MAIL_FORM.sendName.value = MAIL_FORM_ADMIN.sendName.value;
	SEND_MAIL_FRAME.MAIL_FORM.sendAddr.value = MAIL_FORM_ADMIN.sendAddr.value;
	SEND_MAIL_FRAME.MAIL_FORM.recvName.value = MAIL_FORM_ADMIN.recvName.value;
	SEND_MAIL_FRAME.MAIL_FORM.recvAddr.value = MAIL_FORM_ADMIN.recvAddr.value;
	SEND_MAIL_FRAME.MAIL_FORM.content.value = MAIL_FORM_ADMIN.content.value;
	SEND_MAIL_FRAME.MAIL_FORM.title.value = MAIL_FORM_ADMIN.title.value;
	SEND_MAIL_FRAME.MAIL_FORM.mailType.value = "admin";
	
	SEND_MAIL_FRAME.MAIL_FORM.action = mailServer;
	SEND_MAIL_FRAME.MAIL_FORM.submit();
	MAIL_LAYER_ADMIN.style.visibility = "hidden";
	formCancel(MAIL_FORM_ADMIN,MAIL_LAYER_ADMIN);
}

function formCancel(_form,_layer){
	formClear(_form);
	hideLayer(_layer);
}

function formClear(_form){
	for(inx = 0;inx <_form.elements.length;inx++){
		_form.elements[inx].value = "";
		_form.elements[inx].checked = false;
	}
}

function pullDownMenuOnMouseover(menu_name){
	clearTimeout(subMenuTimerArray[menu_name]);
	showLayer(menu_name);
}

function pullDownMenuOnMouseout(menu_name){
	subMenuTimerArray[menu_name] = setTimeout("hideLayer("+menu_name+")",10);
}

function showLayer(layer_name){
	if(!eval(layer_name)) return;
	eval(layer_name).style.visibility = "visible";	
}

function hideLayer(layer_name){
	eval(layer_name).style.visibility = "hidden";		
}

function toggleExtraVisibility(_extra_page_name){
	extraPageLayer = eval(_extra_page_name+"_LAYER");
	if(extraPageLayer.style.visibility=="hidden"){
		extraPageLayer.style.visibility = "";		
	}else{
		extraPageLayer.style.visibility = "hidden";
	}
}

function hideExtraPage(_extra_page_name){
	extraPageLayer = eval(_extra_page_name+"_LAYER");
	extraPageLayer.style.visibility="hidden";
}

function showExtraPage(_extra_page_name){
	extraPageLayer = eval(_extra_page_name+"_LAYER");
	extraPageLayer.style.visibility="";
}

function openWindow(_url){
	window.open(_url,'','');
}

function extraMinimize(_extra){
	mini_layer = eval("MINI_"+_extra.id);
	normal_layer = eval("NORMAL_"+_extra.id);
	
	mini_layer.style.visibility = "visible";
	normal_layer.style.visibility = "hidden";
//	_extra.style.height = 28;
//	_extra.style.width = 120;
}

function extraNormalize(_extra){
	mini_layer = eval("MINI_"+_extra.id);
	normal_layer = eval("NORMAL_"+_extra.id);
	
	mini_layer.style.visibility = "hidden";
	normal_layer.style.visibility = "visible";
//	_extra.style.height = 28;
//	_extra.style.width = 120;
}

function zoomModeZoomVisible(_visible){
	for(inx = 0;inx<top.zoomModeZoomLayers.length;inx++){
		top.zoomModeZoomLayers[inx].style.visibility = _visible;
	}
}

function zoomModeNormalVisible(_visible){
	for(inx = 0;inx< top.zoomModeNormalLayers.length;inx++){
		top.zoomModeNormalLayers[inx].style.visibility = _visible;
	}
}

