if( document.styleSheets.length == 0 ){alert("a")

document.write('<style type="text/css">p{ margin:0;}</style>')
			document.getElementsByTagName("head")[0].appendChild(document.createElement("style"));
		}
		
		var yomotsuPutSWF = {	
	
	conf : [
			//e.g.
			//{targetId:"#div1",filePath:"swf/movie.swf",width:500,height:200,ver:7},
		  {targetId:"#visual", filePath:"index.swf", width:900, height:430, ver:7}
	],
		
	pluginVer : 0,// <= do not change this.
	
	hideFlashArea : function(){
		var i, selectorText="";
		
		for( i=0; i<yomotsuPutSWF.conf.length; i++ ){
			selectorText += yomotsuPutSWF.conf[i]["targetId"]+",";
		}
		document.writeln('<style type="text/css">'+selectorText.slice(0,-1)+'{visibility:hidden;}</style>');
		/*
		if( document.styleSheets.length == 0 ){
			document.getElementsByTagName("head")[0].appendChild(document.createElement("style"));
		}
		alert(document.styleSheets.length)
		for( i in yomotsuPutSWF.conf ){
			if( document.styleSheets[0].insertRule ) //!IE
				document.styleSheets[0].insertRule( yomotsuPutSWF.conf[i]["targetId"] + "{visibility:hidden;}", document.styleSheets[0].cssRules.length );
			else if( document.styleSheets[0].addRule ) //for IE
				document.styleSheets[0].addRule( yomotsuPutSWF.conf[i]["targetId"], "{visibility:hidden;}" );
		}
		*/
	},
	
	getFlashVer : function(){
		var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : null;
		if (navigator.mimeTypes["application/x-shockwave-flash"]) {
			yomotsuPutSWF.pluginVer = parseInt(plugin.description.substring(plugin.description.indexOf(".") -1));
		}
		// for IE
		else{
			document.writeln('\n<script type="text/vbscript">');
			document.writeln('on error resume next');
			document.writeln('Dim Flash');
			document.writeln('Flash=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash"))');
			document.writeln('yomotsuPutSWF.pluginVer=Left(Hex(Int(CreateObject("ShockwaveFlash.ShockwaveFlash").FlashVersion)),1)');
			document.writeln('</sc'+'ript>');
		}
	},
	
	replaceSWF : function (){
		var i, putArea, object, param;
		for(i in yomotsuPutSWF.conf){
			putArea = document.getElementById(yomotsuPutSWF.conf[i].targetId.slice(1));
			if((yomotsuPutSWF.pluginVer>=yomotsuPutSWF.conf[i].ver)&&putArea){
				//put swf
				
				putArea.innerHTML = ('<object data="'+yomotsuPutSWF.conf[i].filePath+'" type="application/x-shockwave-flash" width="'+yomotsuPutSWF.conf[i].width+'" height="'+yomotsuPutSWF.conf[i].height+'"><param name="movie" value="'+yomotsuPutSWF.conf[i].filePath+'" /></object>');
			}
		}
	},
	
	showFlashArea : function(){
		var i;
		for( i in yomotsuPutSWF.conf ){
			/*
			if( document.styleSheets[0].insertRule ) //!IE
			document.styleSheets[0].insertRule( yomotsuPutSWF.conf[i]["targetId"] + "{visibility:visible;}", document.styleSheets[0].cssRules.length );
			else if( document.styleSheets[0].addRule ) //for IE
			document.styleSheets[0].addRule( yomotsuPutSWF.conf[i]["targetId"], "{visibility:visible;}");
			*/
			document.getElementById(yomotsuPutSWF.conf[i]["targetId"].slice(1)).style.visibility = "visible";
		}
	},
	
	start : function(){
		this.hideFlashArea();
		this.getFlashVer();
		try {
			window.addEventListener('load', this.replaceSWF, false);
			window.addEventListener('load', this.showFlashArea, false);
		} catch (e) {		
			window.attachEvent('onload', this.showFlashArea);
			window.attachEvent('onload', this.replaceSWF);
		}
	}
}

yomotsuPutSWF.start();