
$(function(){
	var userAgent = navigator.userAgent.toLowerCase();
	if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) {
		$("body").css("font-size","16px");
	}
		   
	$("a img.btn").mouseover(function(){
		this.src = this.src.replace(/(\.gif|\.jpg|\.png)/, "_on$1");
	});
	$("a img.btn").mouseout(function(){
		this.src = this.src.replace(/_on(\.gif|\.jpg|\.png)/, "$1");
	});
	
	//奇数、偶数を自動追加
	$('ul').each(function(){
		$(this).find('li:odd').addClass('even');
		$(this).find('li:even').addClass('odd');
	});
	$('table').each(function(){
		$(this).find('tr:odd').addClass('even');
		$(this).find('tr:even').addClass('odd');
	});
	
	//:first-child, :last-childをクラスとして追加
	$(':first-child').addClass('firstChild');
	$(':last-child').addClass('lastChild');
	

	$("li.navi").mouseover(function(){
		$(this).addClass("on");
	});
	
	$("li.navi").mouseout(function(){
		$(this).removeClass("on");
	});
	
	$("dl.faq").click(function(){
		var cssValue = $(this).find("dd").css("display");
		if(cssValue == "none"){
			$(this).find("dd").css("display","block");
		}
		else{
			$(this).find("dd").css("display","none");
		}
	});
	
});

function flashObject(file,width,height){
	
	document.write('<script type="text/javascript">');
	document.write("AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','"+width+"','height','"+height+"','src','"+file+"','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','"+file+"' ); ");
	document.write('</script>');
	document.write('<noscript>');
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'">');
	document.write('<param name="movie" value="'+file+'.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="quality" value="high" />');
    document.write('<embed src="'+file+'.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>');
	document.write('</object>');
	document.write('</noscript>');
	
}