var subMenuTimerArray = new Array(); 
var extraMinimizeAssginArray = new Array(); 

function replaceAll(oldStr,findStr,repStr) {
  var srchNdx = 0;  // srchNdx will keep track of where in the whole line
                    // of oldStr are we searching.
  var newStr = "";  // newStr will hold the altered version of oldStr.
  while (oldStr.indexOf(findStr,srchNdx) != -1)  
                    // As long as there are strings to replace, this loop
                    // will run. 
  {
    newStr += oldStr.substring(srchNdx,oldStr.indexOf(findStr,srchNdx));
                    // Put it all the unaltered text from one findStr to
                    // the next findStr into newStr.
    newStr += repStr;
                    // Instead of putting the old string, put in the
                    // new string instead. 
    srchNdx = (oldStr.indexOf(findStr,srchNdx) + findStr.length);
                    // Now jump to the next chunk of text till the next findStr.           
  }
  newStr += oldStr.substring(srchNdx,oldStr.length);
                    // Put whatever's left into newStr.             
  return newStr;
}

  function rightExtShow(){
    top.RIGHT_CONTENTS_LAYER.style.visibility = "";
  }
  function rightExtHidden(){
    top.RIGHT_CONTENTS_LAYER.style.visibility = "hidden";
  } 

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(){
	var MLF = MENU_LIST_FRAME.document;
	MLF.clear();
	MLF.open();
	MLF.writeln("<head>");
	MLF.writeln("	<style type='text/css'>");
	MLF.writeln("<!--");
	MLF.writeln("a:link {text-decoration:none; color:#000000;}");
	MLF.writeln("a:visited {text-decoration:none; color:#666666;}");
	MLF.writeln("a:hover {text-decoration:none; color:#000000;} ");

	MLF.writeln("body { font-size:9pt; font-family:gulim; 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)}");

	MLF.writeln("//-->");
	MLF.writeln("</style>");
	MLF.writeln("</head>");
	MLF.writeln("<body bgcolor='#000001' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");
	MLF.writeln("<table style=' font-size: 11px;'>");
	for(inx = 0;inx<category.length;inx++){
		if(!categoryPage[inx] || categoryPage[inx].length == 0) break;
		MLF.writeln("<tr onClick='top.goPage("+eval(categoryPage[inx]-1)+")' style='cursor:hand'>");
		MLF.write("<td align='"+LIST_ALIGN+"' width='"+_menu_row_img.width+"'  height='"+_menu_row_img.height+"' background='"+_menu_row_img.src+"'>");
		MLF.writeln("<span style=\"width:"+LIST_LEFT_MARGIN+"\"></span>");
		MLF.write("<span style=\"font-size:'"+LIST_FONT_SIZE+"px';font-family:'"+LIST_FONT_NAME+"';color:'"+LIST_FONT_COLOR+"';");		
		MLF.writeln("font-style:'"+LIST_FONT_STYLE+"';font-weight:'"+LIST_FONT_WEIGHT+"'\">"+category[inx]+"</span>");
		MLF.writeln("<span style=\"width:"+LIST_RIGHT_MARGIN+"\"></span></td>");
		MLF.writeln("</tr>");
	}
	MLF.writeln("</table>");
	MLF.writeln("</body>");
	MLF.close();
}
function menuListLoadingContent(){
	var MLF = MENU_LIST_FRAME.document;	
	MLF.clear();
	MLF.open();
	MLF.writeln("<head>");
	MLF.writeln("	<style type='text/css'>");
	MLF.writeln("<!--");
	MLF.writeln("a:link {text-decoration:none; color:#000000;}");
	MLF.writeln("a:visited {text-decoration:none; color:#666666;}");
	MLF.writeln("a:hover {text-decoration:none; color:#000000;} ");
	MLF.writeln("th { font-size:9pt; font-family:gulim; font-color:#000000; }");
	MLF.writeln("td { font-size:9pt; font-family:gulim; font-color:#000000;}");
	MLF.writeln("body { font-size:9pt; font-family:gulim; 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)}");
	MLF.writeln("th { font-size:9pt; font-family:gulim; }");
	MLF.writeln("td { font-size:9pt; font-family:gulim; }");
	MLF.writeln("//-->");
	MLF.writeln("</style>");
	MLF.writeln("</head>");
	MLF.writeln("<body bgcolor='#000001' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");
	MLF.writeln("<table style=' font-size: 11px;'>");	
	for(inx = 0;inx<top.view.extNum;inx++){
		MLF.writeln("<tr onClick='top.goExtPage("+inx+")' style='cursor:hand'>");
		if(top.view.extType[inx]!='5'&&top.view.extZoomLevel[inx]==0){
			MLF.writeln("<td align='right' width='"+_menu_row_img.width+"'  height='"+_menu_row_img.height+"' background='"+_menu_row_img.src+"'>"+top.view.extName[inx]+"</td>");
		}
		MLF.writeln("</tr>");
	}
	MLF.writeln("</table>");
	MLF.writeln("</body>");
	MLF.close();	
}

function menuListLoadingIndex(){
	var MLF = MENU_LIST_FRAME.document;		
	MLF.clear();
	MLF.open();
	MLF.writeln("<head>");
	MLF.writeln("	<style type='text/css'>");
	MLF.writeln("<!--");
	MLF.writeln("a:link {text-decoration:none; color:#000000;}");
	MLF.writeln("a:visited {text-decoration:none; color:#666666;}");
	MLF.writeln("a:hover {text-decoration:none; color:#000000;} ");
	MLF.writeln("th { font-size:9pt; font-family:gulim; font-color:#000000; }");
	MLF.writeln("td { font-size:9pt; font-family:gulim; font-color:#000000;}");
	MLF.writeln("body { font-size:9pt; font-family:gulim; 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)}");
	MLF.writeln("th { font-size:9pt; font-family:gulim; }");
	MLF.writeln("td { font-size:9pt; font-family:gulim; }");
	MLF.writeln("//-->");
	MLF.writeln("</style>");
	MLF.writeln("</head>");
	MLF.writeln("<body bgcolor='#000001' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");
	MLF.writeln("<table style=' font-size: 11px;'>");	
	for(inx = 0;inx<top.view.extNum;inx++){
		if(top.view.extType[inx]=='5'){		
			MLF.writeln("<tr onClick='top.goIndex("+inx+")' style='cursor:hand'>");
			MLF.writeln("<td align='right' width='"+_menu_row_img.width+"'  height='"+_menu_row_img.height+"' background='"+_menu_row_img.src+"'>"+top.view.extName[inx]+"</td>");
			MLF.writeln("</tr>");
		}			
	}
	MLF.writeln("</table>");
	MLF.writeln("</body>");
	MLF.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 = BOOK_AREA_LEFT+1000+view.extX[_inx];
    	}else{
    		view.INDEX_LAYER.style.left = BOOK_AREA_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 = BOOK_AREA_LEFT+view.extX[_inx];
    	}else{
    		INDEX_LAYER.style.left = BOOK_AREA_LEFT+p_width + view.extX[_inx];
    	}
    	INDEX_LAYER.style.top = BOOK_AREA_TOP+view.extY[_inx];
    	INDEX_LAYER.style.visibility = "visible";
	}
}

var printWin;

function printAllPage(){
  var doc = document;	
	var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	exeObj = isInternetExplorer ? document.all.PrintModule : doc.PrintModule;
	
  exeObj.SetVariable("sourceBaseText.text","page/zoom"+eval(zoomLevel-1)+"/");
  exeObj.SetVariable("printTargetText.text","both");  
  exeObj.SetVariable("leftPageText.text",cPage-1);
  exeObj.SetVariable("rightPageText.text",cPage);
  
  return;  
  
	if(!isPrintable){
		alert(STRINGS["PRINT_NO_PRINT_ALERT"]);
		return;
	}	
	
	printPage = cPage - 1;
	
	if(zoomLevel>1){
  	printImg1.src = "page/zoom"+eval(zoomLevel-1)+"/"+view.page[cPage-1];
    printImg2.src = "page/zoom"+eval(zoomLevel-1)+"/"+view.page[cPage];
  }else{
  	printImg1.src = "page/"+view.page[cPage-1];
    printImg2.src = "page/"+view.page[cPage];    
  }
  
	printImg1.width = top.PRINT_WIDTH;
	printImg1.height = top.PRINT_HEIGHT;
	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(){
    var doc = document;	
	var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	exeObj = isInternetExplorer ? document.all.PrintModule : doc.PrintModule;
	
  exeObj.SetVariable("sourceBaseText.text","page/zoom"+eval(zoomLevel-1)+"/");
  exeObj.SetVariable("printTargetText.text","left");  
  exeObj.SetVariable("leftPageText.text",cPage-1);
  exeObj.SetVariable("rightPageText.text",cPage);  
  
  return;
	if(!isPrintable){
		alert(STRINGS["PRINT_NO_PRINT_ALERT"]);
		return;
	}
	if(zoomLevel>1){
  	printHalfImg.src = "page/zoom"+eval(zoomLevel-1)+"/"+view.page[cPage-1];
  }else{
  	printHalfImg.src = "page/"+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(){
  
    var doc = document;	
	var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	exeObj = isInternetExplorer ? document.all.PrintModule : doc.PrintModule;
	
  exeObj.SetVariable("sourceBaseText.text","page/zoom"+eval(zoomLevel-1)+"/");
  exeObj.SetVariable("printTargetText.text","right");
  exeObj.SetVariable("leftPageText.text",cPage-1);
  exeObj.SetVariable("rightPageText.text",cPage);  
  
  return;
	if(!isPrintable){
		alert(STRINGS["PRINT_NO_PRINT_ALERT"]);
		return;
	}
	if(zoomLevel>1){
  	printHalfImg.src = "page/zoom"+eval(zoomLevel-1)+"/"+view.page[cPage];
  }else{
  	printHalfImg.src = "page/"+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 recvMailSetting(){
    var inx = top.ebookLink.lastIndexOf(".");
    if(inx<0){
      ebook_addr = top.ebookLink+"/design/recv_mail/";
    }else{
      ebook_addr = top.ebookLink.substring(0,inx)+"/design/recv_mail/";
    }
  
    var html_code = top.SEND_MAIL_FRAME.design_frame.document.body.innerHTML;
    
    //parsing speicial meaning code tag start[ end]
    html_code = replaceAll(html_code,"[ebooklink]",MAIL_FORM_RECOMMAND.ebooklink.value);
    html_code = replaceAll(html_code,"[ebookimg]",MAIL_FORM_RECOMMAND.ebookimg.value);
    html_code = replaceAll(html_code,"[ebookdesc]",MAIL_FORM_RECOMMAND.ebookdesc.value);
    html_code = replaceAll(html_code,"[sendName]",MAIL_FORM_RECOMMAND.sendName.value);
    html_code = replaceAll(html_code,"[sendAddr]",MAIL_FORM_RECOMMAND.sendAddr.value);
    html_code = replaceAll(html_code,"[recvName]",MAIL_FORM_RECOMMAND.recvName.value);
    html_code = replaceAll(html_code,"[recvName]",MAIL_FORM_RECOMMAND.recvName.value);
    html_code = replaceAll(html_code,"[content]",MAIL_FORM_RECOMMAND.content.value);
    html_code = replaceAll(html_code,"[title]",MAIL_FORM_RECOMMAND.title.value);
    
    //parsing src property to www
    html_code = replaceAll(html_code,"src=\"","src=\""+ebook_addr);
    html_code = "<html>"+html_code;
    html_code = "<head>"+html_code;
    html_code = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"+html_code;
    html_code = "</head>"+html_code;
    html_code = "<body>"+html_code+"</body>\r\n</html>";
    
        
    SEND_MAIL_FRAME.MAIL_FORM.body.value = html_code;
}

function adminRecvMailSetting(){
    var inx = top.ebookLink.lastIndexOf(".");
    if(inx<0){
      ebook_addr = top.ebookLink+"/design/recv_mail/";
    }else{
      ebook_addr = top.ebookLink.substring(0,inx)+"/design/recv_mail/";
    }
  
    var html_code = top.SEND_MAIL_FRAME.design_frame.document.body.innerHTML;
    
    //parsing speicial meaning code tag start[ end]
    html_code = replaceAll(html_code,"[ebooklink]",MAIL_FORM_ADMIN.ebooklink.value);
    html_code = replaceAll(html_code,"[ebookimg]",MAIL_FORM_ADMIN.ebookimg.value);
    html_code = replaceAll(html_code,"[ebookdesc]",MAIL_FORM_ADMIN.ebookdesc.value);
    html_code = replaceAll(html_code,"[sendName]",MAIL_FORM_ADMIN.sendName.value);
    html_code = replaceAll(html_code,"[sendAddr]",MAIL_FORM_ADMIN.sendAddr.value);
    html_code = replaceAll(html_code,"[recvName]",MAIL_FORM_ADMIN.recvName.value);
    html_code = replaceAll(html_code,"[recvName]",MAIL_FORM_ADMIN.recvName.value);
    html_code = replaceAll(html_code,"[content]",MAIL_FORM_ADMIN.content.value);
    html_code = replaceAll(html_code,"[title]",MAIL_FORM_ADMIN.title.value);
    
    //parsing src property to www
    html_code = replaceAll(html_code,"src=\"","src=\""+ebook_addr);
    html_code = "<html>"+html_code;
    html_code = "<head>"+html_code;
    html_code = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"+html_code;
    html_code = "</head>"+html_code;
    html_code = "<body>"+html_code+"</body>\r\n</html>";
    
        
    SEND_MAIL_FRAME.MAIL_FORM.body.value = html_code;
}

function recommandMailSend(){

	
	if(top.SEND_MAIL_FRAME.src!="MAIL.HTM"){
		top.SEND_MAIL_FRAME.src='MAIL.HTM';
		setTimeout('recommandMailSend()',200);
		return;
	}

	if(top.SEND_MAIL_FRAME.design_frame.document.location.href.indexOf("design/recv_mail/mail_recommand.htm")<0){
		top.SEND_MAIL_FRAME.design_frame.document.location="design/recv_mail/mail_recommand.htm";
		setTimeout('recommandMailSend()',200);
		return;
	}	
	
	MAIL_FORM_RECOMMAND.method = "post";
	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";
	
	recvMailSetting();

	SEND_MAIL_FRAME.MAIL_FORM.action = mailServer;
	SEND_MAIL_FRAME.MAIL_FORM.method = "post";	
	SEND_MAIL_FRAME.MAIL_FORM.submit();
	MAIL_LAYER_RECOMMAND.style.visibility = "hidden";
	formCancel(MAIL_FORM_RECOMMAND,MAIL_LAYER_RECOMMAND);
}


function adminMailSend()
{
	if(top.SEND_MAIL_FRAME.src!="MAIL.HTM"){
		top.SEND_MAIL_FRAME.src='MAIL.HTM';
		setTimeout('adminMailSend()',200);
		return;
	}
	
	if(top.SEND_MAIL_FRAME.design_frame.document.location.href.indexOf("design/recv_mail/mail_admin.htm")<0){
		top.SEND_MAIL_FRAME.design_frame.document.location="design/recv_mail/mail_admin.htm";
		setTimeout('adminMailSend()',200);
		return;
	}	
	
	MAIL_FORM_ADMIN.method = "post";	
	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";
	
	adminRecvMailSetting();
	
	SEND_MAIL_FRAME.MAIL_FORM.action = mailServer;
	SEND_MAIL_FRAME.MAIL_FORM.method = "post";	
	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";
}

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";
}

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;
	}
}
