function loadHMenu(selTarget){
  var cURL = "http://www.haninbook.com";
  
  var tmplist;

tmplist = "<div id='mini_gnb' style='height:20px;> \
<ul> \
<!--@if($logged_info)--> \
<li><strong>{$logged_info->nick_name}</strong>님 God Bless You.</li> \
<!--@end--> \
<li><a href='/'><img src='/images/top_home.jpg' border='0' /></a></li> \
<!--@if($logged_info)--> \
<li><a href={getUrl('act','dispMemberLogout')}><img src='/images/top_logout.jpg' border='0' /></a></li> \
<li><a href=javascript:gotoMid('userinfo','0','{$s_country}','{$s_state}','{$s_region}','')><img src='/images/top_p_info.jpg' border='0' /></a></li> \
<!--@else--> \
<li><a href=javascript:gotoMid('login','0','{$s_country}','{$s_state}','{$s_region}','')><img src='/images/top_login.jpg' border='0' /></a></li> \
<!--@end--> \
<li><a href=javascript:gotoMid('member','0','{$s_country}','{$s_state}','{$s_region}','')><img src='/images/top_member.jpg' border='0' /></a></li> \
<li><a href=javascript:gotoMid('howto','0','{$s_country}','{$s_state}','{$s_region}','')><img src='/images/top_info.jpg' border='0' /></a></li> \
<li><a href=javascript:gotoMid('bizreg','0','{$s_country}','{$s_state}','{$s_region}','')><img src='/images/top_register.jpg' border='0' /></a></li> \
<li><a href=javascript:gotoMid('adinfo','0','{$s_country}','{$s_state}','{$s_region}','')>광고안내</a></li> \
<li><a href=javascript:gotoMid('faq','0','{$s_country}','{$s_state}','{$s_region}','')><img src='/images/top_faq.jpg' border='0' /></a></li> \
</ul> \
</div>";

  document.getElementById(selTarget).innerHTML = tmplist;
	   
}

function loadCITY(selTarget){
  var cURL = "http://www.haninbook.com/?mid=booklist&s_country=US&s_region=";
  
  var tmplist;
  
  tmplist = "<a href="+cURL+"SanFrancisco>SF</a> | \
	   <a href="+cURL+"Sanose>San Jose</a> | \
	   <a href="+cURL+"Sacramento>Sacramento</a> | \
       <a href="+cURL+"LosAngeles>LA</a>";
  
  document.getElementById(selTarget).innerHTML = tmplist;
	   
}

function loadsiteInfo(selTarget){
  var cURL = "http://www.haninbook.com";
  
  var tmplist;
  
  tmplist = "<a href="+cURL+"/?mid=siteinfo>회사소개</a> | \
	   <a href="+cURL+"/?mid=enduser>사용자 이용정책</a> | \
	   <a href="+cURL+"/?mid=support>고객지원</a> | \
       <a href="+cURL+">Contact Us</a>";
  
  document.getElementById(selTarget).innerHTML = tmplist;
	   
}

// Hide And Show Toggle
var cc=0
function hideShow(id) {
    if (cc==0) {
        cc=1
        document.getElementById(id).style.display="none";
    } else {
        cc=0
        document.getElementById(id).style.display="block";
    }
}

// Show And Hide Toggle
var cc=0
function showHide(id) {
    if (cc==0) {
        cc=1
        document.getElementById(id).style.display="block";
    } else {
        cc=0
        document.getElementById(id).style.display="none";
    }
}

// Local Navigation Toggle
function lnbToggle(id) {
	for(num=1; num<=3; num++) document.getElementById('D3MG'+num).style.display='none'; //D4MG1~D4MG3 까지 숨긴 다음
	document.getElementById(id).style.display='block'; //해당 ID만 보임
}

// IS
function chkIsKind(key, value) {
    showHide('selectOrder');
    xGetElementById('search_target'+key).checked = true;
    xInnerHtml('search_target_label', value);
}

function gotoMain(country, state, region)
{
  var cURL = "http://www.haninbook.com/?mid=bookmain&ishan=Y&s_country="+country+"&s_state="+state+"&s_region="+region;	
  window.open(cURL,"_self","");
}

function gotoMid(mid, key, country, state, region, keyword)
{
  if(key==1){
    var cURL = "http://www.haninbook.com/?mid="+mid+"&ishan=Y&s_country="+country+"&s_state="+state+"&s_region="+region+"&search_keywordx="+keyword+"&search_targetx=hb_category";
  }else if(key==2){
    var cURL = "http://www.haninbook.com/?mid="+mid+"&ishan=Y&s_country="+country+"&s_state="+state+"&s_region="+region+"&doc_srl="+keyword;
  }else{
    var cURL = "http://www.haninbook.com/?mid="+mid+"&ishan=Y&s_country="+country+"&s_state="+state+"&s_region="+region+keyword;
  }
//  window.open(cURL,"_self","");
  location.href = cURL;
}

function gotoMID(mid, country, state, region, keyword, key, val, key2, val2)
{
	var cURL = "http://www.haninbook.com/?mid="+mid;
	if((country!=undefined) && (country!='') ) cURL = cURL+"&s_country="+country;
	if((state!=undefined) && (state!='') ) cURL = cURL+"&s_state="+state;
	if((region!=undefined) && (region!='') ) cURL = cURL+"&s_region="+region;
	if((keyword!=undefined) && (keyword!='') ) cURL = cURL+"&search_keywordx="+keyword+"&search_targetx=category";
	if((key!=undefined) && (key!='')) cURL = cURL+"&"+key;
	if((val!=undefined) && (val!='')) cURL = cURL+"="+val;
	if((key2!=undefined) && (key2!='')) cURL = cURL+"&"+key2;
	if((val2!=undefined) && (val2!='')) cURL = cURL+"="+val2;
	
	location.href = cURL;
	// window.open(cURL,"_self","");
}

function open_window(fURL,sizeW, sizeH)
{
window.open(fURL,"_blank","toolbar=no,status=no,width="+sizeW+",height="+sizeH+",directories=no,scrollbars=no,location=no,resizable=no,menubar=no,screenX=400,screenY=300");
}

function open_w_view(mid, doc_srl, w, h)
{
var modName = "http://www.haninbook.com/?mid="+mid+"&doc_srl="+doc_srl; 
window.open(modName,"_blank","toolbar=no,status=no,width="+w+",height="+h+",directories=no,scrollbars=no,location=yes,resizable=no,menubar=yes,screenX=10,screenY=10");
}

function open_w_coupon(doc_srl)
{
var modName = "http://www.haninbook.com/?mid=couponview&doc_srl="+doc_srl;  	
window.open(modName,"_blank","toolbar=no,status=no,width=10,height=10,directories=no,scrollbars=no,location=yes,resizable=yes,menubar=no,screenX=10,screenY=10");
}


function open_w_img(doc_srl)
{
var modName = "http://www.haninbook.com/?mid=imgview&doc_srl="+doc_srl;  	
window.open(modName,"_blank","toolbar=no,status=no,width=10,height=10,directories=no,scrollbars=no,location=yes,resizable=no,menubar=no,screenX=10,screenY=10");
}

function open_w_mov(doc_srl)
{
var modName = "http://www.haninbook.com/?mid=movview&doc_srl="+doc_srl;
window.open(modName,"_blank","toolbar=no,status=no,width=10,height=10,directories=no,scrollbars=no,location=yes,resizable=no,menubar=no,screenX=10,screenY=10");
}

function open_w_job(doc_srl)
{
var modName = "http://www.haninbook.com/?mid=jobview&doc_srl="+doc_srl;
window.open(modName,"_blank","toolbar=no,status=no,width=10,height=10,directories=no,scrollbars=no,location=yes,resizable=no,menubar=no,screenX=10,screenY=10");
}

function open_w_couponx(doc_srl)
{
var modName = "http://www.haninbook.com/modules/coupon/coupon.php?document_srl="+doc_srl;  	
window.open(modName,"_blank","toolbar=no,status=no,width=640,height=235,directories=no,scrollbars=no,location=yes,resizable=no,menubar=no,screenX=10,screenY=10");
}

function open_w_map(con,addr)
{
var g_map = "http://maps.google.com/maps?f=q&source=s_q&hl=en&ie=UTF8&geocode=&q=";  	
addr=addr.replace(/#/gi,'%23');
addr=addr.replace(/ /gi,'+');
g_map=g_map+addr;
window.open(g_map,"_blank","toolbar=no,status=no,width=800,height=600,directories=no,scrollbars=yes,location=yos,resizable=yes,menubar=no,screenX=400,screenY=300");
}

//script language="JavaScript1.1"    
function viewimgx(picName, windowName, windowWidth, windowHeight){
var winHandle = window.open("" ,windowName,"left=100,top=100,toolbar=no,scrollbars=no,resizable=no,width=" + windowWidth + ",height=" + windowHeight)
if(winHandle != null){
var htmlString = "<html><head><title>▒ 확대이미지보기 ▒</title></head>" 
htmlString += "<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 >"
htmlString += "<table border=0 cellpadding=0 cellspacing=0 width=100% height=100%>"
htmlString += "<tr><td><a href=javascript:window.close()><img src=" + picName + " border=0 alt=닫기></a></td></tr>"
htmlString += "</table></body></html>"
winHandle.document.open()
winHandle.document.write(htmlString)
winHandle.document.close()
} 
if(winHandle != null) winHandle.focus()
return winHandle
}


/*****************플래쉬 테두리 대처방안 ************/
function playflash(file,width,height,bgcolor,quality,name){
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+name+'">');  //플래쉬플레이어 버전이 이전버전일경우 버전 8을 변경
        document.write('<param name="movie" value="'+file+'" />');
        document.write('<param name="quality" value="'+quality+'" />');
        document.write('<param name="wmode" value="transparent" />');  //투명플래쉬가 아닐경우 이 라인을 삭제
        document.write('<param name="bgcolor" value="'+bgcolor+'" />');
        document.write('<embed src="'+file+'" quality="'+quality+'" wmode="transparent" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+name+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
        document.write('</object>')
}
/** 플래쉬가 들어갈 자리에 들어가는 코드 
<script language="javascript">
        playflash('파일경로','가로크기','세로크기','백그라운드컬러','퀄리티','아이디')
</script>
플래쉬가 들어갈 자리에 들어가는 코드 끝*/
/*****************플래쉬 테두리 대처방안 끝************/

function viewImg(what) { 
var imgwin = window.open("",'WIN','scrollbars=0,status=0,toolbar=0,resizable=0,location=0,menu=0, menubar=0, height=10, width=10, top=100, left=250'); 
var imgURL = what;

imgwin.focus(); 
imgwin.document.open(); 
imgwin.document.write("<html>\n"); 
imgwin.document.write("<head>\n"); 
imgwin.document.write("<title> 세계 최대의 온라인 한인업소록 - 한인북</title>\n"); 
imgwin.document.write("<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n"); 
imgwin.document.write("<sc"+"ript>\n"); 
imgwin.document.write("function resize() {\n"); 
imgwin.document.write("pic = document.il;\n"); 
//imgwin.document.write("alert(eval(pic).height);\n"); 
imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
imgwin.document.write("  if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 78; myWidth = eval(pic).width + 9;\n"); 
imgwin.document.write("  } else { myHeight = eval(pic).height + 78; myWidth = eval(pic).width+9; }\n"); 
imgwin.document.write("  clearTimeout();\n"); 
imgwin.document.write("  var height = screen.height;\n"); 
imgwin.document.write("  var width = screen.width;\n"); 
imgwin.document.write("  var leftpos = width / 2 - myWidth / 2;\n"); 
imgwin.document.write("  var toppos = height / 2 - myHeight / 2; \n"); 
imgwin.document.write("  self.moveTo(leftpos, toppos);\n"); 
imgwin.document.write("  self.resizeTo(myWidth, myHeight);\n"); 
imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
imgwin.document.write("</sc"+"ript>\n"); 
imgwin.document.write("</head>\n"); 
imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n'); 
imgwin.document.write("<img border=0 src="+imgURL+" xwidth=100 xheight=9 name=il onload='resize();'>\n"); 
imgwin.document.write("</body>\n");
imgwin.document.write("</head>\n");
imgwin.document.write("</html>\n"); 
imgwin.document.close(); 

} 

function viewMov(url){
var movStr =
"<embed height='240' type='application/x-shockwave-flash' width='320' src='http://www.haninbook.com/data/jw_flv_player/flvplayer.swf' allowfullscreen='true' allowscriptaccess='always' flashvars='&amp;displayheight=240&amp;file="+url+"&amp;height=240&amp;width=320&amp;overstretch=true&amp;autostart=true&amp;volume=50&amp;image=http://www.ebenezersf.org/eben/events/eben_07/eben_07_final_320.jpg' />";

var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=yes,location=no,menu=no, menubar=no, left=350, top=240, height=240, width=320'); 

imgwin.focus(); 
imgwin.document.open(); 
imgwin.document.write("<html>\n"); 
imgwin.document.write("<head>\n"); 
imgwin.document.write("<title>세계 최대의 온라인 한인업소록 - 한인북</title>\n"); 
imgwin.document.write("<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n"); 
imgwin.document.write("</head>\n"); 
imgwin.document.write('<body width="100%" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n'); 
imgwin.document.write("<div align='center'>");
imgwin.document.write(movStr); 
imgwin.document.write("</div>\n");
imgwin.document.write("</body>\n");
imgwin.document.write("</head>\n");
imgwin.document.write("</html>\n"); 
imgwin.document.close(); 
}


function viewMov2(url,w,h,id,bg,vars,win){

var flashStr=
"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"'height='"+h+"' id='"+id+"' align='middle'>" +
"<param name='allowScriptAccess' value='always' />" +
"<param name='movie' value='"+url+"' />" +
"<param name='FlashVars' value='"+vars+"' />" +
"<param name='wmode' value='"+win+"' />" +
"<param name='menu' value='false' />" +
"<param name='quality' value='high' />" +
"<param name='bgcolor' value='"+bg+"' />" +
"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.marcomedia.com/go/getflashplayer'/>" +
"</object>";

var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=no,location=no,menu=no, menubar=no, height=10, width=10'); 

imgwin.focus(); 
imgwin.document.open(); 
imgwin.document.write("<html>\n"); 
imgwin.document.write("<head>\n"); 
imgwin.document.write("<title> 세계 최대의 온라인 한인업소록 - 한인북</title>\n"); 
imgwin.document.write("<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n"); 
imgwin.document.write("</head>\n"); 
imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n'); 
imgwin.document.write(flashStr); 
imgwin.document.write("</body>\n");
imgwin.document.write("</head>\n");
imgwin.document.write("</html>\n"); 
imgwin.document.close(); 
}

function flashWrite(url,w,h,id,bg,vars,win){

var flashStr=
"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"'height='"+h+"' id='"+id+"' align='middle'>" +
"<param name='allowScriptAccess' value='always' />" +
"<param name='movie' value='"+url+"' />" +
"<param name='FlashVars' value='"+vars+"' />" +
"<param name='wmode' value='"+win+"' />" +
"<param name='menu' value='false' />" +
"<param name='quality' value='high' />" +
"<param name='bgcolor' value='"+bg+"' />" +
"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.marcomedia.com/go/getflashplayer'/>" +
"</object>";

document.write(flashStr);
}

function hideWinStatus()
{
window.status=''
return true
}

