var huukee={
	Sort:function(){
		var o = document.getElementById("Sort");
		var l = document.getElementById("SortList");
		o.onmouseover = function() {
			l.style.cssText="display:block;";
		};
		o.onmouseout = function() {
			l.style.cssText="display:none;";
		}
	},
	SetFontSize:function(size){
		var o=document.getElementById("neirong");
		var p=o.getElementsByTagName("p");
		o.style.cssText = "font-size:"+size+"px";		
		for(var i=0;i<p.length;i++){
			p[i].style.cssText = "font-size:"+size+"px";
		}
	},
	copyToClipBoard:function(){
		var clipBoardContent="";
		var titleStr = window.document.title.split("-")[0];
		clipBoardContent+=titleStr;
		clipBoardContent+='\r\n'+window.location.href;
		window.clipboardData.setData("Text",clipBoardContent);
		alert("成功复制标题及链接,现在可以粘贴发给好友了!");
	},
	addEvent: function(o, a, b) {
        o.attachEvent ? o.attachEvent('on' + a, function() { b.call(o); }) : o.addEventListener(a, b, false);
    },
    cookie: {
        set: function(name, value) {
            var exp = new Date();
            exp.setTime(exp.getTime() + 864500000);
            document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + "; path=/";
        },
        get: function(name) {
            var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
            if (arr != null) return unescape(arr[2]); return null;
        },
        del: function(name) {
            var exp = new Date();
            exp.setTime(exp.getTime() - 1);
            document.cookie = name + "=;expires=" + exp.toGMTString() + "; path=/";
        }
    },
    language: function() {
        var o = document.getElementById('languageType');
        var lg = huukee.cookie.get('languageType');
        if (lg == null || lg == 'Traditional') {
            o.innerHTML = '繁体中文';
            o.title = '以繁体中文显示';
            if (lg == 'Traditional') {
                Translate.State = false;
                Translate.Recursive();
            }
        } else {
            o.innerHTML = '简体中文';
            o.title = '以简体中文显示';
            Translate.State = true;
            Translate.Recursive();
        }
        o.onclick = function() {
            var g = huukee.cookie.get('languageType');
            if (g == null || g == 'Traditional') {
                o.innerHTML = '简体中文';
                o.title = '以简体中文显示';
                Translate.State = true;
                Translate.Recursive();
                huukee.cookie.set('languageType', 'Simplified');
            } else {
                o.innerHTML = '繁体中文';
                o.title = '以繁体中文显示';

                Translate.State = false;
                Translate.Recursive();
                huukee.cookie.set('languageType', 'Traditional');
            }
        }
    }
}
huukee.addEvent(window, "load", huukee.Sort);
huukee.addEvent(window, "load", huukee.language);
