/*
* noVNC: HTML5 VNC client
* Copyright (C) 2012 Joel Martin
* Licensed under MPL 2.0 (see LICENSE.txt)
*
* See README.md for usage and integration instructions.
*/
// IE does not support map (even in IE9)
//This prototype is provided by the Mozilla foundation and
//is distributed under the MIT license.
//http://www.ibiblio.org/pub/Linux/LICENSES/mit.license
// IE <9 does not support indexOf
//This prototype is provided by the Mozilla foundation and
//is distributed under the MIT license.
//http://www.ibiblio.org/pub/Linux/LICENSES/mit.license
// PhantomJS 1.x doesn't support bind,
// so leave this in until PhantomJS 2.0 is released
//This prototype is provided by the Mozilla foundation and
//is distributed under the MIT license.
//http://www.ibiblio.org/pub/Linux/LICENSES/mit.license
var Util={},addFunc=function(t,e,n){t.prototype[e]||Object.defineProperty(t.prototype,e,{enumerable:!1,value:n})};addFunc(Array,"push8",function(t){"use strict";this.push(255&t)}),addFunc(Array,"push16",function(t){"use strict";this.push(t>>8&255,255&t)}),addFunc(Array,"push32",function(t){"use strict";this.push(t>>24&255,t>>16&255,t>>8&255,255&t)}),addFunc(Array,"map",function(t){"use strict";var e=this.length;if("function"!=typeof t)throw new TypeError;for(var n=new Array(e),r=arguments[1],o=0;o>>0,n=Number(arguments[1])||0;for(n=n<0?Math.ceil(n):Math.floor(n),n<0&&(n+=e);n0&&("loaded"===r[0].readyState||"complete"===r[0].readyState);){var e=r.shift();n.appendChild(e)}(!this.readyState||Util.Engine.presto&&"loaded"===this.readyState||"complete"===this.readyState)&&o.indexOf(this)>=0&&(this.onload=this.onreadystatechange=null,o.splice(o.indexOf(this),1),0===o.length&&window.onscriptsload&&window.onscriptsload())},s=0;s