(function(){
var global = (function(){return this;})();
//Image Loader
global.loadImage = function(src,onload){
var img = new Image();
img.src = src;
img.onload = onload;
return img;
};
//DOM Object
global.DOM = function(element){
var elem = element;
var obj = {};
obj.attr = function(src){
DOM.prototype.attr(elem,src);
return obj;
};
obj.css = function(src){
DOM.prototype.css(elem,src);
return obj;
};
obj.event = function(src){
DOM.prototype.event(elem,src);
return obj;
};
return obj;
};
//Set Attributes
DOM.prototype.attr = function(elem,src){
if(src==null){src={}}
for(var i in src){
elem.setAttribute(i,src[i]);
}
}
//Set CSS
DOM.prototype.css = function(elem,src){
if(src==null){src={}}
for(var i in src){
if(typeof elem.style.setProperty != "undefined"){
elem.style.setProperty(i,src[i],null);
} else {
elem.style.setAttribute(i,src[i]);
}
}
}
//Event Attach
DOM.prototype.event = function(elem,src){
if(src==null){src={}}
for(var i in src){
if(elem.addEventListener) {
elem.addEventListener(i, src[i], false);
} else
if(elem.attachEvent) {
elem.attachEvent('on' + i, function(e){func.call(src[i], e);});
}
}
}
})();