coz.get = dojo.byId;
coz.addOnLoad = dojo.addOnLoad;
coz.forEach = dojo.lang.forEach;
coz.mixin = dojo.mixin;
coz.extend = function(superclass,props) {
	return dojo.mixin(dojo.mixin({},superclass),props);
};
coz.getStyle = function(node,style) {
	return dojo.html.getComputedStyle(node,style).replace(/px$/,"");
};
coz.getClasses = dojo.html.getClasses;
coz.addClass = dojo.html.addClass;
coz.removeClass = dojo.html.removeClass;
coz.setStyles = function(node, styles) {
	for (style in styles) {
		dojo.html.setStyle(node,style,styles[style]);
	}
};
coz.position = function(node) {
	return dojo.html.abs(node,true,"border-box");
};
coz.size = function(node) {
	var size = {width:node.offsetWidth,height:node.offsetHeight};
	if (size.width == 0) {
		var clone = node.cloneNode(true);
			clone.style.position = "absolute";
			clone.style.left = "0px";
			clone.style.top = "0px";
		dojo.body().appendChild(clone);
		size = {width:clone.offsetWidth,height:clone.offsetHeight};
		dojo.dom.destroyNode(clone);
	}
	return size;
};

coz.query = function(queries,root,callback) {
	if (!root) {
		root = "";
	} else if (dojo.lang.isFunction(root)) {
		callback = root;
		root = "";
	} else if (root.id) {
		root = "#"+root.id+" ";
	}
	dojo.lang.forEach(queries.split(","), function(query) {
		if (!query) return;
		dojo.lang.forEach(dojo.query(root+query), function(element) {
			if (!element) return;
			callback(element);
		});
	});
};

coz.event = function(e,handler) {
	var hStr = handler.toString();
	var eName = hStr.substring(hStr.indexOf("(")+1,hStr.indexOf(")"));
	return eval(hStr.replace(/{/," "+eName+" = dojo.event.browser.fixEvent(e);"));
};

coz = coz.mixin(coz,dojo.render.html);

coz.addOnLoad(coz.init);
