

/*







     Copyright (c)2009 Eshizuoka.jp All Rights Reserved.

                             http://www.eshizuoka.jp/





*/


var jwd_box_id = 'jwd_search_box';
var jwd_bg_url = 'http://www.eshizuoka.jp/contents/bar2/jwd-yst-logo.jpg';
var isMSIE = /*@cc_on!@*/0;


/*topNavibar(S)*/

function topNavibar() {



document.getElementsByTagName('body')[0].style.marginTop="24px";

//topbar
var div1=document.createElement('div');
div1.style.display="block";
div1.style.position="absolute";
div1.style.top="0pt";
div1.style.left="0pt";
div1.style.height="24px";
div1.style.width="100%";
div1.style.minWidth="740px";
div1.style.MozBackgroundClip="-moz-initial";
div1.style.MozBackgroundOrigin="-moz-initial";
div1.style.MozBackgroundInlinePolicy="-moz-initial";
div1.setAttribute('id','topbar');

//barleft ロゴ部分
var div2=document.createElement('div');
div2.style.cssFloat="left";
div2.style.width="140px";
div2.style.height="23px";
div2.setAttribute('id','barleft');
div1.appendChild(div2);


//barright 検索及びログイン部分
var div3=document.createElement('div');
div3.style.cssFloat="right";
div3.style.height="23px";
div3.style.margin="0pt 5pt 0pt 0pt";
div3.style.width="420px";
div3.style.fontSize="10px";
div3.style.lineHeight="23px";
div3.setAttribute('id','barright');
div1.appendChild(div3);

//barcenter テキスト広告部分
var div4=document.createElement('div');
div4.style.height="23px";
div4.style.margin="0pt";
div4.style.fontSize="10px";
div4.style.lineHeight="23px";
div4.style.textAlign="left";
div4.setAttribute('id','barcenter');
div1.appendChild(div4);




//clear
var div5=document.createElement('div');
div5.style.clear="both";
div1.appendChild(div5);
var hr1=document.createElement('hr');
hr1.style.display="none";
div5.appendChild(hr1);

    var oBODY=document.getElementsByTagName('body').item(0);
    oBODY.appendChild(div1);





var msgs = new Array;
// 【センターテキスト（ランダム）】ここから設定	

	msgs[0] = '　<span>[PR]　<a href="http://news.eshizuoka.jp/e539691.html">3月24日(水)eしずおかブログ3周年イベント開催決定！詳細はコチラ！</a></span>';
//	msgs[1] = '　<span class="brown">[PR]　<a href="http://www.eshizuoka.jp/contents/bar2/gourmet.html">忘年会のお店探しはコチラ　静岡限定サイト「もしもしグルメ」</a></span>';
//	msgs[2] = '　<span class="green">[PR]　<a href="http://www.eshizuoka.jp/contents/bar2/gourmet.html">忘年会のお店探しはコチラ　静岡限定サイト「もしもしグルメ」</a></span>';
//	msgs[3] = '　<span class="red">[PR]　<a href="http://www.eshizuoka.jp/contents/bar2/gourmet.html">忘年会のお店探しはコチラ　静岡限定サイト「もしもしグルメ」</a></span>';
//	msgs[4] = '　<span class="blue">[PR]　<a href="http://www.eshizuoka.jp/contents/bar2/gourmet.html">忘年会のお店探しはコチラ　静岡限定サイト「もしもしグルメ」</a></span>';

// 【センターテキスト（ランダム）】ここまで設定	
	var shuffle = Math.floor( Math.random() * msgs.length );
	document.getElementById("barcenter").innerHTML = (msgs[shuffle]);

// 【右上テキスト（固定）】ここから設定	
	var msgs2 = '<div class="blockL"><form action="http://eshizuoka.jword.jp/search" method="get"><select name="domain" id="jwd_domain"><option value="web" selected="selected">ウェブ</option><option value="eshizuoka.jp">サイト内</option></select><input name="q" type="text" id="jwd_search_box" value="" onfocus="jwd_yst_bgcon(0)" onbuler="jwd_yst_bgcon(2)" onunload="jwd_yst_bgcon(2)" onkeydown="jwd_yst_bgcon(0)" /><button class="search" type="submit">検索</button><input type="hidden" name="ienc" value="UTF-8" /></form></div><div class="blockR"><p><a style="line-height:23px; margin-left:5px;" href="http://www.eshizuoka.jp/admin/member_regist.php">新規登録</a>｜<a style="line-height:23px;" href="http://www.eshizuoka.jp/admin/login.php">ログイン</a>｜<a style="line-height:23px;" href="http://help.clog.jp/" target="_blank">ヘルプ</a></p></div>';
// 【右上テキスト（固定）】ここまで設定	
	document.getElementById("barright").innerHTML = msgs2;

// 【左上（固定）】ここから設定	
	var msgs3 = '<p><a href="http://www.eshizuoka.jp/"><img src="http://www.eshizuoka.jp/contents/bar2/bar_logo.gif" alt="ｅしずおかブログ" width="108" height="23" border="0" style="" /></a></p>';
// 【左上（固定）】ここまで設定	
	document.getElementById("barleft").innerHTML = msgs3;

topbarCSS();
// print barCSS

}
/*randmsg(E)*/









/*barCSS(S)*/
function topbarCSS(){

 //document.write ('<link href="http://www.eshizuoka.jp/contents/bar/styles.css" rel="stylesheet" type="text/css" />');

 if(document.all)
  document.createStyleSheet('http://www.eshizuoka.jp/contents/bar2/styles.css');
   // stylesheet object createStyleSheet([sURL] [, iIndex])
   // iIndexは省略可。省略するとスタイルシート集合の最後に追加。 

 else if(document.styleSheets){
  var nLink=document.createElement('link');
   // Element createElement(in DOMString tagName)
   // raises(DOMException);
  
  nLink.rel="StyleSheet";
  nLink.type="text/css";
  nLink.href="http://www.eshizuoka.jp/contents/bar2/styles.css";
  var oHEAD=document.getElementsByTagName('head').item(0);
  oHEAD.appendChild(nLink);
   // Node appendChild(in Node newChild)
   // raises(DOMException);
 }
}
/*barCSS(E)*/




window.onload = topNavibar;




//    jwd_yst_bgcon(2);
/*
if (document.compatMode == 'CSS1Compat') {
// 標準モード
	document.getElementById("jwd_search_box").style.height='12px';
} else {
// 互換モード
	document.getElementById("jwd_search_box").style.height='20px';
}
*/
function jwd_yst_bgcon(mod){
    switch(mod){
        case 0:
            document.getElementById("jwd_search_box").style.backgroundImage='none';
            break;
        case 1:
            document.getElementById("jwd_search_box").style.backgroundImage='url('+jwd_bg_url+')';
            break;
        case 2:
            if(document.getElementById("jwd_search_box").value==''){
                jwd_yst_bgcon(1);
            }else{
                jwd_yst_bgcon(0);
				document.getElementById("jwd_search_box").focus();
            }
            break;
  }
}