Lib_Js_Mage - Version 1.6.0.0

Version Notes

1.6.0.0

Download this release

Release Info

Developer Magento Core Team
Extension Lib_Js_Mage
Version 1.6.0.0
Comparing to
See all releases


Version 1.6.0.0

Files changed (57) hide show
  1. js/blank.html +0 -0
  2. js/flash/AC_RunActiveContent.js +292 -0
  3. js/index.php +144 -0
  4. js/lib/FABridge.js +613 -0
  5. js/lib/boxover.js +372 -0
  6. js/lib/ccard.js +28 -0
  7. js/lib/dropdown.js +36 -0
  8. js/lib/ds-sleight.js +38 -0
  9. js/lib/flex.js +427 -0
  10. js/mage/adminhtml/accordion.js +139 -0
  11. js/mage/adminhtml/browser.js +395 -0
  12. js/mage/adminhtml/events.js +137 -0
  13. js/mage/adminhtml/flexuploader.js +372 -0
  14. js/mage/adminhtml/form.js +470 -0
  15. js/mage/adminhtml/giftmessage.js +280 -0
  16. js/mage/adminhtml/giftoptions/tooltip.js +211 -0
  17. js/mage/adminhtml/grid.js +850 -0
  18. js/mage/adminhtml/hash.js +162 -0
  19. js/mage/adminhtml/image.js +91 -0
  20. js/mage/adminhtml/loader.js +282 -0
  21. js/mage/adminhtml/magento-all.js +25 -0
  22. js/mage/adminhtml/product.js +1052 -0
  23. js/mage/adminhtml/product/composite/configure.js +765 -0
  24. js/mage/adminhtml/rules.js +383 -0
  25. js/mage/adminhtml/sales.js +1055 -0
  26. js/mage/adminhtml/sales/packaging.js +813 -0
  27. js/mage/adminhtml/scrollbar.js +397 -0
  28. js/mage/adminhtml/tabs.js +248 -0
  29. js/mage/adminhtml/tools.js +735 -0
  30. js/mage/adminhtml/uploader.js +258 -0
  31. js/mage/adminhtml/variables.js +164 -0
  32. js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js +67 -0
  33. js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/img/icon.gif +0 -0
  34. js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js +90 -0
  35. js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/img/icon.gif +0 -0
  36. js/mage/adminhtml/wysiwyg/tiny_mce/setup.js +351 -0
  37. js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css +55 -0
  38. js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css +87 -0
  39. js/mage/adminhtml/wysiwyg/widget.js +396 -0
  40. js/mage/centinel.js +112 -0
  41. js/mage/cookies.js +78 -0
  42. js/mage/directpost.js +414 -0
  43. js/mage/translate.js +50 -0
  44. js/mage/translate_inline.css +36 -0
  45. js/mage/translate_inline.js +196 -0
  46. js/spacer.gif +0 -0
  47. js/varien/accordion.js +112 -0
  48. js/varien/configurable.js +319 -0
  49. js/varien/form.js +328 -0
  50. js/varien/iehover-fix.js +64 -0
  51. js/varien/js.js +682 -0
  52. js/varien/menu.js +132 -0
  53. js/varien/payment.js +68 -0
  54. js/varien/product.js +722 -0
  55. js/varien/telephone.js +131 -0
  56. js/varien/weee.js +36 -0
  57. package.xml +18 -0
js/blank.html ADDED
File without changes
js/flash/AC_RunActiveContent.js ADDED
@@ -0,0 +1,292 @@
1
+ //v1.7
2
+ // Flash Player Version Detection
3
+ // Detect Client Browser type
4
+ // Copyright 2005-2007 Adobe Systems Incorporated. All rights reserved.
5
+ var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
6
+ var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
7
+ var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
8
+
9
+ function ControlVersion()
10
+ {
11
+ var version;
12
+ var axo;
13
+ var e;
14
+
15
+ // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
16
+
17
+ try {
18
+ // version will be set for 7.X or greater players
19
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
20
+ version = axo.GetVariable("$version");
21
+ } catch (e) {
22
+ }
23
+
24
+ if (!version)
25
+ {
26
+ try {
27
+ // version will be set for 6.X players only
28
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
29
+
30
+ // installed player is some revision of 6.0
31
+ // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
32
+ // so we have to be careful.
33
+
34
+ // default to the first public version
35
+ version = "WIN 6,0,21,0";
36
+
37
+ // throws if AllowScripAccess does not exist (introduced in 6.0r47)
38
+ axo.AllowScriptAccess = "always";
39
+
40
+ // safe to call for 6.0r47 or greater
41
+ version = axo.GetVariable("$version");
42
+
43
+ } catch (e) {
44
+ }
45
+ }
46
+
47
+ if (!version)
48
+ {
49
+ try {
50
+ // version will be set for 4.X or 5.X player
51
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
52
+ version = axo.GetVariable("$version");
53
+ } catch (e) {
54
+ }
55
+ }
56
+
57
+ if (!version)
58
+ {
59
+ try {
60
+ // version will be set for 3.X player
61
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
62
+ version = "WIN 3,0,18,0";
63
+ } catch (e) {
64
+ }
65
+ }
66
+
67
+ if (!version)
68
+ {
69
+ try {
70
+ // version will be set for 2.X player
71
+ axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
72
+ version = "WIN 2,0,0,11";
73
+ } catch (e) {
74
+ version = -1;
75
+ }
76
+ }
77
+
78
+ return version;
79
+ }
80
+
81
+ // JavaScript helper required to detect Flash Player PlugIn version information
82
+ function GetSwfVer(){
83
+ // NS/Opera version >= 3 check for Flash plugin in plugin array
84
+ var flashVer = -1;
85
+
86
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
87
+ if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
88
+ var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
89
+ var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
90
+ var descArray = flashDescription.split(" ");
91
+ var tempArrayMajor = descArray[2].split(".");
92
+ var versionMajor = tempArrayMajor[0];
93
+ var versionMinor = tempArrayMajor[1];
94
+ var versionRevision = descArray[3];
95
+ if (versionRevision == "") {
96
+ versionRevision = descArray[4];
97
+ }
98
+ if (versionRevision[0] == "d") {
99
+ versionRevision = versionRevision.substring(1);
100
+ } else if (versionRevision[0] == "r") {
101
+ versionRevision = versionRevision.substring(1);
102
+ if (versionRevision.indexOf("d") > 0) {
103
+ versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
104
+ }
105
+ }
106
+ var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
107
+ }
108
+ }
109
+ // MSN/WebTV 2.6 supports Flash 4
110
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
111
+ // WebTV 2.5 supports Flash 3
112
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
113
+ // older WebTV supports Flash 2
114
+ else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
115
+ else if ( isIE && isWin && !isOpera ) {
116
+ flashVer = ControlVersion();
117
+ }
118
+ return flashVer;
119
+ }
120
+
121
+ // When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
122
+ function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
123
+ {
124
+ versionStr = GetSwfVer();
125
+ if (versionStr == -1 ) {
126
+ return false;
127
+ } else if (versionStr != 0) {
128
+ if(isIE && isWin && !isOpera) {
129
+ // Given "WIN 2,0,0,11"
130
+ tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
131
+ tempString = tempArray[1]; // "2,0,0,11"
132
+ versionArray = tempString.split(","); // ['2', '0', '0', '11']
133
+ } else {
134
+ versionArray = versionStr.split(".");
135
+ }
136
+ var versionMajor = versionArray[0];
137
+ var versionMinor = versionArray[1];
138
+ var versionRevision = versionArray[2];
139
+
140
+ // is the major.revision >= requested major.revision AND the minor version >= requested minor
141
+ if (versionMajor > parseFloat(reqMajorVer)) {
142
+ return true;
143
+ } else if (versionMajor == parseFloat(reqMajorVer)) {
144
+ if (versionMinor > parseFloat(reqMinorVer))
145
+ return true;
146
+ else if (versionMinor == parseFloat(reqMinorVer)) {
147
+ if (versionRevision >= parseFloat(reqRevision))
148
+ return true;
149
+ }
150
+ }
151
+ return false;
152
+ }
153
+ }
154
+
155
+ function AC_AddExtension(src, ext)
156
+ {
157
+ if (src.indexOf('?') != -1)
158
+ return src.replace(/\?/, ext+'?');
159
+ else
160
+ return src + ext;
161
+ }
162
+
163
+ function AC_Generateobj(objAttrs, params, embedAttrs)
164
+ {
165
+ var str = '';
166
+ if (isIE && isWin && !isOpera)
167
+ {
168
+ str += '<object ';
169
+ for (var i in objAttrs)
170
+ {
171
+ str += i + '="' + objAttrs[i] + '" ';
172
+ }
173
+ str += '>';
174
+ for (var i in params)
175
+ {
176
+ str += '<param name="' + i + '" value="' + params[i] + '" /> ';
177
+ }
178
+ str += '</object>';
179
+ }
180
+ else
181
+ {
182
+ str += '<embed ';
183
+ for (var i in embedAttrs)
184
+ {
185
+ str += i + '="' + embedAttrs[i] + '" ';
186
+ }
187
+ str += '> </embed>';
188
+ }
189
+
190
+ document.write(str);
191
+ }
192
+
193
+ function AC_FL_RunContent(){
194
+ var ret =
195
+ AC_GetArgs
196
+ ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
197
+ , "application/x-shockwave-flash"
198
+ );
199
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
200
+ }
201
+
202
+ function AC_SW_RunContent(){
203
+ var ret =
204
+ AC_GetArgs
205
+ ( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
206
+ , null
207
+ );
208
+ AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
209
+ }
210
+
211
+ function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
212
+ var ret = new Object();
213
+ ret.embedAttrs = new Object();
214
+ ret.params = new Object();
215
+ ret.objAttrs = new Object();
216
+ for (var i=0; i < args.length; i=i+2){
217
+ var currArg = args[i].toLowerCase();
218
+
219
+ switch (currArg){
220
+ case "classid":
221
+ break;
222
+ case "pluginspage":
223
+ ret.embedAttrs[args[i]] = args[i+1];
224
+ break;
225
+ case "src":
226
+ case "movie":
227
+ args[i+1] = AC_AddExtension(args[i+1], ext);
228
+ ret.embedAttrs["src"] = args[i+1];
229
+ ret.params[srcParamName] = args[i+1];
230
+ break;
231
+ case "onafterupdate":
232
+ case "onbeforeupdate":
233
+ case "onblur":
234
+ case "oncellchange":
235
+ case "onclick":
236
+ case "ondblclick":
237
+ case "ondrag":
238
+ case "ondragend":
239
+ case "ondragenter":
240
+ case "ondragleave":
241
+ case "ondragover":
242
+ case "ondrop":
243
+ case "onfinish":
244
+ case "onfocus":
245
+ case "onhelp":
246
+ case "onmousedown":
247
+ case "onmouseup":
248
+ case "onmouseover":
249
+ case "onmousemove":
250
+ case "onmouseout":
251
+ case "onkeypress":
252
+ case "onkeydown":
253
+ case "onkeyup":
254
+ case "onload":
255
+ case "onlosecapture":
256
+ case "onpropertychange":
257
+ case "onreadystatechange":
258
+ case "onrowsdelete":
259
+ case "onrowenter":
260
+ case "onrowexit":
261
+ case "onrowsinserted":
262
+ case "onstart":
263
+ case "onscroll":
264
+ case "onbeforeeditfocus":
265
+ case "onactivate":
266
+ case "onbeforedeactivate":
267
+ case "ondeactivate":
268
+ case "type":
269
+ case "codebase":
270
+ case "id":
271
+ ret.objAttrs[args[i]] = args[i+1];
272
+ break;
273
+ case "width":
274
+ case "height":
275
+ case "align":
276
+ case "vspace":
277
+ case "hspace":
278
+ case "class":
279
+ case "title":
280
+ case "accesskey":
281
+ case "name":
282
+ case "tabindex":
283
+ ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
284
+ break;
285
+ default:
286
+ ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
287
+ }
288
+ }
289
+ ret.objAttrs["classid"] = classid;
290
+ if (mimeType) ret.embedAttrs["type"] = mimeType;
291
+ return ret;
292
+ }
js/index.php ADDED
@@ -0,0 +1,144 @@
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Core
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Proxy script to combine and compress one or few files for JS and CSS
29
+ *
30
+ * Restricts access only to files under current script's folder
31
+ *
32
+ * @category Mage
33
+ * @package Mage_Core
34
+ * @author Magento Core Team <core@magentocommerce.com>
35
+ */
36
+
37
+ // no files specified return 404
38
+ if (empty($_GET['f'])) {
39
+ header('HTTP/1.0 404 Not Found');
40
+ echo "SYNTAX: index.php/x.js?f=dir1/file1.js,dir2/file2.js";
41
+ exit;
42
+ }
43
+
44
+ // allow web server set content type automatically
45
+ $contentType = false;
46
+
47
+ // set custom content type if specified
48
+ if (isset($_GET['c'])) {
49
+ $contentType = $_GET['c']==='auto' ? true : $_GET['c'];
50
+ }
51
+
52
+ // get files content
53
+ $files = is_array($_GET['f']) ? $_GET['f'] : explode(',', $_GET['f']);
54
+
55
+ // set allowed content-type
56
+ $contentTypeAllowed = array(
57
+ 'text/javascript',
58
+ 'text/css',
59
+ // 'image/gif',
60
+ // 'image/png',
61
+ // 'image/jpeg',
62
+ );
63
+ // set allowed file extensions
64
+ $fileExtAllowed = array(
65
+ 'js',
66
+ 'css',
67
+ // 'gif',
68
+ // 'png',
69
+ // 'js'
70
+ );
71
+
72
+ $out = '';
73
+ $lastModified = 0;
74
+ foreach ($files as $f) {
75
+ $fileRealPath = realpath($f);
76
+ // check file path (security)
77
+ if (strpos($fileRealPath, realpath(dirname(__FILE__))) !== 0) {
78
+ continue;
79
+ }
80
+
81
+ $fileExt = strtolower(pathinfo($fileRealPath, PATHINFO_EXTENSION));
82
+
83
+ // check file extension
84
+ if (empty($fileExt) || !in_array($fileExt, $fileExtAllowed)) {
85
+ continue;
86
+ }
87
+
88
+ // try automatically get content type if requested
89
+ if ($contentType === true) {
90
+ $contentTypes = array(
91
+ 'js' => 'text/javascript',
92
+ 'css' => 'text/css',
93
+ // 'gif' => 'image/gif',
94
+ // 'png' => 'image/png',
95
+ // 'jpg' => 'image/jpeg',
96
+ );
97
+ if (empty($contentTypes[$fileExt])) { // security
98
+ continue;
99
+ }
100
+ $contentType = !empty($contentTypes[$fileExt]) ? $contentTypes[$fileExt] : false;
101
+ }
102
+
103
+ // append file contents
104
+ // we must have blank line at the end of all files but if somebody forget to add it
105
+ // we need add it here
106
+ $out .= file_get_contents($fileRealPath) . "\n";
107
+ $lastModified = max($lastModified, filemtime($fileRealPath));
108
+ }
109
+
110
+ //checking if client have older copy then we have on server
111
+ if (function_exists('date_default_timezone_set')) {
112
+ date_default_timezone_set('UTC');
113
+ }
114
+ if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $lastModified) {
115
+ header("HTTP/1.1 304 Not Modified");
116
+ exit;
117
+ }
118
+
119
+ // last modified is the max mtime for loaded files
120
+ header('Cache-Control: must-revalidate');
121
+ header('Last-modified: ' . gmdate('r', $lastModified));
122
+
123
+ // optional custom content type, can be emulated by index.php/x.js or x.css
124
+ if (is_string($contentType) && in_array($contentType, $contentTypeAllowed)) {
125
+ header('Content-type: '.$contentType);
126
+ }
127
+
128
+ // remove spaces, default on
129
+ if (!(isset($_GET['s']) && !$_GET['s'])) {
130
+ $out = preg_replace('#[ \t]+#', ' ', $out);
131
+ }
132
+
133
+ // use gzip or deflate, use this if not enabled in .htaccess, default on
134
+ //if (!(isset($_GET['z']) && !$_GET['z'])) {
135
+ // ini_set('zlib.output_compression', 1);
136
+ //}
137
+
138
+ // add Expires header if not disabled, default 1 year
139
+ if (!(isset($_GET['e']) && $_GET['e']==='no')) {
140
+ $time = time()+(isset($_GET['e']) ? $_GET['e'] : 365)*86400;
141
+ header('Expires: '.gmdate('r', $time));
142
+ }
143
+
144
+ echo $out;
js/lib/FABridge.js ADDED
@@ -0,0 +1,613 @@
1
+ /*
2
+ Copyright 2006 Adobe Systems Incorporated
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
5
+ to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
6
+ and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
13
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
14
+ OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+
16
+ */
17
+
18
+
19
+ /*
20
+ * The Bridge class, responsible for navigating AS instances
21
+ */
22
+ function FABridge(target,bridgeName)
23
+ {
24
+ this.target = target;
25
+ this.remoteTypeCache = {};
26
+ this.remoteInstanceCache = {};
27
+ this.remoteFunctionCache = {};
28
+ this.localFunctionCache = {};
29
+ this.bridgeID = FABridge.nextBridgeID++;
30
+ this.name = bridgeName;
31
+ this.nextLocalFuncID = 0;
32
+ FABridge.instances[this.name] = this;
33
+ FABridge.idMap[this.bridgeID] = this;
34
+
35
+ return this;
36
+ }
37
+
38
+ // type codes for packed values
39
+ FABridge.TYPE_ASINSTANCE = 1;
40
+ FABridge.TYPE_ASFUNCTION = 2;
41
+
42
+ FABridge.TYPE_JSFUNCTION = 3;
43
+ FABridge.TYPE_ANONYMOUS = 4;
44
+
45
+ FABridge.initCallbacks = {};
46
+ FABridge.userTypes = {};
47
+
48
+ FABridge.addToUserTypes = function()
49
+ {
50
+ for (var i = 0; i < arguments.length; i++)
51
+ {
52
+ FABridge.userTypes[arguments[i]] = {
53
+ 'typeName': arguments[i],
54
+ 'enriched': false
55
+ };
56
+ }
57
+ }
58
+
59
+ FABridge.argsToArray = function(args)
60
+ {
61
+ var result = [];
62
+ for (var i = 0; i < args.length; i++)
63
+ {
64
+ result[i] = args[i];
65
+ }
66
+ return result;
67
+ }
68
+
69
+ function instanceFactory(objID)
70
+ {
71
+ this.fb_instance_id = objID;
72
+ return this;
73
+ }
74
+
75
+ function FABridge__invokeJSFunction(args)
76
+ {
77
+ var funcID = args[0];
78
+ var throughArgs = args.concat();//FABridge.argsToArray(arguments);
79
+ throughArgs.shift();
80
+
81
+ var bridge = FABridge.extractBridgeFromID(funcID);
82
+ return bridge.invokeLocalFunction(funcID, throughArgs);
83
+ }
84
+
85
+ FABridge.addInitializationCallback = function(bridgeName, callback)
86
+ {
87
+ var inst = FABridge.instances[bridgeName];
88
+ if (inst != undefined)
89
+ {
90
+ callback.call(inst);
91
+ return;
92
+ }
93
+
94
+ var callbackList = FABridge.initCallbacks[bridgeName];
95
+ if(callbackList == null)
96
+ {
97
+ FABridge.initCallbacks[bridgeName] = callbackList = [];
98
+ }
99
+
100
+ callbackList.push(callback);
101
+ }
102
+
103
+ // updated for changes to SWFObject2
104
+ function FABridge__bridgeInitialized(bridgeName) {
105
+ var objects = document.getElementsByTagName("object");
106
+ var ol = objects.length;
107
+ var activeObjects = [];
108
+ if (ol > 0) {
109
+ for (var i = 0; i < ol; i++) {
110
+ if (typeof objects[i].SetVariable != "undefined") {
111
+ activeObjects[activeObjects.length] = objects[i];
112
+ }
113
+ }
114
+ }
115
+ var embeds = document.getElementsByTagName("embed");
116
+ var el = embeds.length;
117
+ var activeEmbeds = [];
118
+ if (el > 0) {
119
+ for (var j = 0; j < el; j++) {
120
+ if (typeof embeds[j].SetVariable != "undefined") {
121
+ activeEmbeds[activeEmbeds.length] = embeds[j];
122
+ }
123
+ }
124
+ }
125
+ var aol = activeObjects.length;
126
+ var ael = activeEmbeds.length;
127
+ var searchStr = "bridgeName="+ bridgeName;
128
+ if ((aol == 1 && !ael) || (aol == 1 && ael == 1)) {
129
+ FABridge.attachBridge(activeObjects[0], bridgeName);
130
+ }
131
+ else if (ael == 1 && !aol) {
132
+ FABridge.attachBridge(activeEmbeds[0], bridgeName);
133
+ }
134
+ else {
135
+ var flash_found = false;
136
+ if (aol > 1) {
137
+ for (var k = 0; k < aol; k++) {
138
+ var params = activeObjects[k].childNodes;
139
+ for (var l = 0; l < params.length; l++) {
140
+ var param = params[l];
141
+ if (param.nodeType == 1 && param.tagName.toLowerCase() == "param" && param["name"].toLowerCase() == "flashvars" && param["value"].indexOf(searchStr) >= 0) {
142
+ FABridge.attachBridge(activeObjects[k], bridgeName);
143
+ flash_found = true;
144
+ break;
145
+ }
146
+ }
147
+ if (flash_found) {
148
+ break;
149
+ }
150
+ }
151
+ }
152
+ if (!flash_found && ael > 1) {
153
+ for (var m = 0; m < ael; m++) {
154
+ var flashVars = activeEmbeds[m].attributes.getNamedItem("flashVars").nodeValue;
155
+ if (flashVars.indexOf(searchStr) >= 0) {
156
+ FABridge.attachBridge(activeEmbeds[m], bridgeName);
157
+ break;
158
+ }
159
+ }
160
+ }
161
+ }
162
+ return true;
163
+ }
164
+
165
+ // used to track multiple bridge instances, since callbacks from AS are global across the page.
166
+
167
+ FABridge.nextBridgeID = 0;
168
+ FABridge.instances = {};
169
+ FABridge.idMap = {};
170
+ FABridge.refCount = 0;
171
+
172
+ FABridge.extractBridgeFromID = function(id)
173
+ {
174
+ var bridgeID = (id >> 16);
175
+ return FABridge.idMap[bridgeID];
176
+ }
177
+
178
+ FABridge.attachBridge = function(instance, bridgeName)
179
+ {
180
+
181
+ // reuse bridge if it exists
182
+ // var newBridgeInstance = new FABridge(instance, bridgeName);
183
+
184
+ // reuse bridge if it exists
185
+ // FABridge[bridgeName] = newBridgeInstance;
186
+
187
+ if (typeof FABridge[bridgeName] == 'undefined') {
188
+ FABridge[bridgeName] = new FABridge(instance, bridgeName);
189
+ }
190
+
191
+ /* FABridge[bridgeName] = function() {
192
+ return newBridgeInstance.root();
193
+ }
194
+ */
195
+ var callbacks = FABridge.initCallbacks[bridgeName];
196
+ if (callbacks == null)
197
+ {
198
+ return;
199
+ }
200
+ for (var i = 0; i < callbacks.length; i++)
201
+ {
202
+ // callbacks[i].call(newBridgeInstance);
203
+ callbacks[i].call(FABridge[bridgeName]);
204
+ }
205
+
206
+ // reuse bridge if it exists
207
+ // delete FABridge.initCallbacks[bridgeName]
208
+ }
209
+
210
+ // some methods can't be proxied. You can use the explicit get,set, and call methods if necessary.
211
+
212
+ FABridge.blockedMethods =
213
+ {
214
+ toString: true,
215
+ get: true,
216
+ set: true,
217
+ call: true
218
+ };
219
+
220
+ FABridge.prototype =
221
+ {
222
+
223
+
224
+ // bootstrapping
225
+
226
+ root: function()
227
+ {
228
+ return this.deserialize(this.target.getRoot());
229
+ },
230
+ //clears all of the AS objects in the cache maps
231
+ releaseASObjects: function()
232
+ {
233
+ return this.target.releaseASObjects();
234
+ },
235
+ //clears a specific object in AS from the type maps
236
+ releaseNamedASObject: function(value)
237
+ {
238
+ if(typeof(value) != "object")
239
+ {
240
+ return false;
241
+ }
242
+ else
243
+ {
244
+ var ret = this.target.releaseNamedASObject(value.fb_instance_id);
245
+ return ret;
246
+ }
247
+ },
248
+ //create a new AS Object
249
+ create: function(className)
250
+ {
251
+ return this.deserialize(this.target.create(className));
252
+ },
253
+
254
+
255
+ // utilities
256
+
257
+ makeID: function(token)
258
+ {
259
+ return (this.bridgeID << 16) + token;
260
+ },
261
+
262
+
263
+ // low level access to the flash object
264
+
265
+ //get a named property from an AS object
266
+ getPropertyFromAS: function(objRef, propName)
267
+ {
268
+ if (FABridge.refCount > 0)
269
+ {
270
+ throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
271
+ }
272
+ else
273
+ {
274
+ FABridge.refCount++;
275
+ retVal = this.target.getPropFromAS(objRef, propName);
276
+ retVal = this.handleError(retVal);
277
+ FABridge.refCount--;
278
+ return retVal;
279
+ }
280
+ },
281
+ //set a named property on an AS object
282
+ setPropertyInAS: function(objRef,propName, value)
283
+ {
284
+ if (FABridge.refCount > 0)
285
+ {
286
+ throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
287
+ }
288
+ else
289
+ {
290
+ FABridge.refCount++;
291
+ retVal = this.target.setPropInAS(objRef,propName, this.serialize(value));
292
+ retVal = this.handleError(retVal);
293
+ FABridge.refCount--;
294
+ return retVal;
295
+ }
296
+ },
297
+
298
+ //call an AS function
299
+ callASFunction: function(funcID, args)
300
+ {
301
+ if (FABridge.refCount > 0)
302
+ {
303
+ throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
304
+ }
305
+ else
306
+ {
307
+ FABridge.refCount++;
308
+ retVal = this.target.invokeASFunction(funcID, this.serialize(args));
309
+ retVal = this.handleError(retVal);
310
+ FABridge.refCount--;
311
+ return retVal;
312
+ }
313
+ },
314
+ //call a method on an AS object
315
+ callASMethod: function(objID, funcName, args)
316
+ {
317
+ if (FABridge.refCount > 0)
318
+ {
319
+ throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
320
+ }
321
+ else
322
+ {
323
+ FABridge.refCount++;
324
+ args = this.serialize(args);
325
+ retVal = this.target.invokeASMethod(objID, funcName, args);
326
+ retVal = this.handleError(retVal);
327
+ FABridge.refCount--;
328
+ return retVal;
329
+ }
330
+ },
331
+
332
+ // responders to remote calls from flash
333
+
334
+ //callback from flash that executes a local JS function
335
+ //used mostly when setting js functions as callbacks on events
336
+ invokeLocalFunction: function(funcID, args)
337
+ {
338
+ var result;
339
+ var func = this.localFunctionCache[funcID];
340
+
341
+ if(func != undefined)
342
+ {
343
+ result = this.serialize(func.apply(null, this.deserialize(args)));
344
+ }
345
+
346
+ return result;
347
+ },
348
+
349
+ // Object Types and Proxies
350
+
351
+ // accepts an object reference, returns a type object matching the obj reference.
352
+ getTypeFromName: function(objTypeName)
353
+ {
354
+ return this.remoteTypeCache[objTypeName];
355
+ },
356
+ //create an AS proxy for the given object ID and type
357
+ createProxy: function(objID, typeName)
358
+ {
359
+ var objType = this.getTypeFromName(typeName);
360
+ instanceFactory.prototype = objType;
361
+ var instance = new instanceFactory(objID);
362
+ this.remoteInstanceCache[objID] = instance;
363
+ return instance;
364
+ },
365
+ //return the proxy associated with the given object ID
366
+ getProxy: function(objID)
367
+ {
368
+ return this.remoteInstanceCache[objID];
369
+ },
370
+
371
+ // accepts a type structure, returns a constructed type
372
+ addTypeDataToCache: function(typeData)
373
+ {
374
+ newType = new ASProxy(this, typeData.name);
375
+ var accessors = typeData.accessors;
376
+ for (var i = 0; i < accessors.length; i++)
377
+ {
378
+ this.addPropertyToType(newType, accessors[i]);
379
+ }
380
+
381
+ var methods = typeData.methods;
382
+ for (var i = 0; i < methods.length; i++)
383
+ {
384
+ if (FABridge.blockedMethods[methods[i]] == undefined)
385
+ {
386
+ this.addMethodToType(newType, methods[i]);
387
+ }
388
+ }
389
+
390
+
391
+ this.remoteTypeCache[newType.typeName] = newType;
392
+ return newType;
393
+ },
394
+
395
+ //add a property to a typename; used to define the properties that can be called on an AS proxied object
396
+ addPropertyToType: function(ty, propName)
397
+ {
398
+ var c = propName.charAt(0);
399
+ var setterName;
400
+ var getterName;
401
+ if(c >= "a" && c <= "z")
402
+ {
403
+ getterName = "get" + c.toUpperCase() + propName.substr(1);
404
+ setterName = "set" + c.toUpperCase() + propName.substr(1);
405
+ }
406
+ else
407
+ {
408
+ getterName = "get" + propName;
409
+ setterName = "set" + propName;
410
+ }
411
+ ty[setterName] = function(val)
412
+ {
413
+ this.bridge.setPropertyInAS(this.fb_instance_id, propName, val);
414
+ }
415
+ ty[getterName] = function()
416
+ {
417
+ return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id, propName));
418
+ }
419
+ },
420
+
421
+ //add a method to a typename; used to define the methods that can be callefd on an AS proxied object
422
+ addMethodToType: function(ty, methodName)
423
+ {
424
+ ty[methodName] = function()
425
+ {
426
+ return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id, methodName, FABridge.argsToArray(arguments)));
427
+ }
428
+ },
429
+
430
+ // Function Proxies
431
+
432
+ //returns the AS proxy for the specified function ID
433
+ getFunctionProxy: function(funcID)
434
+ {
435
+ var bridge = this;
436
+ if (this.remoteFunctionCache[funcID] == null)
437
+ {
438
+ this.remoteFunctionCache[funcID] = function()
439
+ {
440
+ bridge.callASFunction(funcID, FABridge.argsToArray(arguments));
441
+ }
442
+ }
443
+ return this.remoteFunctionCache[funcID];
444
+ },
445
+
446
+ //reutrns the ID of the given function; if it doesnt exist it is created and added to the local cache
447
+ getFunctionID: function(func)
448
+ {
449
+ if (func.__bridge_id__ == undefined)
450
+ {
451
+ func.__bridge_id__ = this.makeID(this.nextLocalFuncID++);
452
+ this.localFunctionCache[func.__bridge_id__] = func;
453
+ }
454
+ return func.__bridge_id__;
455
+ },
456
+
457
+ // serialization / deserialization
458
+
459
+ serialize: function(value)
460
+ {
461
+ var result = {};
462
+
463
+ var t = typeof(value);
464
+ //primitives are kept as such
465
+ if (t == "number" || t == "string" || t == "boolean" || t == null || t == undefined)
466
+ {
467
+ result = value;
468
+ }
469
+ else if (value instanceof Array)
470
+ {
471
+ //arrays are serializesd recursively
472
+ result = [];
473
+ for (var i = 0; i < value.length; i++)
474
+ {
475
+ result[i] = this.serialize(value[i]);
476
+ }
477
+ }
478
+ else if (t == "function")
479
+ {
480
+ //js functions are assigned an ID and stored in the local cache
481
+ result.type = FABridge.TYPE_JSFUNCTION;
482
+ result.value = this.getFunctionID(value);
483
+ }
484
+ else if (value instanceof ASProxy)
485
+ {
486
+ result.type = FABridge.TYPE_ASINSTANCE;
487
+ result.value = value.fb_instance_id;
488
+ }
489
+ else
490
+ {
491
+ result.type = FABridge.TYPE_ANONYMOUS;
492
+ result.value = value;
493
+ }
494
+
495
+ return result;
496
+ },
497
+
498
+ //on deserialization we always check the return for the specific error code that is used to marshall NPE's into JS errors
499
+ // the unpacking is done by returning the value on each pachet for objects/arrays
500
+ deserialize: function(packedValue)
501
+ {
502
+
503
+ var result;
504
+
505
+ var t = typeof(packedValue);
506
+ if (t == "number" || t == "string" || t == "boolean" || packedValue == null || packedValue == undefined)
507
+ {
508
+ result = this.handleError(packedValue);
509
+ }
510
+ else if (packedValue instanceof Array)
511
+ {
512
+ result = [];
513
+ for (var i = 0; i < packedValue.length; i++)
514
+ {
515
+ result[i] = this.deserialize(packedValue[i]);
516
+ }
517
+ }
518
+ else if (t == "object")
519
+ {
520
+ for(var i = 0; i < packedValue.newTypes.length; i++)
521
+ {
522
+ this.addTypeDataToCache(packedValue.newTypes[i]);
523
+ }
524
+ for (var aRefID in packedValue.newRefs)
525
+ {
526
+ this.createProxy(aRefID, packedValue.newRefs[aRefID]);
527
+ }
528
+ if (packedValue.type == FABridge.TYPE_PRIMITIVE)
529
+ {
530
+ result = packedValue.value;
531
+ }
532
+ else if (packedValue.type == FABridge.TYPE_ASFUNCTION)
533
+ {
534
+ result = this.getFunctionProxy(packedValue.value);
535
+ }
536
+ else if (packedValue.type == FABridge.TYPE_ASINSTANCE)
537
+ {
538
+ result = this.getProxy(packedValue.value);
539
+ }
540
+ else if (packedValue.type == FABridge.TYPE_ANONYMOUS)
541
+ {
542
+ result = packedValue.value;
543
+ }
544
+ }
545
+ return result;
546
+ },
547
+ //increases the reference count for the given object
548
+ addRef: function(obj)
549
+ {
550
+ this.target.incRef(obj.fb_instance_id);
551
+ },
552
+ //decrease the reference count for the given object and release it if needed
553
+ release:function(obj)
554
+ {
555
+ this.target.releaseRef(obj.fb_instance_id);
556
+ },
557
+
558
+ // check the given value for the components of the hard-coded error code : __FLASHERROR
559
+ // used to marshall NPE's into flash
560
+
561
+ handleError: function(value)
562
+ {
563
+ if (typeof(value)=="string" && value.indexOf("__FLASHERROR")==0)
564
+ {
565
+ var myErrorMessage = value.split("||");
566
+ if(FABridge.refCount > 0 )
567
+ {
568
+ FABridge.refCount--;
569
+ }
570
+ throw new Error(myErrorMessage[1]);
571
+ return value;
572
+ }
573
+ else
574
+ {
575
+ return value;
576
+ }
577
+ }
578
+ };
579
+
580
+ // The root ASProxy class that facades a flash object
581
+
582
+ ASProxy = function(bridge, typeName)
583
+ {
584
+ this.bridge = bridge;
585
+ this.typeName = typeName;
586
+ return this;
587
+ };
588
+ //methods available on each ASProxy object
589
+ ASProxy.prototype =
590
+ {
591
+ get: function(propName)
592
+ {
593
+ return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id, propName));
594
+ },
595
+
596
+ set: function(propName, value)
597
+ {
598
+ this.bridge.setPropertyInAS(this.fb_instance_id, propName, value);
599
+ },
600
+
601
+ call: function(funcName, args)
602
+ {
603
+ this.bridge.callASMethod(this.fb_instance_id, funcName, args);
604
+ },
605
+
606
+ addRef: function() {
607
+ this.bridge.addRef(this);
608
+ },
609
+
610
+ release: function() {
611
+ this.bridge.release(this);
612
+ }
613
+ };
js/lib/boxover.js ADDED
@@ -0,0 +1,372 @@
1
+ /* --- BoxOver ---
2
+ /* --- v 2.1 17th June 2006
3
+ By Oliver Bryant with help of Matthew Tagg
4
+ http://boxover.swazz.org */
5
+
6
+ if (typeof document.attachEvent!='undefined') {
7
+ window.attachEvent('onload',init);
8
+ document.attachEvent('onmousemove',moveMouse);
9
+ document.attachEvent('onclick',checkMove); }
10
+ else {
11
+ window.addEventListener('load',init,false);
12
+ document.addEventListener('mousemove',moveMouse,false);
13
+ document.addEventListener('click',checkMove,false);
14
+ }
15
+
16
+ var oDv=document.createElement("div");
17
+ var dvHdr=document.createElement("div");
18
+ var dvBdy=document.createElement("div");
19
+ var windowlock,boxMove,fixposx,fixposy,lockX,lockY,fixx,fixy,ox,oy,boxLeft,boxRight,boxTop,boxBottom,evt,mouseX,mouseY,boxOpen,totalScrollTop,totalScrollLeft;
20
+ boxOpen=false;
21
+ ox=10;
22
+ oy=10;
23
+ lockX=0;
24
+ lockY=0;
25
+
26
+ function init() {
27
+ oDv.appendChild(dvHdr);
28
+ oDv.appendChild(dvBdy);
29
+ oDv.style.position="absolute";
30
+ oDv.style.visibility='hidden';
31
+ document.body.appendChild(oDv);
32
+ }
33
+
34
+ function defHdrStyle() {
35
+ dvHdr.innerHTML='<img style="vertical-align:middle" src="info.gif">&nbsp;&nbsp;'+dvHdr.innerHTML;
36
+ dvHdr.style.fontWeight='bold';
37
+ dvHdr.style.width='150px';
38
+ dvHdr.style.fontFamily='arial';
39
+ dvHdr.style.border='1px solid #A5CFE9';
40
+ dvHdr.style.padding='3';
41
+ dvHdr.style.fontSize='11';
42
+ dvHdr.style.color='#4B7A98';
43
+ dvHdr.style.background='#D5EBF9';
44
+ dvHdr.style.filter='alpha(opacity=85)'; // IE
45
+ dvHdr.style.opacity='0.85'; // FF
46
+ }
47
+
48
+ function defBdyStyle() {
49
+ dvBdy.style.borderBottom='1px solid #A5CFE9';
50
+ dvBdy.style.borderLeft='1px solid #A5CFE9';
51
+ dvBdy.style.borderRight='1px solid #A5CFE9';
52
+ dvBdy.style.width='150px';
53
+ dvBdy.style.fontFamily='arial';
54
+ dvBdy.style.fontSize='11';
55
+ dvBdy.style.padding='3';
56
+ dvBdy.style.color='#1B4966';
57
+ dvBdy.style.background='#FFFFFF';
58
+ dvBdy.style.filter='alpha(opacity=85)'; // IE
59
+ dvBdy.style.opacity='0.85'; // FF
60
+ }
61
+
62
+ function checkElemBO(txt) {
63
+ if (!txt || typeof(txt) != 'string') return false;
64
+ if ((txt.indexOf('header')>-1)&&(txt.indexOf('body')>-1)&&(txt.indexOf('[')>-1)&&(txt.indexOf('[')>-1))
65
+ return true;
66
+ else
67
+ return false;
68
+ }
69
+
70
+ function scanBO(curNode) {
71
+ if (checkElemBO(curNode.title)) {
72
+ curNode.boHDR=getParam('header',curNode.title);
73
+ curNode.boBDY=getParam('body',curNode.title);
74
+ curNode.boCSSBDY=getParam('cssbody',curNode.title);
75
+ curNode.boCSSHDR=getParam('cssheader',curNode.title);
76
+ curNode.IEbugfix=(getParam('hideselects',curNode.title)=='on')?true:false;
77
+ curNode.fixX=parseInt(getParam('fixedrelx',curNode.title));
78
+ curNode.fixY=parseInt(getParam('fixedrely',curNode.title));
79
+ curNode.absX=parseInt(getParam('fixedabsx',curNode.title));
80
+ curNode.absY=parseInt(getParam('fixedabsy',curNode.title));
81
+ curNode.offY=(getParam('offsety',curNode.title)!='')?parseInt(getParam('offsety',curNode.title)):10;
82
+ curNode.offX=(getParam('offsetx',curNode.title)!='')?parseInt(getParam('offsetx',curNode.title)):10;
83
+ curNode.fade=(getParam('fade',curNode.title)=='on')?true:false;
84
+ curNode.fadespeed=(getParam('fadespeed',curNode.title)!='')?getParam('fadespeed',curNode.title):0.04;
85
+ curNode.delay=(getParam('delay',curNode.title)!='')?parseInt(getParam('delay',curNode.title)):0;
86
+ if (getParam('requireclick',curNode.title)=='on') {
87
+ curNode.requireclick=true;
88
+ document.all?curNode.attachEvent('onclick',showHideBox):curNode.addEventListener('click',showHideBox,false);
89
+ document.all?curNode.attachEvent('onmouseover',hideBox):curNode.addEventListener('mouseover',hideBox,false);
90
+ }
91
+ else {// Note : if requireclick is on the stop clicks are ignored
92
+ if (getParam('doubleclickstop',curNode.title)!='off') {
93
+ document.all?curNode.attachEvent('ondblclick',pauseBox):curNode.addEventListener('dblclick',pauseBox,false);
94
+ }
95
+ if (getParam('singleclickstop',curNode.title)=='on') {
96
+ document.all?curNode.attachEvent('onclick',pauseBox):curNode.addEventListener('click',pauseBox,false);
97
+ }
98
+ }
99
+ curNode.windowLock=getParam('windowlock',curNode.title).toLowerCase()=='off'?false:true;
100
+ curNode.title='';
101
+ curNode.hasbox=1;
102
+ }
103
+ else
104
+ curNode.hasbox=2;
105
+ }
106
+
107
+
108
+ function getParam(param,list) {
109
+ var reg = new RegExp('([^a-zA-Z]' + param + '|^' + param + ')\\s*=\\s*\\[\\s*(((\\[\\[)|(\\]\\])|([^\\]\\[]))*)\\s*\\]');
110
+ var res = reg.exec(list);
111
+ var returnvar;
112
+ if(res)
113
+ return res[2].replace('[[','[').replace(']]',']');
114
+ else
115
+ return '';
116
+ }
117
+
118
+ function Left(elem){
119
+ var x=0;
120
+ if (elem.calcLeft)
121
+ return elem.calcLeft;
122
+ var oElem=elem;
123
+ while(elem){
124
+ if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderLeftWidth)))&&(x!=0))
125
+ x+=parseInt(elem.currentStyle.borderLeftWidth);
126
+ x+=elem.offsetLeft;
127
+ elem=elem.offsetParent;
128
+ }
129
+ oElem.calcLeft=x;
130
+ return x;
131
+ }
132
+
133
+ function Top(elem){
134
+ var x=0;
135
+ if (elem.calcTop)
136
+ return elem.calcTop;
137
+ var oElem=elem;
138
+ while(elem){
139
+ if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderTopWidth)))&&(x!=0))
140
+ x+=parseInt(elem.currentStyle.borderTopWidth);
141
+ x+=elem.offsetTop;
142
+ elem=elem.offsetParent;
143
+ }
144
+ oElem.calcTop=x;
145
+ return x;
146
+
147
+ }
148
+
149
+ var ah,ab;
150
+ function applyStyles() {
151
+ if(ab)
152
+ oDv.removeChild(dvBdy);
153
+ if (ah)
154
+ oDv.removeChild(dvHdr);
155
+ dvHdr=document.createElement("div");
156
+ dvBdy=document.createElement("div");
157
+ CBE.boCSSBDY?dvBdy.className=CBE.boCSSBDY:defBdyStyle();
158
+ CBE.boCSSHDR?dvHdr.className=CBE.boCSSHDR:defHdrStyle();
159
+ dvHdr.innerHTML=CBE.boHDR;
160
+ dvBdy.innerHTML=CBE.boBDY;
161
+ ah=false;
162
+ ab=false;
163
+ if (CBE.boHDR!='') {
164
+ oDv.appendChild(dvHdr);
165
+ ah=true;
166
+ }
167
+ if (CBE.boBDY!=''){
168
+ oDv.appendChild(dvBdy);
169
+ ab=true;
170
+ }
171
+ }
172
+
173
+ var CSE,iterElem,LSE,CBE,LBE, totalScrollLeft, totalScrollTop, width, height ;
174
+ var ini=false;
175
+
176
+ // Customised function for inner window dimension
177
+ function SHW() {
178
+ if (document.body && (document.body.clientWidth !=0)) {
179
+ width=document.body.clientWidth;
180
+ height=document.body.clientHeight;
181
+ }
182
+ if (document.documentElement && (document.documentElement.clientWidth!=0) && (document.body.clientWidth + 20 >= document.documentElement.clientWidth)) {
183
+ width=document.documentElement.clientWidth;
184
+ height=document.documentElement.clientHeight;
185
+ }
186
+ return [width,height];
187
+ }
188
+
189
+
190
+ var ID=null;
191
+ function moveMouse(e) {
192
+ //boxMove=true;
193
+ e?evt=e:evt=event;
194
+
195
+ CSE=evt.target?evt.target:evt.srcElement;
196
+
197
+ if (!CSE.hasbox) {
198
+ // Note we need to scan up DOM here, some elements like TR don't get triggered as srcElement
199
+ iElem=CSE;
200
+ while ((iElem.parentNode) && (!iElem.hasbox)) {
201
+ scanBO(iElem);
202
+ iElem=iElem.parentNode;
203
+ }
204
+ }
205
+
206
+ if ((CSE!=LSE)&&(!isChild(CSE,dvHdr))&&(!isChild(CSE,dvBdy))){
207
+ if (!CSE.boxItem) {
208
+ iterElem=CSE;
209
+ while ((iterElem.hasbox==2)&&(iterElem.parentNode))
210
+ iterElem=iterElem.parentNode;
211
+ CSE.boxItem=iterElem;
212
+ }
213
+ iterElem=CSE.boxItem;
214
+ if (CSE.boxItem&&(CSE.boxItem.hasbox==1)) {
215
+ LBE=CBE;
216
+ CBE=iterElem;
217
+ if (CBE!=LBE) {
218
+ applyStyles();
219
+ if (!CBE.requireclick)
220
+ if (CBE.fade) {
221
+ if (ID!=null)
222
+ clearTimeout(ID);
223
+ ID=setTimeout("fadeIn("+CBE.fadespeed+")",CBE.delay);
224
+ }
225
+ else {
226
+ if (ID!=null)
227
+ clearTimeout(ID);
228
+ COL=1;
229
+ ID=setTimeout("oDv.style.visibility='visible';ID=null;",CBE.delay);
230
+ }
231
+ if (CBE.IEbugfix) {hideSelects();}
232
+ fixposx=!isNaN(CBE.fixX)?Left(CBE)+CBE.fixX:CBE.absX;
233
+ fixposy=!isNaN(CBE.fixY)?Top(CBE)+CBE.fixY:CBE.absY;
234
+ lockX=0;
235
+ lockY=0;
236
+ boxMove=true;
237
+ ox=CBE.offX?CBE.offX:10;
238
+ oy=CBE.offY?CBE.offY:10;
239
+ }
240
+ }
241
+ else if (!isChild(CSE,dvHdr) && !isChild(CSE,dvBdy) && (boxMove)) {
242
+ // The conditional here fixes flickering between tables cells.
243
+ if ((!isChild(CBE,CSE)) || (CSE.tagName!='TABLE')) {
244
+ CBE=null;
245
+ if (ID!=null)
246
+ clearTimeout(ID);
247
+ fadeOut();
248
+ showSelects();
249
+ }
250
+ }
251
+ LSE=CSE;
252
+ }
253
+ else if (((isChild(CSE,dvHdr) || isChild(CSE,dvBdy))&&(boxMove))) {
254
+ totalScrollLeft=0;
255
+ totalScrollTop=0;
256
+
257
+ iterElem=CSE;
258
+ while(iterElem) {
259
+ if(!isNaN(parseInt(iterElem.scrollTop)))
260
+ totalScrollTop+=parseInt(iterElem.scrollTop);
261
+ if(!isNaN(parseInt(iterElem.scrollLeft)))
262
+ totalScrollLeft+=parseInt(iterElem.scrollLeft);
263
+ iterElem=iterElem.parentNode;
264
+ }
265
+ if (CBE!=null) {
266
+ boxLeft=Left(CBE)-totalScrollLeft;
267
+ boxRight=parseInt(Left(CBE)+CBE.offsetWidth)-totalScrollLeft;
268
+ boxTop=Top(CBE)-totalScrollTop;
269
+ boxBottom=parseInt(Top(CBE)+CBE.offsetHeight)-totalScrollTop;
270
+ doCheck();
271
+ }
272
+ }
273
+
274
+ if (boxMove&&CBE) {
275
+ // This added to alleviate bug in IE6 w.r.t DOCTYPE
276
+ bodyScrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;
277
+ bodyScrollLet=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;
278
+ mouseX=evt.pageX?evt.pageX-bodyScrollLet:evt.clientX-document.body.clientLeft;
279
+ mouseY=evt.pageY?evt.pageY-bodyScrollTop:evt.clientY-document.body.clientTop;
280
+ if ((CBE)&&(CBE.windowLock)) {
281
+ mouseY < -oy?lockY=-mouseY-oy:lockY=0;
282
+ mouseX < -ox?lockX=-mouseX-ox:lockX=0;
283
+ mouseY > (SHW()[1]-oDv.offsetHeight-oy)?lockY=-mouseY+SHW()[1]-oDv.offsetHeight-oy:lockY=lockY;
284
+ mouseX > (SHW()[0]-dvBdy.offsetWidth-ox)?lockX=-mouseX-ox+SHW()[0]-dvBdy.offsetWidth:lockX=lockX;
285
+ }
286
+ oDv.style.left=((fixposx)||(fixposx==0))?fixposx:bodyScrollLet+mouseX+ox+lockX+"px";
287
+ oDv.style.top=((fixposy)||(fixposy==0))?fixposy:bodyScrollTop+mouseY+oy+lockY+"px";
288
+
289
+ }
290
+ }
291
+
292
+ function doCheck() {
293
+ if ( (mouseX < boxLeft) || (mouseX >boxRight) || (mouseY < boxTop) || (mouseY > boxBottom)) {
294
+ if (!CBE.requireclick)
295
+ fadeOut();
296
+ if (CBE.IEbugfix) {showSelects();}
297
+ CBE=null;
298
+ }
299
+ }
300
+
301
+ function pauseBox(e) {
302
+ e?evt=e:evt=event;
303
+ boxMove=false;
304
+ evt.cancelBubble=true;
305
+ }
306
+
307
+ function showHideBox(e) {
308
+ oDv.style.visibility=(oDv.style.visibility!='visible')?'visible':'hidden';
309
+ }
310
+
311
+ function hideBox(e) {
312
+ oDv.style.visibility='hidden';
313
+ }
314
+
315
+ var COL=0;
316
+ var stopfade=false;
317
+ function fadeIn(fs) {
318
+ ID=null;
319
+ COL=0;
320
+ oDv.style.visibility='visible';
321
+ fadeIn2(fs);
322
+ }
323
+
324
+ function fadeIn2(fs) {
325
+ COL=COL+fs;
326
+ COL=(COL>1)?1:COL;
327
+ oDv.style.filter='alpha(opacity='+parseInt(100*COL)+')';
328
+ oDv.style.opacity=COL;
329
+ if (COL<1)
330
+ setTimeout("fadeIn2("+fs+")",20);
331
+ }
332
+
333
+
334
+ function fadeOut() {
335
+ oDv.style.visibility='hidden';
336
+
337
+ }
338
+
339
+ function isChild(s,d) {
340
+ while(s) {
341
+ if (s==d)
342
+ return true;
343
+ s=s.parentNode;
344
+ }
345
+ return false;
346
+ }
347
+
348
+ var cSrc;
349
+ function checkMove(e) {
350
+ e?evt=e:evt=event;
351
+ cSrc=evt.target?evt.target:evt.srcElement;
352
+ if ((!boxMove)&&(!isChild(cSrc,oDv))) {
353
+ fadeOut();
354
+ if (CBE&&CBE.IEbugfix) {showSelects();}
355
+ boxMove=true;
356
+ CBE=null;
357
+ }
358
+ }
359
+
360
+ function showSelects(){
361
+ var elements = document.getElementsByTagName("select");
362
+ for (i=0;i< elements.length;i++){
363
+ elements[i].style.visibility='visible';
364
+ }
365
+ }
366
+
367
+ function hideSelects(){
368
+ var elements = document.getElementsByTagName("select");
369
+ for (i=0;i< elements.length;i++){
370
+ elements[i].style.visibility='hidden';
371
+ }
372
+ }
js/lib/ccard.js ADDED
@@ -0,0 +1,28 @@
1
+ // Credit Card Validation Javascript
2
+ // copyright 12th May 2003, by Stephen Chapman, Felgall Pty Ltd
3
+
4
+ // You have permission to copy and use this javascript provided that
5
+ // the content of the script is not changed in any way.
6
+
7
+ function validateCreditCard(s) {
8
+ // remove non-numerics
9
+ var v = "0123456789";
10
+ var w = "";
11
+ for (i=0; i < s.length; i++) {
12
+ x = s.charAt(i);
13
+ if (v.indexOf(x,0) != -1)
14
+ w += x;
15
+ }
16
+ // validate number
17
+ j = w.length / 2;
18
+ k = Math.floor(j);
19
+ m = Math.ceil(j) - k;
20
+ c = 0;
21
+ for (i=0; i<k; i++) {
22
+ a = w.charAt(i*2+m) * 2;
23
+ c += a > 9 ? Math.floor(a/10 + a%10) : a;
24
+ }
25
+ for (i=0; i<k+m; i++) c += w.charAt(i*2+1-m) * 1;
26
+ return (c%10 == 0);
27
+ }
28
+
js/lib/dropdown.js ADDED
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Magento
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE_AFL.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magentocommerce.com so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
17
+ * versions in the future. If you wish to customize Magento for your
18
+ * needs please refer to http://www.magentocommerce.com for more information.
19
+ *
20
+ * @category Mage
21
+ * @package js
22
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
+ */
25
+ dropdown = function() {
26
+ var ele = document.getElementById("nav").getElementsByTagName("LI");
27
+ for (var i=0; i<ele.length; i++) {
28
+ ele[i].onmouseover=function() {
29
+ this.className+=" over";
30
+ }
31
+ ele[i].onmouseout=function() {
32
+ this.className=this.className.replace(new RegExp(" over\\b"), "");
33
+ }
34
+ }
35
+ }
36
+ if (window.attachEvent) window.attachEvent("onload", dropdown);
js/lib/ds-sleight.js ADDED
@@ -0,0 +1,38 @@
1
+ // Universal transparent-PNG enabler for MSIE/Win 5.5+
2
+ // http://dsandler.org
3
+ // From original code: http://www.youngpup.net/?request=/snippets/sleight.xml
4
+ // and background-image code: http://www.allinthehead.com/retro/69
5
+ // also:
6
+ // * use sizingMethod=crop to avoid scaling PNGs (who would do such a thing?)
7
+ // * only do this once, to make it compatible with CSS rollovers
8
+
9
+ if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
10
+ window.attachEvent("onload", enableAlphaImages);
11
+ }
12
+
13
+ function enableAlphaImages(){
14
+ var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
15
+ var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
16
+ if (itsAllGood) {
17
+ for (var i=0; i<document.all.length; i++){
18
+ var obj = document.all[i];
19
+ var bg = obj.currentStyle.backgroundImage;
20
+ var img = document.images[i];
21
+ if (bg && bg.match(/\.png/i) != null) {
22
+ var img = bg.substring(5,bg.length-2);
23
+ var offset = obj.style["background-position"];
24
+ obj.style.filter =
25
+ "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img+"', sizingMethod='crop')";
26
+ obj.style.backgroundImage = "url('"+BLANK_IMG+"')";
27
+ obj.style["background-position"] = offset; // reapply
28
+ } else if (img && img.src.match(/\.png#x2F;i) != null) {
29
+ var src = img.src;
30
+ img.style.width = img.width + "px";
31
+ img.style.height = img.height + "px";
32
+ img.style.filter =
33
+ "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='crop')"
34
+ img.src = BLANK_IMG;
35
+ }
36
+ }
37
+ }
38
+ }
js/lib/flex.js ADDED
@@ -0,0 +1,427 @@
1
+ /**
2
+ * Magento
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Academic Free License (AFL 3.0)
7
+ * that is bundled with this package in the file LICENSE_AFL.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/afl-3.0.php
10
+ * If you did not receive a copy of the license and are unable to
11
+ * obtain it through the world-wide-web, please send an email
12
+ * to license@magentocommerce.com so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
17
+ * versions in the future. If you wish to customize Magento for your
18
+ * needs please refer to http://www.magentocommerce.com for more information.
19
+ *
20
+ * @category Mage
21
+ * @package js
22
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
23
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
+ */
25
+
26
+ /**
27
+ * Flex maintance object
28
+ *
29
+ *
30
+ */
31
+ Flex = {};
32
+ Flex.currentID = 0;
33
+ Flex.uniqId = function() {
34
+ return 'flexMovieUID'+( ++Flex.currentID );
35
+ };
36
+
37
+ /**
38
+ * Check flash player version for required version
39
+ *
40
+ * @param Number major
41
+ * @param Number minor
42
+ * @param Number revision
43
+ * @return Boolean
44
+ */
45
+ Flex.checkFlashPlayerVersion = function(major, minor, revision) {
46
+ var version = Flex.getFlashPlayerVersion();
47
+
48
+ if (version === false) {
49
+ return false;
50
+ }
51
+
52
+ var requestedVersion = Flex.transformVersionToFloat([major, minor, revision], 5);
53
+ var currentVersion = Flex.transformVersionToFloat(version, 5);
54
+
55
+ return requestedVersion <= currentVersion;
56
+ };
57
+
58
+ /**
59
+ * Get flash player version in internet explorer
60
+ * by creating of test ActiveXObjects
61
+ *
62
+ * @return String|Boolean
63
+ */
64
+ Flex._getFlashPlayerVersionAsActiveX = function () {
65
+ var versions = [
66
+ {'default': '7.0.0', 'code':'ShockwaveFlash.ShockwaveFlash.7', 'variable':true},
67
+ {'default': '6.0.0', 'code':'ShockwaveFlash.ShockwaveFlash.6', 'variable':true, 'acceess':true},
68
+ {'default': '3.0.0', 'code':'ShockwaveFlash.ShockwaveFlash.3', 'variable':false},
69
+ {'default': '2.0.0', 'code':'ShockwaveFlash.ShockwaveFlash', 'variable':false},
70
+ ];
71
+
72
+ var detector = function (options) {
73
+ var activeXObject = new ActiveXObject(options.code);
74
+ if (options.access && options.variable) {
75
+ activeXObject.AllowScriptAccess = 'always';
76
+ }
77
+
78
+ if (options.variable) {
79
+ return activeXObject.GetVariable('$version');
80
+ }
81
+
82
+ return options['default'];
83
+ }
84
+
85
+ var version = false;
86
+
87
+ for (var i = 0, l = versions.length; i < l; i++) {
88
+ try {
89
+ version = detector(versions[i]);
90
+ return version;
91
+ } catch (e) {}
92
+ }
93
+
94
+ return false;
95
+ };
96
+
97
+ /**
98
+ * Transforms version string like 1.0.0 to array [1,0,0]
99
+ *
100
+ * @param String|Array version
101
+ * @return Array|Boolean
102
+ */
103
+ Flex.transformVersionToArray = function (version) {
104
+ if (!Object.isString(version)) {
105
+ return false;
106
+ }
107
+
108
+ var versions = version.match(/[\d]+/g);
109
+
110
+ if (versions.length > 3) {
111
+ return versions.slice(0,3);
112
+ } else if (versions.length) {
113
+ return versions;
114
+ }
115
+
116
+
117
+
118
+ return false;
119
+ };
120
+
121
+ /**
122
+ * Transforms version string like 1.1.1 to float 1.00010001
123
+ *
124
+ * @param String|Array version
125
+ * @param Number range - percition range between version digits
126
+ * @return Array
127
+ */
128
+ Flex.transformVersionToFloat = function (version, range) {
129
+ if (Object.isString(version)) {
130
+ version = Flex.transformVersionToArray(version)
131
+ }
132
+
133
+ if (Object.isArray(version)) {
134
+ var result = 0;
135
+ for (var i =0, l=version.length; i < l; i++) {
136
+ result += parseFloat(version[i]) / Math.pow(10, range*i);
137
+ }
138
+
139
+ return result;
140
+ }
141
+
142
+ return false;
143
+ };
144
+
145
+ /**
146
+ * Return flash player version as array of 0=major, 1=minor, 2=revision
147
+ *
148
+ * @return Array|Boolean
149
+ */
150
+ Flex.getFlashPlayerVersion = function () {
151
+ if (Flex.flashPlayerVersion) {
152
+ return Flex.flashPlayerVersion;
153
+ }
154
+
155
+ var version = false;
156
+ if (navigator.plugins != null && navigator.plugins.length > 0) {
157
+ if (navigator.mimeTypes && navigator.mimeTypes.length > 0) {
158
+ if (navigator.mimeTypes['application/x-shockwave-flash'] &&
159
+ !navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) {
160
+ return false;
161
+ }
162
+ }
163
+ var flashPlugin = navigator.plugins['Shockwave Flash'] || navigator.plugins['Shockwave Flash 2.0'];
164
+ version = Flex.transformVersionToArray(flashPlugin.description);
165
+ } else {
166
+ version = Flex.transformVersionToArray(Flex._getFlashPlayerVersionAsActiveX());
167
+ }
168
+
169
+ Flex.flashPlayerVersion = version;
170
+ return version;
171
+ };
172
+
173
+ Flex.Object = Class.create({
174
+ /**
175
+ * Initialize object from configuration, where configuration keys,
176
+ * is set of tag attributes for object or embed
177
+ *
178
+ * @example
179
+ * new Flex.Object({'src':'path/to/flashmovie.swf'});
180
+ *
181
+ * @param Object config
182
+ * @return void
183
+ */
184
+ initialize: function (config) {
185
+ this.isIE = Prototype.Browser.IE;
186
+ this.isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
187
+ this.attributes = {
188
+ quality:"high",
189
+ pluginspage: "http://www.adobe.com/go/getflashplayer",
190
+ type: "application/x-shockwave-flash",
191
+ allowScriptAccess: "always",
192
+ classid: "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
193
+ };
194
+ this.bridgeName = '';
195
+ this.bridge = false;
196
+ this.setAttributes( config );
197
+ this.applied = false;
198
+
199
+ var myTemplatesPattern = /(^|.|\r|\n)(\{(.*?)\})/;
200
+ if(this.detectFlashVersion(9, 0, 28)) {
201
+ if(this.isIE) {
202
+ this.template = new Template( '<object {objectAttributes}><param name="allowFullScreen" value="true"/>{objectParameters}</object>', myTemplatesPattern )
203
+ } else {
204
+ this.template = new Template( '<embed {embedAttributes} allowfullscreen="true" />', myTemplatesPattern );
205
+ }
206
+ } else {
207
+ this.template = new Template( 'This content requires the Adobe Flash Player. '
208
+ +' <a href=http://www.adobe.com/go/getflash/>Get Flash</a>', myTemplatesPattern );
209
+ }
210
+
211
+ this.parametersTemplate = new Template( '<param name="{name}" value="{value}" />', myTemplatesPattern );
212
+ this.attributesTemplate = new Template( ' {name}="{value}" ', myTemplatesPattern );
213
+ },
214
+ /**
215
+ * Set object attribute for generation of html tags
216
+ *
217
+ * @param Sting name
218
+ * @param Object value
219
+ * @return void
220
+ */
221
+ setAttribute : function( name, value ) {
222
+ if(!this.applied) {
223
+ this.attributes[name] = value;
224
+ }
225
+ },
226
+ /**
227
+ * Retrive object attribute value used for generation in html tags
228
+ *
229
+ * @param Sting name
230
+ * @return Object
231
+ */
232
+ getAttribute : function( name ) {
233
+ return this.attributes[name];
234
+ },
235
+ /**
236
+ * Set object attributes in one call
237
+ *
238
+ * @param Object attributesList
239
+ * @return void
240
+ */
241
+ setAttributes : function( attributesList ) {
242
+ $H(attributesList).each(function(pair){
243
+ this.setAttribute(pair.key, pair.value);
244
+ }.bind(this));
245
+ },
246
+ /**
247
+ * Retrieve all object attributes
248
+ *
249
+ * @return Object
250
+ */
251
+ getAttributes : function( ) {
252
+ return this.attributes;
253
+ },
254
+ /**
255
+ * Applies generated HTML content to specified HTML tag
256
+ *
257
+ * @param String|DOMELement container
258
+ * @return void
259
+ */
260
+ apply : function(container) {
261
+ if (!this.applied) {
262
+ this.setAttribute("id", Flex.uniqId());
263
+ this.preInitBridge();
264
+ var readyHTML = this.template.evaluate(this.generateTemplateValues());
265
+ $(container).update(readyHTML);
266
+ }
267
+ this.applied = true;
268
+ },
269
+ /**
270
+ * Applies generated HTML content to window.document
271
+ *
272
+ * @return void
273
+ */
274
+ applyWrite : function( ) {
275
+ if (!this.applied) {
276
+ this.setAttribute( "id", Flex.uniqId());
277
+ this.preInitBridge();
278
+ var readyHTML = this.template.evaluate( this.generateTemplateValues() );
279
+ document.write( readyHTML );
280
+ }
281
+ this.applied = true;
282
+ },
283
+ /**
284
+ * Preinitialize FABridge values
285
+ *
286
+ * @return void
287
+ */
288
+ preInitBridge: function () {
289
+ this.bridgeName = this.getAttribute('id') + 'bridge';
290
+ var flashVars = this.getAttribute('flashVars') || this.getAttribute('flashvars') || '';
291
+ if (flashVars != '') {
292
+ flashVars += '&';
293
+ }
294
+ flashVars += 'bridgeName=' + this.bridgeName;
295
+ this.setAttribute('flashVars', flashVars);
296
+ var scopeObj = this;
297
+ FABridge.addInitializationCallback(
298
+ this.bridgeName,
299
+ function () {
300
+ scopeObj.bridge = this.root();
301
+ scopeObj.initBridge();
302
+ }
303
+ );
304
+ },
305
+ /**
306
+ * Initialize bridge callback passed to FABridge,
307
+ * calls internal callback if it's presented
308
+ *
309
+ * @return void
310
+ */
311
+ initBridge: function() {
312
+ if(this.onBridgeInit) {
313
+ this.onBridgeInit(this.getBridge());
314
+ }
315
+ },
316
+ /**
317
+ * Retrieve FABridge instance for this object
318
+ *
319
+ * @return Object
320
+ */
321
+ getBridge : function() {
322
+ return this.bridge;
323
+ },
324
+ /**
325
+ * Generate temaplate values object for creation of flash player plugin movie HTML
326
+ *
327
+ * @return Object
328
+ */
329
+ generateTemplateValues : function() {
330
+ var attributesMap = {
331
+ embed: {
332
+ 'movie':'src',
333
+ 'id':'name',
334
+ 'flashvars': 'flashVars',
335
+ 'classid':false,
336
+ 'codebase':false
337
+ },
338
+ object: {
339
+ 'pluginspage':false,
340
+ 'src':'movie',
341
+ 'flashvars': 'flashVars',
342
+ 'type':false,
343
+ 'inline': [
344
+ 'type', 'classid', 'codebase', 'id', 'width', 'height',
345
+ 'align', 'vspace', 'hspace', 'class', 'title', 'accesskey', 'name',
346
+ 'tabindex'
347
+ ]
348
+ }
349
+ };
350
+ var embedAttributes = {};
351
+ var objectAttributes = {};
352
+ var parameters = {};
353
+ $H(this.attributes).each(function(pair) {
354
+ var attributeName = pair.key.toLowerCase();
355
+ this.attributes[pair.key] = this.escapeAttributes(pair.value);
356
+
357
+ // Retrieve mapped attribute names
358
+ var attributeNameInObject = (attributesMap.object[attributeName] ? attributesMap.object[attributeName] : attributeName);
359
+ var attributeNameInEmbed = (attributesMap.embed[attributeName] ? attributesMap.embed[attributeName] : attributeName);
360
+
361
+ if (attributesMap.object[attributeName] !== false) {
362
+ if (attributesMap.object.inline.indexOf(attributeNameInObject) !== -1) { // If it included in default object attribute
363
+ objectAttributes[attributeNameInObject] = this.attributes[pair.key];
364
+ } else { // otherwise add it to parameters tag list
365
+ parameters[attributeNameInObject] = this.attributes[pair.key];
366
+ }
367
+ }
368
+
369
+ if (attributesMap.embed[attributeName] !== false) { // If this attribute not ignored for flash in Gecko Browsers
370
+ embedAttributes[attributeNameInEmbed] = this.attributes[pair.key];
371
+ }
372
+ }.bind(this));
373
+
374
+ var result = {
375
+ objectAttributes: '',
376
+ objectParameters: '',
377
+ embedAttributes : ''
378
+ };
379
+
380
+
381
+ $H(objectAttributes).each(function(pair){
382
+ result.objectAttributes += this.attributesTemplate.evaluate({
383
+ name:pair.key,
384
+ value:pair.value
385
+ });
386
+ }.bind(this));
387
+
388
+ $H(embedAttributes).each(function(pair){
389
+ result.embedAttributes += this.attributesTemplate.evaluate({
390
+ name:pair.key,
391
+ value:pair.value
392
+ });
393
+ }.bind(this));
394
+
395
+ $H(parameters).each(function(pair){
396
+ result.objectParameters += this.parametersTemplate.evaluate({
397
+ name:pair.key,
398
+ value:pair.value
399
+ });
400
+ }.bind(this));