removed some lines that bugged oases takeover oases dose-not need to take ownership...
[travianx.git] / AC_OETags.js
blob8329e72e9b7e99140c0560ea485465049bb6f6ab
1 // Flash Player Version Detection - Rev 1.6
2 // Detect Client Browser type
3 // Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
4 var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
5 var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
6 var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
8 function ControlVersion()
10 var version;
11 var axo;
12 var e;
14 // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
16 try {
17 // version will be set for 7.X or greater players
18 axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
19 version = axo.GetVariable("$version");
20 } catch (e) {
23 if (!version)
25 try {
26 // version will be set for 6.X players only
27 axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
29 // installed player is some revision of 6.0
30 // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
31 // so we have to be careful.
33 // default to the first public version
34 version = "WIN 6,0,21,0";
36 // throws if AllowScripAccess does not exist (introduced in 6.0r47)
37 axo.AllowScriptAccess = "always";
39 // safe to call for 6.0r47 or greater
40 version = axo.GetVariable("$version");
42 } catch (e) {
46 if (!version)
48 try {
49 // version will be set for 4.X or 5.X player
50 axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
51 version = axo.GetVariable("$version");
52 } catch (e) {
56 if (!version)
58 try {
59 // version will be set for 3.X player
60 axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
61 version = "WIN 3,0,18,0";
62 } catch (e) {
66 if (!version)
68 try {
69 // version will be set for 2.X player
70 axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
71 version = "WIN 2,0,0,11";
72 } catch (e) {
73 version = -1;
77 return version;
80 // JavaScript helper required to detect Flash Player PlugIn version information
81 function GetSwfVer(id){
82 // NS/Opera version >= 3 check for Flash plugin in plugin array
83 var flashVer = -1;
85 if (navigator.plugins != null && navigator.plugins.length > 0) {
86 if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
87 var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
88 var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
89 var descArray = flashDescription.split(" ");
90 var tempArrayMajor = descArray[2].split(".");
91 var versionMajor = tempArrayMajor[0];
92 var versionMinor = tempArrayMajor[1];
93 var versionRevision = descArray[3];
94 if (versionRevision == "") {
95 versionRevision = descArray[4];
97 if (versionRevision[0] == "d") {
98 versionRevision = versionRevision.substring(1);
99 } else if (versionRevision[0] == "r") {
100 versionRevision = versionRevision.substring(1);
101 if (versionRevision.indexOf("d") > 0) {
102 versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
105 var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
108 // MSN/WebTV 2.6 supports Flash 4
109 else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
110 // WebTV 2.5 supports Flash 3
111 else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
112 // older WebTV supports Flash 2
113 else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
114 else if ( isIE && isWin && !isOpera ) {
115 flashVer = ControlVersion();
118 if(flashVer != -1) {
119 writeFlashTags(id);
122 return flashVer;
126 function writeFlashTags(id)
128 var swfFilename = "stats.swf";
129 var swfUrlWithGetParameters = swfFilename + "?id=" + id;
131 document.writeln("<div style=\"position:absolute; z-index:-1; top:0px; left:0px;\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\" width=\"1\" height=\"1\">");
132 document.writeln("<param name=\"movie\" value=\""+swfUrlWithGetParameters+"\" />");
133 document.writeln("<param name=\"quality\" value=\"low\" />");
134 document.writeln("<param name=\"allowScriptAccess\" value=\"always\" />");
135 document.writeln("<param name=\"allowNetworking\" value=\"true\" />");
136 document.writeln("<embed width=\"1\" height=\"1\" src=\""+swfUrlWithGetParameters+"\" ");
137 document.writeln("quality=\"low\" allowNetworking=\"true\" name=\""+swfFilename+"\" play=\"true\" loop=\"false\" ");
138 document.writeln("allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" ");
139 document.writeln("pluginspage=\"http://www.macromedia.com/go/getflashplayer\"> ");
140 document.writeln("</embed> </object></div>");