1 function $(id) { return document.getElementById(id); }
3 function getStyle(x,IEstyleProp, MozStyleProp)
6 var y = x.currentStyle[IEstyleProp];
7 } else if (window.getComputedStyle) {
8 var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(MozStyleProp);
13 /* replacement of setInterval on IE */
15 /*if not IE, do nothing*/
16 if(!document.uniqueID){return;};
18 /*Copy the default setInterval behavior*/
19 var nativeSetInterval = window.setInterval;
20 window.setInterval = function(fn,ms) {
22 if(arguments.length <= 2) {
23 return nativeSetInterval(fn,ms);
26 for(var i=2;i<arguments.length;i+=1) {
27 param[i-2] = arguments[i];
31 if(typeof(fn)=='function') {
33 return (function (fn,ms,param) {
34 var fo = function () {
35 fn.apply(window,param);
37 return nativeSetInterval(fo,ms);
40 else if(typeof(fn)=='string')
42 return nativeSetInterval(fn,ms);
46 throw Error('setInterval Error\nInvalid function type');
50 /*Copy the default setTimeout behavior*/
51 var nativeSetTimeout = window.setTimeout;
52 window.setTimeout = function(fn,ms) {
54 if(arguments.length <= 2) {
55 return nativeSetTimeout(fn,ms);
58 for(var i=2;i<arguments.length;i+=1) {
59 param[i-2] = arguments[i];
63 if(typeof(fn)=='function') {
65 return (function (fn,ms,param) {
66 var fo = function () {
67 fn.apply(window,param);
69 return nativeSetTimeout(fo,ms);
72 else if(typeof(fn)=='string')
74 return nativeSetTimeout(fn,ms);
78 throw Error('setTimeout Error\nInvalid function type');
84 function getStyle(x,IEstyleProp, MozStyleProp)
87 var y = x.currentStyle[IEstyleProp];
88 } else if (window.getComputedStyle) {
89 var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(MozStyleProp);
94 function doSomething(e) {
95 if (!e) var e = window.event
97 e.cancelBubble = true;
98 if (e.stopPropagation) e.stopPropagation();