function showDisplay(id) {
	document.getElementById(id).style.display = "block";
}
function hiddenDisplay(id) {
	document.getElementById(id).style.display = "none";
}
function showLayer(id) {
	document.getElementById(id).style.visibility = "visible";
}
function hiddenLayer(id) {
	document.getElementById(id).style.visibility = "hidden";
}
function display_change(tn,n,t) {
  for (i=1; i<=t; i++) {
    if (i==n) document.getElementById(tn+i).style.display='block';
    else document.getElementById(tn+i).style.display='none';
  }
}
function display_change_class(tn,n,t,on,off) {
  for (i=1; i<=t; i++) {
    if (i==n) document.getElementById(tn+i).className=on;
    else document.getElementById(tn+i).className=off;
  }
}

var check_url = location.href;
var array_url = check_url.split("/");

if(array_url[3]) {
	var check_index_3 = array_url[3].indexOf("?");
	if(check_index_3 != '-1') var url3 = array_url[3].split("?");
}

if(array_url[4]) {
	var check_index_4 = array_url[4].indexOf("?");
	if(check_index_4 != '-1') var url4 = array_url[4].split("?");
}

if(url3) var now_url = array_url[0]+"/"+array_url[1]+"/"+array_url[2]+"/"+url3[0];
else if(url4) var now_url = array_url[0]+"/"+array_url[1]+"/"+array_url[2]+"/"+array_url[3]+"/"+url4[0];
else var now_url = check_url;

var now_url = escape(now_url);



var search_url = new Array(
	'#', 'http://search.donga.com/search_total.php?rf='+now_url+'&query=',
	'#', 'http://news.donga.com/search/search_donga.php?rf='+now_url+'&query=',
	'#', 'http://sports.donga.com/dsearch/search_sports.php?rf='+now_url+'&query=',
	'#', 'http://localen.donga.com/search/search_localen.php?rf='+now_url+'&query=',
	'#', 'http://economy.donga.com/search/search_economy.php?rf='+now_url+'&query=',
	'#', 'http://thewoman.donga.com/search/search_thewoman.php?rf='+now_url+'&query=',
	'#', 'http://search.donga.com/search_weeklydonga.php?rf='+now_url+'&query=',
	'#', 'http://search.donga.com/search_womandonga.php?rf='+now_url+'&query=',
	'#', 'http://search.donga.com/search_shindonga.php?rf='+now_url+'&query=',
	'#', 'http://search.donga.com/search_etv.php?rf='+now_url+'&query=',
	'#', 'http://search.donga.com/search_reuters.php?rf='+now_url+'&query=',
	'#', 'http://search.donga.com/search_photo.php?rf='+now_url+'&query=',	
	'#', 'http://search.donga.com/search_album.php?rf='+now_url+'&query=',	
	'#', 'http://search.donga.com/search_inmul.php?rf='+now_url+'&query=',
	'#', 'http://search.donga.com/search_kids.php?rf='+now_url+'&query=',
	'#', 'http://search.donga.com/search_food.php?rf='+now_url+'&query=',
	'#', 'http://search.donga.com/search_dkb.php?rf='+now_url+'&query='
)

function search_go(sel, query) {
    if (!query.value||query.value=="°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.") {
	     alert(' °Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä. ');
	     document.search_form.s_keyword.focus();
	} else {
	     var n, istr;
	     if(!sel) n=0;
		 else n = sel.options.selectedIndex;
	     istr = query.value;
 
	     if (istr == '') document.location = search_url[(n)*2];
	     else document.location = search_url[(n)*2 + 1] + escape(istr);
    }

	return false;
}


function selectBoxNone(check) {
	var useragent = navigator.userAgent;
	var IE6 = (useragent.indexOf('MSIE 6')>0);
	if(IE6){
		var obj = document.getElementsByTagName("select");
		for(var i=0;i<obj.length;i++){
			obj[i].style.visibility = check;
		}
	}
}

function selectBox_jump(targ,frmObj,selObj) {
	if ( targ == "self") {
		document.getElementById(frmObj).action = document.getElementById(selObj).value;
		document.getElementById(frmObj).submit();
	} else if ( targ == "window") {
    eval("window.open('"+document.getElementById(selObj).value+"','win','')");
  }
}
function setPng24(obj) {
    obj.width=obj.height=1;
	obj.style.width = obj.width + "px";
    obj.style.height = obj.height + "px";
    obj.className=obj.className.replace(/\bpng24\b/i,'');
    obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
    obj.src='';
    return '';
}
function MM_jumpMenu1(targ,selObj,restore){ //v3.0
    eval("window.open('"+selObj.options[selObj.selectedIndex].value+"','media','')");
    if (restore) selObj.selectedIndex=0;
}
