

//----------------------------------------------------
//URLの設定
//----------------------------------------------------

	URL1="http://www.rakkumauku.co.jp/";
	URL3="http://f00-136.71.fs-user.net/"
	
	//fileURL="file://D:/HP作成/楽まうく/www/";
	URL2="http://localhost/rakkumauku/";	

	
	url="";//実際のURL
	
	
	init();

//document.write(location.href);
//document.write(document.URL);


	//------------------------------
	//初期設定
	//------------------------------
	function init(){
	
		url=document.URL;//URLの取得
		url=document.URL.substring(7,8);//URL文字の取得
//document.write(url);
		//頭の文字が'w'ならweb上のurlをセットする。
		if(url=='w'){ 
			url=URL1;//WebのURL
			return;
		}
		else if(url=='l'){
			url=URL2;//製作環境のURL
			return;
		}
		else if(url=='f'){ 
			url=URL3;//WebのURL
		}		
	}
	
	
	
	
	
	//-----------------------------------
	//現在のディレクトリ位置を返す
	//-----------------------------------	
	function getDirectory(){
		pos=document.URL.lastIndexOf('/');//後ろからの/の位置を取得
		str=document.URL.substring(url.length,pos);//現位置のディレクトリの文字を取得	
		return str;	
	}
	
	//-----------------------------------
	//文字列のチェック
	//-----------------------------------
	function mojiCheck(str1,str2){
		
		//文字数のが同じかチェック
		if(str1.length!=str2.length)
			return false;

		//文字のチェック		
		Obj = new RegExp(str2);
		if (str1.match(Obj)) 
			return true;
		return false;		
	}



//--------------------------------------
//
//--------------------------------------

//コンサルタントメニューのHTML
consulHtml='<div class=\"fmenu\">'
+'<img name=\"consulMenuBase\" border=\"0\" src=\"'+url+'img/topMenu/consulMenu1.gif\" usemap=\"#map1\">'
+'<map name=\"map1\">'
+'<area  onmouseover=\"over(2)\" onmouseout=\"out()\"  href=\"'+url+'gyosekiup/policy.html\" shape=\"rect\" coords=\"0,32,155,47\">'
+'<area  onmouseover=\"over(3)\" onmouseout=\"out()\"  href=\"'+url+'powerup/index.html\" shape=\"rect\" coords=\"0,49,127,64\">'
+'<area  onmouseover=\"over(4)\" onmouseout=\"out()\"  href=\"'+url+'seten/index.html\" shape=\"rect\" coords=\"0,66,121,81\">'
+'<area  onmouseover=\"over(5)\" onmouseout=\"out()\"  href=\"'+url+'jidosyaup/index.html\" shape=\"rect\" coords=\"0,84,164,99\">'
+'</map>'
+'</div>'



	//マウスオーバーで画像の切り替え
	function over(No){
    	switch(No){
			case 2: 
				document.consulMenuBase.src=url+"img/topMenu/consulMenu2.gif";
				break;
			case 3:
				document.consulMenuBase.src=url+"img/topMenu/consulMenu3.gif";
				break;
			case 4:
				document.consulMenuBase.src=url+"img/topMenu/consulMenu4.gif";
				break;			
			case 5:
				document.consulMenuBase.src=url+"img/topMenu/consulMenu5.gif";
				break;			
		}
	}
	
	//マウスアウトで画像を戻す
	function out(){
		consulMenuKeep();
	}
	
	
	
	//該当のディレクトリ下のHPには下記の記入が必要
	//<body onload="javascript:consulMenuKeep()">
	//
	//該当ディレクトリ "gyosekiup,powerup,seten,jidosyaup"
/*
http://www.rakkumauku.co.jp/gyosekiup/policy.html	//業績アップコンサルティング
http://www.rakkumauku.co.jp/powerup/index.html		//営業部隊パワーアップ
http://www.rakkumauku.co.jp/seten/index.html		//顧客接点ツール改善
http://www.rakkumauku.co.jp/jidosyaup/index.html	//自動車学校入校生アップ
*/

	function consulMenuKeep(){
		
		dir=getDirectory();//ディレクトリ名を取得
		
//document.write(dir);

		if(mojiCheck(dir,'gyosekiup')){
			document.consulMenuBase.src=url+"img/topMenu/consulMenu2.gif";
			return;
		}		
		
		if(mojiCheck(dir,'powerup')){
			document.consulMenuBase.src=url+"img/topMenu/consulMenu3.gif";
			return;			 
		}		
		
		if(mojiCheck(dir,'seten')){
			document.consulMenuBase.src=url+"img/topMenu/consulMenu4.gif";
			return;			 					 
		}		
	
		if(mojiCheck(dir,'jidosyaup')){
			document.consulMenuBase.src=url+"img/topMenu/consulMenu5.gif";
			return;			 					 
		}
		
		document.consulMenuBase.src=url+"img/topMenu/consulMenu1.gif";
	}
	



	
//-------トップメニュー ---------------------	
topMenu ='<div class=\"TopLink1\">'
	+'<a href=\"'+url+'index.html\">'
	+'<img src=\"'+url+'img/topMenu/sw1.gif\" width=\"227\" height=\"56\" border=\"0\" />'
	+'</a></div>'
	+'<a class=\"TopLink2\" href=\"'+url+'copinfo/topmessage.html\">■TOPメッセージ</a>'
	+'<a class=\"TopLink3\" href=\"'+url+'copinfo/contact.html\">■お問合せ</a>'
	+'<a class=\"TopLink4\" href=\"'+url+'copinfo/recruit.html\">■人材募集</a>'
	
	
//トップメニューテンプレート
  function TopMenu()
  {
    //書き出し	
    document.write( topMenu );//トップメニュー書き出し
	document.write(consulHtml);//コンサルメニュー書き出し
  }
  
  
 /*HTMLコピー＆ペースト
<link href="../css/topmenu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../Scripts/js/template.js"></script>
 
<div class="top">
<script type="text/javascript">
<!--
  TopMenu()
//-->
</script>
</div>
*/


//--------------------------------------------------------------------
//ページ最後のメニュー
//--------------------------------------------------------------------

	BottomMenu='<div class=\"bottomMenu\">'
	+'<table width=\"750\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">'
	+'<tr>'
    
	+'<td width=\"40\">'
	+'<div class=\"bottomMenuWaku\" align=\"center\">'
	+'<a class=\"bottomMenuMoji\" href=\"'+url+'index.html\">'
	+'TOP'
	+'</a></div></td>'
	
    +'<td width=\"139\">'
	+'<div class=\"bottomMenuWaku\" align=\"center\">'
	+'<a class=\"bottomMenuMoji\" href=\"'+url+'gyosekiup/policy.html\">'
	+'業績アップコンサルティング'
	+'</a></div></td>'
	
    +'<td width=\"111\">'
	+'<div class=\"bottomMenuWaku\" align=\"center\">'
	+'<a class=\"bottomMenuMoji\" href=\"'+url+'powerup/index.html\">'
	+'営業部隊パワーアップ'
	+'</a>'+'</div>'+'</td>'
    
	
	+'<td width=\"108\">'
	+'<div class=\"bottomMenuWaku\" align=\"center\">'
	+'<a class=\"bottomMenuMoji\" href=\"'+url+'seten/index.html\">'
	+'顧客接点ツール改善'
	+'</a>'+'</div>'+'</td>'
    
	
	+'<td width=\"126\">'
	+'<div class=\"bottomMenuWaku\" align=\"center\">'
	+'<a class=\"bottomMenuMoji\" href=\"'+url+'jidosyaup/index.html\">'
	+'自動車学校入校生アップ'
	+'</a>'+'</div>'+'</td>'
	
    +'<td width=\"56\">'
	+'<div class=\"bottomMenuWaku\" align=\"center\">'
	+'<a class=\"bottomMenuMoji\" href=\"'+url+'copinfo/gaiyo.html\">'
	+'会社概要'
	+'</a>'+'</div>'+'</td>'
	
    +'<td width=\"99\">'
	+'<div class=\"bottomMenuWaku\" align=\"center\">'
	+'<a class=\"bottomMenuMoji\" href=\"'+url+'copinfo/kojinjyoho.html\">'
	+'個人情報について'
	+'</a>'+'</div>'+'</td>'
	
    +'<td width=\"71\">'
	+'<div class=\"bottomMenuWaku\" align=\"center\" style=\"border-right:dashed; border-right-width:1px;\">'
	+'<a class=\"bottomMenuMoji\" href=\"'+url+'copinfo/sitemap.html\">'
	+'サイトマップ'
	+'</a>'+'</div>'+'</td>'
  	+'</tr>'+'</table>'+'</div>'
	+'<div>'+'&nbsp;'+'</div>'
    +'<div>'+'<img src=\"'+url+'img/copyright.gif\" />'+'</div>'
  	+'</div>'
	
	
//トップメニューテンプレート
  function bottomMenu()
  {
    //書き出し	
    document.write( BottomMenu )
  }
  
 /*HTMLコピー＆ペースト
 <link href="../css/topmenu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
  bottomMenu()
//-->
</script>	
*/
	
