var  plugin = 0;
var  os_ver ;
var  bowser ;
var i1,i2 ;
var plug;
var agent = navigator.userAgent;
var MainZoneTag;

if ( agent.indexOf('Win') > -1 ){
      os_ver = "Win" ;
}
else if ( agent.indexOf('Mac') > -1 ){
       os_ver = "Mac" ; 
}
else {
       os_ver = "Other" ; 
}

if ( agent.indexOf('MSIE') > -1 ){
       bowser = "IE";
}else if  ( agent.indexOf('Firefox') > -1 ){
       bowser = "FF" ;
}else if  ( agent.indexOf('Mozilla/5') > -1 ){
       bowser = "NS6" ;
}else if  ( agent.indexOf('Mozilla/4') > -1 ){
       bowser = "NS4" ;
}else {
       bowser = "Other";
}


   //OS別プラグイン判定//

   if ( os_ver == "Win") {  //Windows
      if (bowser == "FF" || bowser == "NS4" || bowser == "NS6" ) {  //NS
          for ( i1 = 0 ;  i1 < navigator.plugins.length ; i1++ ) {
                plug =  navigator.plugins[i1].description ;
                if(plug.indexOf("Flash")!=-1){
                       if( plug.substr(16,1) > 5){
						   plugin = 1 ;
    	                   break ;
					   }
                }
           }
      }
      else if ( bowser == "IE" ) {  //IE
                document.write("<script language=\"VBScript\" type=\"text\/vbscript\"\> \n");
                document.write("<!-- // Visual basic helper required to detect Flash Player ActiveX control version information \n");
                document.write("Function VBGetSwfVer(i) \n");
                document.write("  on error resume next \n");
                document.write("  Dim swControl, swVersion \n");
                document.write("  swVersion = 0 \n");
  
                document.write("  set swControl = CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" + CStr(i)) \n");
                document.write("  if (IsObject(swControl)) then \n");
                document.write("    swVersion = swControl.GetVariable(\"$version\") \n");
                document.write("  end if \n");
                document.write("  VBGetSwfVer = swVersion \n");
                document.write("End Function \n");
                document.write("// --> \n");
                document.write("<\/script\> \n");
				for (i=25;i>0;i--) {	
					versionStr = VBGetSwfVer(i);
				}
				if(versionStr.substr(4,1) > 5){
					plugin = 1 ;
				}

       }
      else {  //NS,IE,FF以外
          plugin = 0 ;
      }
   }
   else if ( os_ver == "Mac" ) {  //MacOS
      if (bowser == "FF" || bowser == "NS4" || bowser == "NS6" ) {  //NS
          for ( i1 = 0 ;  i1 < navigator.plugins.length ; i1++ ) {
                plug =  navigator.plugins[i1].description ;
                if(plug.indexOf("Flash")!=-1){
                       if( plug.substr(16,1) > 5){
						   plugin = 1 ;
    	                   break ;
					   }
                }
           }
      }
      else if ( bowser == "IE" ) {  //IE
            if ( agent.indexOf("MSIE 5") > -1 ) {  //IE5以上
				for ( i1 = 0 ;  i1 < navigator.plugins.length ; i1++ ) {
               		plug =  navigator.plugins[i1].description ;
					if(plug.indexOf("Flash")!=-1){
						if( plug.substr(16,1) > 5){
							plugin = 1 ;
							break ;
						}
	                }
				}
            }else {  //IE5以外
            	plugin = 0 ;
            }
       }
       else {  //NS,IE5以外
            plugin = 0 ;
		}
	}
	else {  //Win,Mac以外
		plugin = 0 ;
	}

   //OS別プラグイン判定//
   //ファイル選択//

   if ( plugin == 1 ) {
		MainZoneTag = '<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"760\" height=\"266\" id=\"top\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\"./swf/top.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\"./swf/top.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"760\" height=\"266\" name=\"top\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>';
   }
   else {
		MainZoneTag = '<img name=\"n2005_02_10\" src=\"img/flash.jpg\" width=\"760\" height=\"266\" border=\"0\" usemap=\"#m_2005_02_10\">';
    }