/* menuImg º¯¼ö Á¤ÀÇ */
//menuImg ¼ø¼­ ("image°æ·Î,image°¡·ÎÆø,image¼¼·ÎÆø,LinkÁÖ¼Ò")
var menuImg = new Array("http://danmee.chosun.com/common/gnb_menu01_off.gif,101,26,http://danmee.chosun.com/fs_beauty/",
"http://danmee.chosun.com/common/gnb_menu02_off.gif,102,26,http://danmee.chosun.com/love_sex/",
"http://danmee.chosun.com/common/gnb_menu03_off.gif,62,26,http://danmee.chosun.com/living/",
"http://danmee.chosun.com/common/gnb_menu04_off.gif,103,26,http://danmee.chosun.com/baby/",
"http://danmee.chosun.com/common/gnb_menu05_off.gif,115,26,http://danmee.chosun.com/entertain/",
"http://danmee.chosun.com/common/gnb_menu06_off.gif,107,26,http://danmee.chosun.com/talk/",
"http://danmee.chosun.com/common/gnb_menu07_off.gif,91,26,http://danmee.chosun.com/servlet/base.danmi.ArtListMan?code=00000"
);
/* ±âº» ÀÌ¹ÌÁö swap ÇÔ¼ö */
//ÀÌ¹ÌÁö ÃÊ±âÈ­ ÇÔ¼ö
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//ÀÌ¹ÌÁö °´Ã¼ À§Ä¡°ªÈ£Ãâ ÇÔ¼ö
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

//ÀÌ¹ÌÁö º¯È¯ ÇÔ¼ö

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/* ¸Þ´º »ý¼º ÇÔ¼ö */
function defaultMu(){
//±âº» Å×ÀÌºí°ª ¼³Á¤
var topTag="<table width='980' border='0' cellspacing='0' cellpadding='0' style='margin:0 0 15px 0;'>";
      topTag = topTag + "<tr>";
      topTag = topTag + "<td width='6' rowspan='2'></td>";
      topTag = topTag + "          <td width='151' align='left' valign='top'><img src='http://danmee.chosun.com/common/logo_danmi.gif' height='64' border='0' usemap='#logo'><map name='logo'><area shape='rect' coords='13,19,73,45' href='http://www.chosun.com/' target=_blank><area shape='rect' coords='78,13,146,59' href='http://danmee.chosun.com'></map></td>";
      topTag = topTag + "          <td valign='bottom'  style='padding:0 7px 8px 0;' ><table width='100%' border='0' cellpadding='0' cellspacing='0'>";
      topTag = topTag + "            <tr>";
      topTag = topTag + "                <td align='right' valign='bottom'><a href='http://www.chosun.com/' target='_blank'><img src='http://danmee.chosun.com/common/logo_chosun.gif' width='80' height='11' border='0'></a> ";
      topTag = topTag + "                  | <a href='http://weekly.chosun.com/' target='_blank'>À§Å¬¸®Á¶¼±</a> ";
      topTag = topTag + "                  | <a href='http://san.chosun.com/' target='_blank'>¿ù°£»ê</a> | ";
      topTag = topTag + "                  <a href='http://monthly.chosun.com/' target='_blank'>¿ù°£Á¶¼±</a> ";
      topTag = topTag + "                  | <a href='http://kid.chosun.com/' target='_blank'>¼Ò³âÁ¶¼±</a> ";
      topTag = topTag + "                  | <a href='http://magazine.chosun.com/' target='_blank'>¸Å°ÅÁø</a> ";
      topTag = topTag + "                  | <a href='http://wef.danmee.chosun.com/' target='_blank'><img src='http://danmee.chosun.com/common/logo_wef001.gif' width='60' height='32' border='0'></a></td>";
      topTag = topTag + "            </tr>";
      topTag = topTag + "          </table></td>";
      topTag = topTag + "</tr>";
      topTag = topTag + "<tr>";
      topTag = topTag + "  <td height='37' colspan='2' valign='top' background='http://danmee.chosun.com/common/menu_bg.gif' style='padding:6 12 5 11;'>";

var menuTag="<table width=100% border=0 cellpadding=0 cellspacing=0><tr>";
	//¼øÈ¯¹®1 start
	for(i = 0 ; i < menuImg.length; i++){
		
		//¹®ÀÚ¿­ ÀÚ¸£±â
		tempStr = menuImg[i].split(",");
		//°ª ÇÒ´ç
		imgFile = tempStr[0];
		iWidth = tempStr[1];
		iHeight = tempStr[2];
		iUrl = tempStr[3];
		
		idx = imgFile.indexOf(".gif");
		imgHead = imgFile.substring(0,idx-3)
		
		//td °ª ¼³Á¤ÇÏ±â
		menuTag = menuTag + "<td width='"+iWidth+"'>";
		//link url
		menuTag = menuTag + "<a href="+iUrl+">";
		//ÀÌ¹ÌÁö Tag ¹× over out ÀÌº¥Æ® ¼³Á¤
		menuTag = menuTag + "<img src='";
		//ÇöÀç ÆäÀÌÁöÀÇ È°¼ºÈ­(on) ÀÌ¹ÌÁö	¼³Á¤
		if (i == menuNo){
			menuTag = menuTag + imgHead+"on.gif' width='"+iWidth+"' height='"+iHeight+"' name='Image"+i+"' border='0' ";
		}else{
			menuTag = menuTag + imgHead+"off.gif' width='"+iWidth+"' height='"+iHeight+"' name='Image"+i+"' border='0' ";
			menuTag = menuTag + "onMouseOver=MM_swapImage('Image"+i+"','','"+imgHead+"on.gif',0) onMouseOut=MM_swapImgRestore()";
		}
					
		menuTag = menuTag + "></a></td>";
	}//¼øÈ¯¹® 1 end
//Á¶¼±´åÄÄ ·Î°í ¹× site¸Ê
menuTag = menuTag + "<td width='36'></td><form action='http://search.chosun.com/search/totalSearch.jsp' name=search id=search onSubmit=return BeforeSearch('search'); return ConfirmDate_com(document.search); target=_blank><td width='185' align=center><input type='text' name='searchTerm' style='width:171; background-color: #ffffff; border: #9a9a9a 1px solid'></td>";
menuTag = menuTag + "<td width='48'><input type=image name=DUMMY_SEARCH src='http://danmee.chosun.com/common/btn_search.gif' width='43' height='21' border='0'></td></form>"
menuTag = menuTag + "</tr></table>";
menuTag = topTag + menuTag + "</td></tr></table>";
//È­¸é Ãâ·Â
document.write(menuTag);
}
//½ÇÇà
defaultMu();

function srcAd(){
 document.search.keyword.style.backgroundImage = "" ;
}
/*
var srcAdUrl = "http://cinema.chosun.com/event/flowerspring/index.html" ;
			if (!document.search.keyword.style.backgroundImage){
				eval('document.' + form_name).action = 'http://search.chosun.com/';
			}else {
				eval('document.' + form_name).action = srcAdUrl;
			}
*/

function BeforeSearch(form_name){

	if (typeof(document.forms[form_name].searchTerm) != "undefined" && eval('document.' + form_name + '.searchTerm.value') == ''){
		eval('document.' + form_name).action = 'http://search.chosun.com/';
		return true;
	}

	if (typeof(document.forms[form_name].sTarget) != "undefined") {
		if(eval('document.' + form_name + '.sTarget.value') == 'thesis'){
			eval('document.' + form_name).action = 'http://search.chosun.com/search/thesisSearch.jsp';
			if(document.condition){
				eval(form_name).volume_start.value = document.condition.volume_start.value;
				eval(form_name).volume_end.value = document.condition.volume_end.value;
			}	
		}
		//eval('document.' + form_name).action = '/paper/search_paper.asp';
		else if(eval('document.' + form_name + '.sTarget.value') == 'web') 
			eval('document.' + form_name).action = 'http://search.chosun.com/search/webSearch.jsp';
		else if(eval('document.' + form_name + '.sTarget.value') == 'news'){
			eval('document.' + form_name).action = 'http://search.chosun.com/search/newsSearch.jsp';
			if(document.condition){
				eval(form_name).search_term_start.value = document.condition.search_term_start.value;
				eval(form_name).search_term_end.value = document.condition.search_term_end.value;
			}	
		}
		else if(eval('document.' + form_name + '.sTarget.value') == 'article'){
			eval('document.' + form_name).action = 'http://search.chosun.com/article/search_article.asp';
			if(document.condition){
				eval(form_name).search_term_start.value = document.condition.search_term_start.value;
				eval(form_name).search_term_end.value = document.condition.search_term_end.value;
			}	
		}
		else if(eval('document.' + form_name + '.sTarget.value') == 'man') 
			eval('document.' + form_name).action = 'http://search.chosun.com/search/humanSearch.jsp';
		else if(eval('document.' + form_name + '.sTarget.value') == 'photo'){
			eval('document.' + form_name).action = 'http://search.chosun.com/search/photoSearch.jsp';
			if(document.condition){
				eval(form_name).search_term_start.value = document.condition.search_term_start.value;
				eval(form_name).search_term_end.value = document.condition.search_term_end.value;
			}
		}
		else if(eval('document.' + form_name + '.sTarget.value') == 'blog'){
			eval('document.' + form_name).action = 'http://search.chosun.com/search/blogSearch.jsp';
			if(document.condition){
				eval(form_name).search_term_start.value = document.condition.search_term_start.value;
				eval(form_name).search_term_end.value = document.condition.search_term_end.value;
			}
		}
		else if(eval('document.' + form_name + '.sTarget.value') == 'total') 
			eval('document.' + form_name).action = 'http://search.chosun.com/search/totalSearch.jsp';	
	}
	else {
		eval('document.' + form_name).action = 'http://search.chosun.com/search/totalSearch.jsp';	
	}
	
	return true;
}