
function WriteHeader(pos) {

	var top    = '<li><a href="../top/index.htm" onMouseOver="swapImage(\'menu_top\',\'\',\'../img/menu/menu_top_on.gif\',1)" onMouseOut="_restore()"><img src="../img/menu/menu_top_off.gif" alt="Top" name="menu_top" width="98" height="25" border="0" id="menu_top"></a></li>';
	var newboat    = '<li><a href="../newboats/index.htm" onMouseOver="swapImage(\'menu_newboat\',\'\',\'../img/menu/menu_newboat_on.gif\',1)" onMouseOut="_restore()"><img src="../img/menu/menu_newboat_off.gif" alt="NewBoats" name="menu_newboat" width="98" height="25" border="0" id="menu_newboat"></a></li>';
	var usedboat    = '<li><a href="../usedboats/index.htm" onMouseOver="swapImage(\'menu_usedboat\',\'\',\'../img/menu/menu_usedboat_on.gif\',1)" onMouseOut="_restore()"><img src="../img/menu/menu_usedboat_off.gif" alt="UsedBoats" name="menu_usedboat" width="98" height="25" border="0" id="menu_usedboat"></a></li>';
	var boatyard = '<li><a href="../boatyard/index.htm" onMouseOver="swapImage(\'menu_boatyard\',\'\',\'../img/menu/menu_boatyard_on.gif\',1)" onMouseOut="_restore()"><img src="../img/menu/menu_boatyard_off.gif" alt="Boatyard" name="menu_boatyard" width="98" height="25" border="0" id="menu_baotyard"></a></li>';
	var access     = '<li><a href="../access/index.htm" onMouseOver="swapImage(\'menu_access\',\'\',\'../img/menu/menu_access_on.gif\',1)" onMouseOut="_restore()"><img src="../img/menu/menu_access_off.gif" alt="Access" name="menu_access" width="98" height="25" border="0" id="menu_access"></a></li>';
	var link   = '<li><a href="../link/index.htm" onMouseOver="swapImage(\'menu_link\',\'\',\'../img/menu/menu_link_on.gif\',1)" onMouseOut="_restore()"><img src="../img/menu/menu_link_off.gif" alt="リンク" name="menu_link" width="98" height="25" border="0" id="menu_link"></a></li>';
	var tour   = '<li><a href="../tournament/index.htm" onMouseOver="swapImage(\'menu_tour\',\'\',\'../img/menu/menu_tour_on.gif\',1)" onMouseOut="_restore()"><img src="../img/menu/menu_tour_off.gif" alt="トーナメント" name="menu_tour" width="98" height="25" border="0" id="menu_tour"></a></li>';
	var parts   = '<li><a href="../parts/index.htm" onMouseOver="swapImage(\'menu_parts\',\'\',\'../img/menu/menu_parts-apparel_on.gif\',1)" onMouseOut="_restore()"><img src="../img/menu/menu_parts-apparel_off.gif" alt="パーツ＆アパレル" name="menu_parts" width="98" height="25" border="0" id="menu_parts"></a></li>';

	if(pos == "newboat") {
		newboat = '<li><a href="../newboats/index.htm"><img src="../img/menu/menu_newboat_on.gif" alt="NewBoats" width="98" height="25" border="0"></a></li>';

	} else if(pos == "usedboat") {
		usedboat = '<li><a href="../usedboats/index.htm"><img src="../img/menu/menu_usedboat_on.gif" alt="UsedBoats" width="98" height="25" border="0"></a></li>';
	} else if(pos == "parts") {
		parts = '<li><a href="../parts/index.htm"><img src="../img/menu/menu_parts-apparel_on.gif" alt="parts" width="98" height="25" border="0"></a></li>';
	} else if(pos == "link") {
		link = '<li><a href="../link/index.htm"><img src="../img/menu/menu_link_on.gif" alt="link" width="98" height="25" border="0"></a></li>';
	} else if(pos == "service") {
		service = '<li><a href="04.htm"><img src="../img/menu/menu_service_on.gif" alt="service" width="98" height="25" border="0"></a></li>';
	} else if(pos == "tour") {
		tour = '<li><a href="../tournament/index.htm"><img src="../img/menu/menu_tour_on.gif" alt="tour" width="98" height="25" border="0"></a></li>';
	} else if(pos == "top") {
		top = '<li><a href="../top/index.htm"><img src="../img/menu/menu_top_on.gif" alt="top" width="98" height="25" border="0"></a></li>';
	} else if(pos == "nikki") {
		album = '<li><a href="../nikki/nikki.htm"><img src="../img/menu/menu_album_on.gif" alt="top" width="98" height="25" border="0"></a></li>';
	} else if(pos == "boatyard") {
		boatyard = '<li><a href="../boatyard/index.htm"><img src="../img/menu/menu_boatyard_on.gif" alt="Boatyard" width="98" height="25" border="0"></a></li>';
	} else if(pos == "access") {
		access = '<li><a href="../access/index.htm"><img src="../img/menu/menu_access_on.gif" alt="Access" width="98" height="25" border="0"></a></li>';

	}


	// イメージスワップ
	document.write('<ul id="menu01">');
	document.write(top);
	document.write(newboat);
	document.write(usedboat);
	document.write(parts);
	document.write(boatyard);
	document.write(access);
	document.write(tour);
	document.write(link);
	document.write('</ul>');

}

function WriteTitleHeader(pos) {
	var titleheader;
	if(pos == "newboat"){
		titleheader = '<img src="../img/logo/v6logo30.jpg" width="793" height="80" border="0">';
	} else if(pos == "usedboat"){
		titleheader = '<img src="../img/logo/v6logo23.jpg" width="793" height="80" border="0">';
	} else if(pos == "top"){
		titleheader = '<img src="../img/logo/v6logo29.jpg" width="793" height="80" border="0">';
	} else if(pos == "link"){
		titleheader = '<img src="../img/logo/v6logo10.jpg" width="793" height="80" border="0">';
	} else if(pos == "parts"){
		titleheader = '<img src="../img/logo/v6logo24.jpg" width="793" height="80" border="0">';
	} else if(pos == "tour"){
		titleheader = '<img src="../img/logo/v6logo33.jpg" width="793" height="80" border="0">';
	} else if(pos == "service"){
		titleheader = '<img src="../img/logo/v6logo26.jpg" width="793" height="80" border="0">';
	} else if(pos == "new"){
		titleheader = '<img src="../img/logo/v6logo11.jpg" width="793" height="80" border="0">';
	} else if(pos == "nikki"){
		titleheader = '<img src="../img/logo/v6logo17.jpg" width="793" height="80" border="0">';
	} else if(pos == "boatyard"){
		titleheader = '<img src="../img/logo/v6logo25.jpg" width="793" height="80" border="0">';
	} else if(pos == "access"){
		titleheader = '<img src="../img/logo/v6logo27.jpg" width="793" height="80" border="0">';
	} else {
		titleheader = '<img src="../img/logo/v6logo28.jpg" width="793" height="80" border="0">';

	}

	document.write(titleheader);
}


// 画像スワップ
function swapImage() {
	var i;
	var j = 0;
	var args = swapImage.arguments;
	document.MM_sr = new Array;
	for(i = 0;i < (args.length - 2);i+=3)
   if((x = findObject(args[i])) != null) {
	 	document.MM_sr[j++] = x;
		if(!x.osrc)
			x.osrc = x.src;
		x.src = args[i+2];
	}
}

// オブジェクトのチェック
function findObject(n, doc) {
	var p;
	var i;
	var x;
	if(!doc)
		doc = document;
	if((p = n.indexOf("?")) > 0 && parent.frames.length) {
		doc = parent.frames[n.substring(p+1)].document;
		n = n.substring(0, p);
	}
  if(!(x = doc[n]) && doc.all)
		x = doc.all[n];
	for(i = 0;!x && i < doc.forms.length;i++)
		x=doc.forms[i][n];
  for(i = 0;!x && doc.layers && i < doc.layers.length;i++)
		x=findObject(n,doc.layers[i].document);
  if(!x && doc.getElementById)
		x = doc.getElementById(n);
	return x;
}

//
// 画像のロード
//
function _preload() {
	var doc = document;
	if(doc.images) {
		if(!doc.MM_p)
			doc.MM_p=new Array();
    var i;
		var j = doc.MM_p.length;
		var args = _preload.arguments;
		for(i = 0;i < args.length;i++) {
			if(args[i].indexOf("#") != 0) {
				doc.MM_p[j] = new Image;
				doc.MM_p[j++].src = args[i];
			}
		}
	}
}

//
// 画像のリストア
//
function _restore() {
	var i;
	var x;
	var args = document.MM_sr;
	for(i = 0;args && i < args.length && (x = args[i]) && x.osrc;i++)
		x.src=x.osrc;
}
