function $Childs(context, tagName){
    var child = context.firstChild, result = [];
    tagName = tagName.toUpperCase();
    while (child) {
        if (child.tagName === tagName) {
            result.push(child);
        }
        child = child.nextSibling;
    }
    return result;
}

(function() {
  
var tabSwitchList = [];
		  
if ("undefined" === typeof NTES) {
	window.$ = function(id) { return document.getElementById(id.substr(1)); };
	window.TabSwitch = function() { tabSwitchList.push(Array.prototype.slice.call(arguments)); };
	var script = document.createElement("script");
	script.language = "javascript"; script.type = "text/javascript";	
	script.charset = "gb2312";
	script.onload = script.onreadystatechange = function() {
		var t = this;
		if (!t.readyState || "loaded" == t.readyState || "complete" == t.readyState) {
			for (var i = tabSwitchList.length - 1, tab; i >= 0; i--) {
				tab = tabSwitchList[i];
				new NTES.ui.Slide(tab[0], tab[1], tab[2], tab[3], tab[4]);
			}
			window.TabSwitch = NTES.ui.Slide;
			t.parentNode.removeChild(t);
			t.onload = t.onreadystatechange = null;
		}
	};
	
	script.src = "http://img1.cache.netease.com/cnews/js/ntes_jslib_1.x.js";
	document.getElementsByTagName("head")[0].appendChild(script);
} else {
	window.TabSwitch = NTES.ui.Slide;
}

})();