// JavaScript Document

//IE用の背景ちらつき防止
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

/**==================================================
*swfObjectでswf表示
*
*@param string swfFile swfファイルのパス
*@param string id swfを表示させる領域のelementId
*@param int width swfの表示横幅
*@param int height swfの表示高さ
*/
function putSwf( swfFile , id , width , height ){
	var so = new SWFObject( swfFile , "external_flashcontent", width , height, "9" );
	so.addParam( "wmode", "transparent" );
	so.addParam( "allowFullScreen", "true" );
	so.addParam( "allowScriptAccess", "always" );
	
	if ( so.write( id ) ) {
	}
}

/**==================================================
*fontsizeの変更
*
*@param string value フォントのサイズ（small,medium,large）のいずれか
*@param string level イメージフォルダまでの階層を指定
*/
function setFontSize( value , level ){
	var values = new Array( 'small' , 'medium' , 'large' );
	/*
	if( values.indexOf( value ) < 0 ){
		return;
	}
	*/
	
	//背景画像の切替----------------------------
	var n = values.length;
	for( i = 0 ; i < n ; i++ ){
		var imageFile = 'header_textsize_' + values[i] + '.gif';
		if( value == values[i] ){
			imageFile = 'header_textsize_' + value + '_cr.gif';
		}
		$('.textSize li.' + values[i] + ' a').css( 'background' , 'url(' + level + 'images/' + imageFile + ') no-repeat' );
	}
	
	//スタイルの設定----------------------------
	var target = '#mainContainer p , #mainContainer dt , #mainContainer dd , #mainContainer th , #mainContainer td';
	var style = {
		'small':{ 'fontsize':'10px' , 'line-height':'16px' },
		'medium':{ 'fontsize':'12px' , 'line-height':'19px' },
		'large':{ 'fontsize':'16px' , 'line-height':'24px' }
	}
	$( target ).css( 'font-size' , style[value]['fontsize'] );
	$( target ).css( 'line-height' , style[value]['line-height'] );
	
	//フォントサイズ変更除外--------------------------------
	$( '#mainContainer p.caption' ).css( 'font-size' , '10px' );
	$( '#mainContainer p.caption' ).css( 'line-height' , '14px' );
	$( '#contactInformation dd' ).css( 'line-height' , '0' );
}

/**==================================================
*ページの先頭までスクロール
*/
function scroll(){
	$('html,body').animate({ scrollTop: 0 }, 500);
}

function mf( evt ){}
function mb( evt ){}

/**==================================================
*lightboxの実行
*階層が変わるとcloseボタンとかが出なくなってしまうのでなんか考える必要あり。
*/
$(function() {
	// Use this example, or...
	//$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
	// This, or...
	//$('#gallery a').lightBox(); // Select all links in object with gallery ID
	// This, or...
	$('a.lightbox').lightBox({
		overlayBgColor: '#000'
	})	;

	// Select all links with lightbox class
	// This, or...
	//$('a').lightBox(); // Select all links in the page
	// ... The possibility are many. Use your creative or choose one in the examples above

});
