function search_web() {
	var keywords;

	keywords = document.forms.searchmado.Query_Key.value;

	if (keywords.length == 0) {
		alert('検索キーワードを入れてください');
		return;
	}
	document.forms.web_s.Keywords.value = keywords;
	document.forms.web_s.submit();
}
function search_site() {
	var keywords;

	keywords = document.forms.searchmado.Query_Key.value;

	if (keywords.length == 0) {
		location = "http://www.asahi.com/tool/sitesearch/index.html";
		return;
	}
	document.forms.site_s.Keywords.value = keywords;
	document.forms.site_s.submit();
}
function search_dictionary() {
	var keywords;

	keywords = document.forms.searchmado.Query_Key.value;

	if (keywords.length == 0) {
		location = "http://www.asahi.com/tool/jisho/index.html";
		return;
	}
	document.forms.dic_s.Word.value = keywords;
	document.forms.dic_s.submit();
}
function search_map() {
        var keywords;

        keywords = document.forms.searchmado.Query_Key.value;

        if (keywords.length == 0) {
                location = "http://www.asahi.com/tool/map/index.html";
                return;
        } else {
                location = "http://www.asahi.com/tool/map/index.html?address=" + keywords;
                return;
        }
}
function search_shop() {
	var keywords;

	keywords = document.forms.searchmado.Query_Key.value;

	if (keywords.length == 0) {
		location = "http://www.asahi.com/shopping/";
		return;
	}
	document.forms.shop_s.sitem.value = keywords;
	document.forms.shop_s.submit();
}
function search_site_english() {
	var keywords;

	keywords = document.forms.searchmado.Query_Key.value;

	if (keywords.length == 0) {
		location = "http://www.asahi.com/iht-asahi/search.html";
		return;
	}
	document.forms.site_s_english.Keywords.value = keywords;
	document.forms.site_s_english.submit();
}




// フォトギャラリー用（660x590）
function photogwin(){
  w=window.open("","photowin","scrollbars=1,toolbar=0,menubar=0,location=0,directories=0,resizable=1,status=0,width=660,height=590,");
  if(navigator.appVersion.charAt(0)>=4) { w.focus() };
}


// 小窓汎用
var targetWin=0;
function openwin(wid,hei,tgt){
	var opt = "scrollbars=1,toolbar=0,menubar=1,location=1,directories=0,resizable=1,status=1,";
  if(targetWin){
    if(!targetWin.closed) targetWin.close();
  }
  windowFeatures = opt + "width=" + wid + ",height=" + hei; 
  targetWin = open("", tgt, windowFeatures);
  targetWin.focus();
}

function sethome() {
        if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
                document.write('<div id="sethome"><a href="/home.html" onClick="this.style.behavior=\'url(#default#homepage)\'; this.setHomePage(\'http://www.asahi.com/\');">asahi.comをホームに</a></div>');
}
}
function sethome2006() {
        if (navigator.userAgent.indexOf("Opera",0) < 0 && navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
                document.write('<li><a href="/home.html" onClick="this.style.behavior=\'url(#default#homepage)\'; this.setHomePage(\'http://www.asahi.com/\');"><img src="/imag/arrow01.gif" alt="">asahi.comをホームページにする</a></li>');
}
}
function setsearch2006() {
        if (navigator.userAgent.indexOf("Opera",0) < 0 && navigator.userAgent && navigator.userAgent.indexOf('MSIE 7.0')!=-1 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
                document.write('<a href="#" onClick="window.external.AddSearchProvider(&quot;http://www.asahi.com/tool/sitesearch/sitesearch.xml&quot;);">ＩＥ７にニュース検索を追加する</a> ');
}
}
function setsearch2006a() {
        if (navigator.userAgent.indexOf("Opera",0) < 0 && navigator.userAgent && navigator.userAgent.indexOf('Firefox/2.0')!=-1 ) {
                document.write('<a href="#" onClick="window.external.AddSearchProvider(&quot;http://www.asahi.com/tool/sitesearch/sitesearch.xml&quot;);">ＦＦ２にニュース検索を追加する</a> ');
}
}
function channel(url) {
	if ((url=="http://www.asahi.com/home.html")||(url=="http://www.asahi.com/")||(url=="http://preview.asahi.com/test/home.html")||(url=="http://preview.asahi.com/test/")){
                return("AsahicomTop");
        } else if (url.indexOf("/national/") > 0) {
                if (url.indexOf("/update/") > 0) {
                        return("NationalIchikiji");
                } else if (url.indexOf("national/list.html") > 0){
                        return("NationalList");
                } else if ((url == "http://www.asahi.com/national/") || (url == "http://www.asahi.com/national/index.html")) {
                        return("NationalTop");
                } else {
                        return("NationalOther");
                }
        } else if (url.indexOf("/sports/") > 0){
                if (url.indexOf("/update/") > 0) {
                        return("SportsIchikiji");
                } else if (url.indexOf("sports/list.html") > 0){
                        return("SportsList");
                } else if ((url == "http://www.asahi.com/sports/") || (url == "http://www.asahi.com/sports/index.html")) {
                        return("SportsTop");
                } else {
                        return("SportsOther");
                }
        } else if (url.indexOf("/business/") > 0){
                if (url.indexOf("/update/") > 0) {
                        return("BusinessIchikiji");
                } else if (url.indexOf("business/list.html") > 0){
                        return("BusinessList");
                } else if ((url == "http://www.asahi.com/business/") || (url == "http://www.asahi.com/business/index.html")) {
                        return("BusinessTop");
                } else {
                        return("BusinessOther");
                }
        } else if (url.indexOf("/life/") > 0){
                if (url.indexOf("/update/") > 0) {
                        return("LifeIchikiji");
                } else if (url.indexOf("life/list.html") > 0){
                        return("LifeList");
                } else if ((url == "http://www.asahi.com/life/") || (url == "http://www.asahi.com/life/index.html")) {
                        return("LifeTop");
                } else {
                        return("LifeOther");
                }
        } else if (url.indexOf("/politics/") > 0){
                if (url.indexOf("/update/") > 0) {
                        return("PoliticsIchikiji");
                } else if (url.indexOf("politics/list.html") > 0){
                        return("PoliticsList");
                } else if ((url == "http://www.asahi.com/politics/") || (url == "http://www.asahi.com/politics/index.html")) {
                        return("PoliticsTop");
                } else {
                        return("PoliticsOther");
                }
        } else if (url.indexOf("/international/") > 0){
                if (url.indexOf("/update/") > 0) {
                        return("InternationalIchikiji");
                } else if (url.indexOf("international/list.html") > 0){
                        return("InternationalList");
                } else if ((url == "http://www.asahi.com/international/") || (url == "http://www.asahi.com/international/index.html")) {
                        return("InternationalTop");
                } else {
                        return("InternationalOther");
                }
        } else if (url.indexOf("/culture/") > 0){
                if (url.indexOf("/update/") > 0) {
                        return("CultureIchikiji");
                } else if (url.indexOf("culture/list.html") > 0){
                        return("CultureList");
                } else if ((url == "http://www.asahi.com/culture/") || (url == "http://www.asahi.com/culture/index.html")) {
                        return("CultureTop");
                } else if (url.indexOf("culture/nikkan") > 0){
                        return("CultureNikkan");
                } else {
                        return("CultureOther");
                }
        } else if (url.indexOf("/obituaries/") > 0){
                if (url.indexOf("/update/") > 0) {
                        return("ObituariesIchikiji");
                } else if (url.indexOf("obituaries/list.html") > 0){
                        return("ObituariesList");
                } else {
                        return("ObituariesOther");
                }
        } else if (url.indexOf("/paper/") > 0){
                if (url.indexOf("editorial") > 0) {
                        return("PaperEditorial");
                } else if (url.indexOf("column") > 0){
                        return("PaperColumn");
                } else if (url.indexOf("business") > 0){
                        return("PaperBusiness");
                } else if (url.indexOf("/national") > 0){
                        return("PaperNational");
                } else if (url.indexOf("sports") > 0){
                        return("PaperSports");
                } else if (url.indexOf("politics") > 0){
                        return("PaperPolitics");
                } else if (url.indexOf("international") > 0){
                        return("PaperInternational");
                } else if (url.indexOf("front") > 0){
                        return("PaperFront");
                } else {
                        return("PaperOther");
                }
        } else if (url.indexOf("asahi.com/special/") > 0){
                return("Special");
	} else {
                return("Other");
	}
}

