var Browser = {
	'isIE' : (navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0),
	'isFirefox' : navigator.userAgent.indexOf('Firefox') >= 0,
	'isOpera' : navigator.userAgent.indexOf('Opera') >= 0
};
Object.extend =  function() {
	var target = arguments[0] || {},
	i = 1, length = arguments.length, deep = false, options;
	if (target.constructor == Boolean) {
		deep = target;
		target = arguments[1] || {};
		i = 2;
	}
	if (typeof target != "object" && typeof target != "function")
		target = {};

	if (length == i) {
		target = this;
		--i;
	}
	for (;i < length; i++)
		if ((options = arguments[i]) != null)
			for (var name in options) {
				var src = target[name], copy = options[name];
				if (target === copy)// 防止死循环
					continue;
				if (deep && copy && typeof copy == "object" && !copy.nodeType){
					target[name] = Object.extend(deep, src
							|| (copy.length != null ? [] : {}), copy);
				}
				else if (copy !== undefined){
					target[name] = copy;
				}
			}
	return target;
};
function $(d){
	return document.getElementById(d);
}
var eltUtil={
	getByTN:function(tagName,dom){
		if(dom)return dom.getElementsByTagName("tagName");
		else return document.getElementsByTagName("tagName");
	},
	getElementsByClassName:function (className, parentElement){
		var elems = (parentElement||document.body).getElementsByTagName("*");
		var result=[];
		for (i=0; j=elems[i]; i++){
			if ((" "+j.className+" ").indexOf(" "+className+" ")!=-1){
				result.push(j);
			}
		}
		return result;
	},
	getX : function(obj){
		return obj.offsetLeft + (obj.offsetParent ? this.getX(obj.offsetParent) : obj.x ? obj.x : 0);
	},
	getY : function(obj){
		return (obj.offsetParent ? obj.offsetTop +this. getY(obj.offsetParent) : obj.y ? obj.y : 0);
	},
	setClass:function(mydom,s){
		Browser.isIE?mydom.setAttribute("className",s):mydom.setAttribute("class",s);
	},
	fideIn:function(o){//dom,num,maxh
		o.dom.style.opacity = (o.num/o.maxh);
		o.dom.style.filter= 'alpha(opacity='+(o.num*100/o.maxh)+');';
	}
}; 
var winUtil={
	setHash:function(str){
		window.location.hash="#"+str;
	},
	cnlHash:function(){
		var tfwCids=location.hash.substring(1).split("#");
		return tfwCids;		
	}
};