X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fcommons.js;h=83208454ce607ca51e468a476ab927308153e4a2;hb=fac6fe420fc3df52ffda867b946b2d25a5e1374d;hp=5079a8b9f0c9859b622966f34e26b3183db310ad;hpb=6509e1f0cbd966ed218626908b69796ded418fb6;p=brisk.git diff --git a/web/commons.js b/web/commons.js index 5079a8b..8320845 100644 --- a/web/commons.js +++ b/web/commons.js @@ -21,9 +21,20 @@ */ var PLAYERS_N = 3; +var EXIT_BAN_TIME = 900; function $(id) { return document.getElementById(id); } +function getStyle(x,IEstyleProp, MozStyleProp) +{ + if (x.currentStyle) { + var y = x.currentStyle[IEstyleProp]; + } else if (window.getComputedStyle) { + var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(MozStyleProp); + } + return y; +} + /* replacement of setInterval on IE */ (function(){ /*if not IE, do nothing*/ @@ -60,6 +71,39 @@ function $(id) { return document.getElementById(id); } throw Error('setInterval Error\nInvalid function type'); }; }; + + /*Copy the default setTimeout behavior*/ + var nativeSetTimeout = window.setTimeout; + window.setTimeout = function(fn,ms) { + var param = []; + if(arguments.length <= 2) { + return nativeSetTimeout(fn,ms); + } + else { + for(var i=2;i' + +'' + +'' + +''; + } }