// Common Swf Load Controll JS
// Ver 107-c05

document.write('<script type="text/javascript" src="js/common_swfload.js"></script>');

function commonSwfLoad(target) {
	// Common Setting
	var swfMode = true;
	var vaSwfName = target;
	var vaWidth = '800';
	var vaHeight = '600';
	var vaSwfVersion = '8,0,0';
	var vaLoop = true;
	var vaOpaque = true;
	var vaFlashVers = new Array();
	var vaDetectSwf = '/js/common_swfdetect.swf';
	var vaNoSwfSrc = '<p>&nbsp;</p>';
	var vaNoRunString = '<p id="swfalert"><a href="http://www.adobe.com/shockwave/download/index.cgi?Lang=Japanese&P5_Language=Japanese&P1_Prod_Version=ShockwaveFlash&Lang=Japanese" target="_blank">最新の「Macromedia Flash Player」をインストールしてください</a></p>';
	var vaShowRunString = true;
	
	// Single unit Setting
	switch (target) {
		case 'work_anm2': vaSwfName='worker'; vaWidth = '174'; vaHeight = '299'; vaNoSwfSrc = '<img src="images/nonswf.jpg" alt="">'; vaFlashVers = [ 'tName=news' ]; break;
		case 'work_anm': vaSwfName='worker'; vaWidth = '185'; vaHeight = '160'; vaFlashVers = [ 'tName=worker' ]; vaShowRunString = false; break;
		case 'menu_work': vaSwfName='menu'; vaWidth = '174'; vaHeight = '299'; vaNoSwfSrc = '<img src="images/nonswf.jpg" alt="">'; vaFlashVers = [ 'tName=work' ]; break;
		case 'title_work': vaSwfName='title'; vaWidth = '534'; vaHeight = '160'; vaFlashVers = [ 'tName=work' ]; vaShowRunString = false; break;
		case 'menu_news': vaSwfName='menu'; vaWidth = '174'; vaHeight = '299'; vaNoSwfSrc = '<img src="images/nonswf.jpg" alt="">'; vaFlashVers = [ 'tName=news' ]; break;
		case 'title_news': vaSwfName='title'; vaWidth = '534'; vaHeight = '160'; vaFlashVers = [ 'tName=news' ]; vaShowRunString = false; break;
		case 'menu_office': vaSwfName='menu'; vaWidth = '174'; vaHeight = '299'; vaNoSwfSrc = '<img src="images/nonswf.jpg" alt="">'; vaFlashVers = [ 'tName=office' ]; break;
		case 'title_office': vaSwfName='title'; vaWidth = '534'; vaHeight = '160'; vaFlashVers = [ 'tName=office' ]; vaShowRunString = false; break;
		case 'menu_access': vaSwfName='menu'; vaWidth = '174'; vaHeight = '299'; vaNoSwfSrc = '<img src="images/nonswf.jpg" alt="">';vaFlashVers = [ 'tName=access' ]; break;
		case 'title_access': vaSwfName='title'; vaWidth = '534'; vaHeight = '160'; vaFlashVers = [ 'tName=access' ]; vaShowRunString = false; break;
		default: swfMode = false;
	}
	
	// Write Source
	if ( swfMode ) {
		var swf = new jp.cb.swfLoad( vaSwfName+ '.swf' , vaSwfName+ 'swf', vaWidth , vaHeight);
		swf.setRequiredVersion( vaSwfVersion );
		swf.addParam( 'allowScriptAccess', 'sameDomain' );
		swf.setLoop( vaLoop );
		if ( vaOpaque == true ){ swf.addParam( 'wmode', 'opaque' ); }
		if ( vaFlashVers != '' ) { for ( var i = 0; i < vaFlashVers.length; i++ ) { var spl = vaFlashVers[i].split( '=' ); swf.addFlashVars( spl[0],spl[1] ); } }
		if ( vaDetectSwf != '' ) { swf.setFlashDetectorSwfUrl( vaDetectSwf ); }
		swf.setAltContent( vaNoSwfSrc );
		swf.setPlayerInstallMsg( vaNoRunString );
		swf.doesShowPlayerInstallMsg( vaShowRunString );
		swf.writeHTML();
	} else {
		alert( '[' + target + '] is not setting value...\nSee config file.' );			// Not Setting  Alert!!
		return true;
	}
}


