1 function $(id) { return document.getElementById(id); }
3 /* replacement of setInterval on IE */
5 /*if not IE, do nothing*/
6 if(!document.uniqueID){return;};
8 /*Copy the default setInterval behavior*/
9 var nativeSetInterval = window.setInterval;
10 window.setInterval = function(fn,ms) {
12 if(arguments.length <= 2) {
13 return nativeSetInterval(fn,ms);
16 for(var i=2;i<arguments.length;i+=1) {
17 param[i-2] = arguments[i];
21 if(typeof(fn)=='function') {
23 return (function (fn,ms,param) {
24 var fo = function () {
25 fn.apply(window,param);
27 return nativeSetInterval(fo,ms);
30 else if(typeof(fn)=='string')
32 return nativeSetInterval(fn,ms);
36 throw Error('setInterval Error\nInvalid function type');
40 /*Copy the default setTimeout behavior*/
41 var nativeSetTimeout = window.setTimeout;
42 window.setTimeout = function(fn,ms) {
44 if(arguments.length <= 2) {
45 return nativeSetTimeout(fn,ms);
48 for(var i=2;i<arguments.length;i+=1) {
49 param[i-2] = arguments[i];
53 if(typeof(fn)=='function') {
55 return (function (fn,ms,param) {
56 var fo = function () {
57 fn.apply(window,param);
59 return nativeSetTimeout(fo,ms);
62 else if(typeof(fn)=='string')
64 return nativeSetTimeout(fn,ms);
68 throw Error('setTimeout Error\nInvalid function type');
74 function getStyle(x,IEstyleProp, MozStyleProp)
77 var y = x.currentStyle[IEstyleProp];
78 } else if (window.getComputedStyle) {
79 var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(MozStyleProp);
84 function doSomething(e) {
85 if (!e) var e = window.event
87 e.cancelBubble = true;
88 if (e.stopPropagation) e.stopPropagation();