source: branches/version-2_4/html/user_data/packages/default/js/flash.js @ 18734

Revision 18734, 5.1 KB checked in by nanasess, 14 years ago (diff)

Copyright の更新(#601)

Line 
1/*
2 * This file is part of EC-CUBE
3 *
4 * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
5 *
6 * http://www.lockon.co.jp/
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21 */
22
23// **************  設定部分 *******************
24
25    // Flashファイルへの相対パス
26    var flashFilePath = "swf/index.swf";
27
28    // Flash横幅
29    var flashWidth = "400";
30
31    // Flash縦幅
32    var flashHeight = "279";
33
34    // Flashの必要バージョン
35    var reqVersion = 6;
36
37    // Flashがインストールされていないときに表示するメッセージ
38    var noFlashMsg =
39        "<table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" summary=\" \">"
40        +"<tr><td colspan=\"3\"><img src=\"./img/flash/image_flash01.jpg\" width=\"400\" height=\"174\" alt=\"\"></td></tr>"
41        +"<tr>"
42        +"<td><img src=\"./img/flash/image_flash02.jpg\" width=\"140\" height=\"22\" alt=\"\"></td>"
43        +"<td><a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P5_Language=Japanese&Lang=Japanese&P1_Prod_Version=ShockwaveFlash&amp;Lang=Japanese\" target=\"_blank\"><img src=\"./img/flash/download.gif\" width=\"205\" height=\"22\" alt=\"\" border=\"0\"></a></td>"
44        +"<td><img src=\"./img/flash/image_flash03.jpg\" width=\"55\" height=\"22\" alt=\"\"></td></tr>"
45        +"</tr>"
46        +"<tr><td colspan=\"3\"><img src=\"./img/flash/image_flash04.jpg\" width=\"400\" height=\"84\" alt=\"\"></td></tr>"
47        +"</table>";
48
49
50// ************** メイン *********************
51
52    var maxVersion = 7;
53    var actualVersion = 0;
54    var jsVersion = 1.0;
55    var noflashflag;
56    var flash2Installed = false;
57    var flash3Installed = false;
58    var flash4Installed = false;
59    var flash5Installed = false;
60    var flash6Installed = false;
61    var flash7Installed = false;
62    var rightVersion = false;
63    var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
64    var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
65    jsVersion = 1.1;
66
67    if(isIE && isWin){
68        document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
69        document.write('on error resume next \n');
70        document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
71        document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
72        document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
73        document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n'); 
74        document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n'); 
75        document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n'); 
76        document.write('</SCR' + 'IPT\> \n');
77    }
78
79
80
81
82    function detectFlash() {
83       
84        if (navigator.plugins) {
85            if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
86                var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
87                var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
88                var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
89                flash2Installed = flashVersion == 2;
90                flash3Installed = flashVersion == 3;
91                flash4Installed = flashVersion == 4;
92                flash5Installed = flashVersion == 5;
93                flash6Installed = flashVersion == 6;
94                flash6Installed = flashVersion >= 7;
95            }
96        }
97
98        for (var i = 2; i <= maxVersion; i++) { 
99            if (eval("flash" + i + "Installed") == true) actualVersion = i;
100        }
101
102        if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 3;
103
104        if (actualVersion >= reqVersion) {
105            rightVersion = true;
106            document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"" + flashWidth + "\" height=\"" + flashHeight + "\">");
107            document.write("<param name=\"movie\" value=\"" + flashFilePath + "\">");
108            document.write("<param name=\"quality\" value=\"high\">");
109            document.write("<param name=\"bgcolor\" value=\"#ffffff\">");
110            document.write("<param name=\"loop\" value=\"false\">");
111            document.write("<embed src=\"" + flashFilePath + "\" quality=\"high\" bgcolor=\"#ffffff\" loop=\"false\"  width=\"" + flashWidth + "\" height=\"" + flashHeight + "\" type=\"application/x-shockwave-flash\" pluginspage=\"http://wsww.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" Name=\"opening\"></embed>");
112            document.write("</object>");
113        } else {
114            document.write(noFlashMsg);
115        }
116    }
117
118
119
120    detectFlash();
Note: See TracBrowser for help on using the repository browser.