function loadCSS(path){

  var ua  = navigator.userAgent.toLowerCase()

  //CSS処理するブラウザリスト
  if(document.layers)return               //n4は崩れるので使わない
  var winie  = ua.indexOf('msie')  !=-1 && ua.indexOf('win')   !=-1      //win-e3〜
  var macie  = ua.indexOf('msie')  !=-1 && ua.indexOf('mac')   !=-1      //mac-e3〜
  var moz    = ua.indexOf('gecko') !=-1                                  //moz1〜
  var opr    = ua.indexOf('opera') !=-1                                  //opera
  var saf    = ua.indexOf('safari')!=-1                                  //safari

  //予備　その他ブラウザ判定用
  //var opr6   = ua.search('opera(\ |\/)6') != -1  //opera6
  //var opr7   = ua.search('opera(\ |\/)7') != -1  //opera7

  //デフォルトパスを./に設定する
  if(!window.loadCSS.arguments[0]) path='./'

  //cssファイル名用変数
  var cssfile = path

  //--ブラウザごとのCSSファイル
  //   OperaはuserAgentにmsieなどを
  //   偽れるので先に分岐して飛ばす
  if (opr)        cssfile += 'opr.css'
  else if (winie) cssfile += 'winie.css'
//  else if (macie) cssfile += 'macie.css'
//  else if (moz)   cssfile += 'moz.css'
  else if (saf)   cssfile += 'saf.css'
  else            cssfile = ''

  var linktag = ''

  if(cssfile !=''){
  
      //各パス内のall.css（共通部）
      linktag +='<link rel="stylesheet"       '
              + '      type="text/css"        '
              + '      href="' 
              + path 
              + 'all.css' 
              + '">'
              
      //ブラウザごとのcss
      linktag +='<link rel="stylesheet"       '
              + '      type="text/css"        '
              + '      href="' 
              + cssfile 
              + '">'
  }

  //出力
  document.write(linktag)

}

function header(path,category) {
	
	// category = 0 ：　ニュース
	//　　　　　= 1 ：　製品情報
	//          = 2 ：　サービス
	//          = 3 ：　会社情報
	//          = 8 ：　サイトマップ
	//          = 9 ：　ホーム
	
	var spacer = '<td width="1" bgcolor="#cccccc"><img src="' + path + 'main/image/spacer.gif" border="0" width="1" height="1"></td>'

	home     = new Array(6)
	title    = new Array(3)
	title[0] = new Array('ニュース','製品情報','サービス','会社情報')
	title[1] = new Array('new/main.html','products/basic/earth.html','csnews/main.html','company/main.html')
	title[2] = new Array(4)

	i = 0
	while (i<4){
		title[2][i] = '<td align="center" width="100" bgcolor="#000066">'
					+ '<a href="'+ path + title[1][i] + '">'
			     	+ '<font style="font-size:9pt" color="#ffffff">'+ title[0][i] + '</font>'
				 	+ '</a>'
				 	+ '</td>'
		i++
	}

	title[2][category] = '<td align="center" width="100" bgcolor="#ffffff">'
					   + '<font style="font-size:9pt" color="#000066">'+ title[0][category] + '</font>'
					   + '</td>'
		
	if (category == 9){
		home[0] = 'new/ems.html'
		home[1] = 'main/image/himawri-1.gif'
		home[2] = '・<a href="company/main-c.html">中文</a>&nbsp&nbsp'
        		+ '・<a href="products/main-e.html">English</a>'
        home[3] = 140
        home[4] = 100
	} else {
		home[0] = 'index.html'
		home[1]	= 'image2/min_house2.gif'
		home[2] = ''
		home[3] = 80
		home[4] = 160
	}

   if (category != 8){
   	   	home[5] = '<a href="' + path + 'main/sitemap.html">Site Map</a>'
	} else {
		home[5] = 'Site Map'
	}
	
	linktag = '<div align="center">'
			+ '<table width="780" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff">'
			+ '<tr height="40">'
			+ spacer
			+ '<td width=' + home[3] + ' align="center">'
			+ '<a href=' + path + home[0] + '><img src=' + path + home[1] + ' border="0"></a>'
			+ '</td>'
    		+ '<td width=' + home[4] + ' align="center">'
      		+ '<font style="font-size:9pt">' + home[2] + '</font>'
        	+ '</td>'
			+ '<td align="center" width="100" style="font-size:9pt">'
			+ '<img src="' + path + 'image2/p_bt042.gif" hspace="5" align="absmiddle">'
			+ home[5]
			+ '</td>'
			+ '<form method="GET" action="http://www.google.co.jp/search">'
			+ '<td align="right">'
		    + '<img src="' + path + 'image2/lop2.gif" hspace="5" align="absmiddle">'
			+ '<input type="text"   name="q" size="20" maxlength="255" value="">'
			+ '<input type="hidden" name="hl"          value="ja">'
			+ '<input type="hidden" name="ie"          value="Shift_JIS">'
			+ '<input type="hidden" name="domains"     value="sanwakizai.co.jp">'
			+ '<input type="hidden" name="sitesearch"  value="sanwakizai.co.jp">'
    		+ '</td>'
			+ '</form>'
    		+ '<td width="10" >　</td>'
    		+ '<td width="200"><img src="'+path+'image2/sanwa.gif"></td>'
    		+ '<td width="10" >　</td>'
			+ spacer
  			+ '</tr>'
			+ '</table>'
			+ '<table width="780" border="0" cellspacing="0" cellpadding="0">'
  			+ '<tr bgcolor="#000066" height="20">'
			+ spacer
			+ '<td width="189" bgcolor="#000066"><img src="'+path+'main/image/spacer.gif" border="0" width="1" height="1"></td>'
			+ title[2][0]
			+ title[2][1]
			+ title[2][2]
			+ title[2][3]
			+ '<td width="189" bgcolor="#000066"><img src="'+path+'main/image/spacer.gif" border="0" width="1" height="1"></td>'
			+ spacer
  			+ '</tr>'
			+ '</table>'

  //出力
  document.write(linktag)
}

function side_news(path) {

	var news   = new Array('','','')
	var exNEWS = new Array()
	var NEWS   = new Array(3)
	var head   = new Array('新製品ニュース','さんわニュース','ニューストピックス')
	var ur1    = new Array()
	var ur2    = new Array()
	var	URL    = window.location.pathname
		
	//	各１０項目まで
	//　ルートからのパスを記述
	NEWS[0] = Array(		//　新製品ニュース
		'products/new/kyou-kan.html,供給管入替工法',
		'products/new/sa-series.html,スーパーオーガー...',
		'products/new/art300.html,アート工法機ＡＲ...',
		'products/new/sa-240.html,スーパードーナツ...',
		'products/kizainews/teisouon.html,低騒音オーガーМ...',
		'products/new/mac3002.html,地盤改良用多軸式...',
		'products/kizainews/PMA1-150ZS1.html,全自動型バッチャ...',
		'products/kizainews/earthnet.html,推進施工管理装置...',
		'products/kizainews/disccutter.html,硬質土用アタッチ...',
		'products/kizainews/lazer.html,薄型レーザセオド...',
		'new/main.html,more...'
		)
		
	NEWS[1] = Array(		//　さんわニュース
		'new/main.html#sn12,通巻 12号',
		'new/main.html#sn11,通巻 11号',
		'new/main.html#sn10,通巻 10号',
		'new/main.html#sn9,通巻 9号',
		'new/main.html#sn8,通巻 8号',
		'new/main.html#sn7,通巻 7号',
		'new/main.html#sn6,通巻 6号',
		'new/main.html#sn5,通巻 5号',
		'new/main.html#sn4,通巻 4号',
		'new/main.html#sn3,通巻 3号',
		'new/kako.html,過去の記事'
		)
		
	NEWS[2] = Array(		//　ニューストピックス
		'new/ems.html,ISO14001　認証取...',
		'main/seihan.html,製販統合について'
		)
		
	ur2 = URL.split("/")
	ur2.reverse()
		
	source = '<table border="0" style="font-size:9pt;line-height:18pt;color:navy">'
		
	for (j=0; j<3; j++){
		for (i in NEWS[j]){
			exNEWS[i] = NEWS[j][i].split(",")
			ur1 = exNEWS[i][0].split("/")
			ur1.reverse()
			if (ur1[0] != ur2[0]){
				news[j] += '　　<a href="' + path + exNEWS[i][0] + '">' + exNEWS[i][1] + '</a><br>'
			} else {
				news[j] += '　　' + exNEWS[i][1] + '<br>'
			}
		}
		source += '<tr><td>∝　' + head[j] + '<br>' + news[j]  + '</td></tr>'
	}
	
	source += '</table>'

  //出力
  document.write(source)
}