// JavaScript Document

function addBookmark(){
	//IE
	if(navigator.userAgent.indexOf("MSIE") > -1){
		document.write('<a onclick="window.external.AddFavorite(\'http://hski.tabi-style.jp\',\'スタイル北海道スキー\')">');
	}else if((navigator.userAgent.indexOf("Firefox") > -1) || (navigator.userAgent.indexOf("Netscape") > -1)){
		document.write('<a onclick="window.sidebar.addPanel(\'スタイル北海道スキー\',\'http://hski.tabi-style.jp\',\'\')">');
	}else if(navigator.userAgent.indexOf("Opera") > -1){
		document.write('<a href="http://hski.tabi-style.jp" rel="sidebar" title="スタイル北海道スキー">');
	}else{
		document.write('<a href="http://hski.tabi-style.jp"></a>');
	}
	document.write('<img src="img/index/url.gif" width="14" height="163" alt="http://hski.tabi-style.jp" title="スタイル北海道スキーをお気に入りに登録！" id="url" class="ro" /></a>');
}



//FLASH読み込み
function flashload(swf,w,h,bgcolor){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ w +'" height="'+ h +'">');
	document.write('<param name="movie" value="'+ swf +'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="bgcolor" value="' + bgcolor + '">');
	document.write('<param name="wmode" value="transparent"/>');
/*	document.write('<embed src="' + swf + '" quality="high" bgcolor="' + bgcolor + '" width="'+ w +'" height="'+ h +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');*/
	document.write('<embed src="' + swf + '" quality="high" bgcolor="' + bgcolor + '" width="'+ w +'" height="'+ h +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed>');
	document.write('</object>');
}




function hide(elementId){
	document.getElementById(elementId).style.display="none"
}
function show(elementId){
	document.getElementById(elementId).style.display=""
}
function ShowContents(contentName){
	hide('tyoblock');
	hide('osablock');
	hide('ngoblock');
	hide('fukblock');
	show(contentName);
}
function HideNav(){
	document.getElementById('btntyo').getElementsByTagName('a')[0].style.backgroundPosition="bottom";
	document.getElementById('btnosa').getElementsByTagName('a')[0].style.backgroundPosition="bottom";
	document.getElementById('btnngo').getElementsByTagName('a')[0].style.backgroundPosition="bottom";
	document.getElementById('btnfuk').getElementsByTagName('a')[0].style.backgroundPosition="bottom";
}
function SetTabClick(li,div){
	var e=document.getElementById(li).getElementsByTagName('a')[0];
	e.contents=div;
	e.onclick=function(){
		ShowContents(this.contents);
		HideNav();
		document.getElementById(li).getElementsByTagName('a')[0].style.backgroundPosition="top";
		return false;
	};
}
window.onload = function(){
/*asrea*/
	document.getElementById('btntyo').getElementsByTagName('a')[0].style.backgroundPosition="top";
	ShowContents('tyoblock');
	SetTabClick('btntyo','tyoblock');
	SetTabClick('btnosa','osablock');
	SetTabClick('btnngo','ngoblock');
	SetTabClick('btnfuk','fukblock');
};
