function $$(){
	var elem = null;
	if(typeof arguments[0] !="string"){
		if(!arguments[0]){return null;}
		elem = arguments[0];
		if(!elem["version"]){
			$$._Method.Element.apply(elem);
			if($$._appendMethod){
				$$._appendMethod.apply(elem);
			}
		}
		return elem;
	}
	if(arguments[0].trim().substr(0,1)=='<')
	{
		var tmp = document.createElement('div');
		tmp.innerHTML = arguments[0];
		$$._Method.Element.apply(tmp.firstChild);
			if($$._appendMethod){
				$$._appendMethod.apply(tmp.firstChild);
			}
		return tmp.firstChild;
	}
	var argID = arguments[0].trim();
	if(argID.indexOf(" ")==-1 && argID.indexOf(",")==-1 && argID.indexOf(".")==-1 && argID.indexOf("[")==-1 && argID.indexOf(">")==-1){
		elem = document.getElementById(argID.replace("#","")); 
		if(!elem){return null;}
		if(!elem["version"]){
			$$._Method.Element.apply(elem);
			if($$._appendMethod){
				$$._appendMethod.apply(elem);
			}
		}
		return elem;
	}
	var path = argID.replace(/(^,*)|(,*$$)/g,"").split(","); 
	var allelem = [];
	for(var a=0,b; b=path[a]; a++){
		var p = b=path[a].trim().replace(/ +/g," ").split(" ");
		for (var i=0,q; q=p[i]; i++){
			if (q.indexOf("#")==0){
				if(!document.getElementById(q.substring(1)))return null;
				elem = $$(q.substring(1));
				continue;
			}
			var attsel = [];
			var elem_temp=[];
			if (q.indexOf(".")!=-1){
				var tags = q.replace(/\[.*?\]/gi,function($$1){attsel.push($$1.replace(/\[|\]/g,""));return "";});
				var tag = tags.split(".")[0];
				var cn = tags.split(".")[1];
				if (elem == null){
					elem_temp = $$._find(tag,cn,arguments[1] || document);
				}else{
					if (elem instanceof Array){
						var arr = [];
						elem.each(function(obj){$$._find(tag,cn,obj).each(function(){arr.push(arguments[0])});});
						elem_temp = arr;
					}else{
						elem_temp = $$._find(tag,cn,elem);
					}
				}
				elem = $$._attributeSelector(attsel,elem_temp);
				
				continue;
			}else{
				var tag = q.replace(/\[.*?\]/gi,function($$1){attsel.push($$1.replace(/\[|\]/g,""));return "";});
				if(elem == null){
					elem_temp = $$A((arguments[1] || document).getElementsByTagName(tag)).each(function(obj){$$(obj)});
				}else{
					if (elem instanceof Array){
						var arr = [];
						elem.each(function(obj){$$A(obj.getElementsByTagName(tag)).each(function(obj){arr.push($$(obj))})});
						elem_temp = arr;
					}else{
						elem_temp = $$A(elem.getElementsByTagName(tag)).each(function(obj){$$(obj)});
					}
				}
				elem = $$._attributeSelector(attsel,elem_temp);
			}
		}
		if(elem.constructor==Array){
			elem.each(function(obj){allelem.push(obj)});
		}else{
			allelem.push(elem);
		}
		elem = null;
	}
	return allelem;
};
$$.Version = "0.2.1.5";
$$._find = function(tag,cn,par){
	var arr = par.getElementsByTagName(tag||"*");
	var elem = [];
	for(var i=0,j; j=arr[i]; i++){
		if(j.className.hasSubString(cn," ")){elem.push($$(j));}
	}
	return elem;
};
$$._attributeSelector = function(attsel,elem_temp){
	for (var j=0; j<attsel.length; j++){
		var elemArr = [];
		var k=attsel[j].split(/=|!=/g);
		if(k.length==1){
			elem_temp.each(function(n){
				if(n.getAttribute(k[0].trim())){
					elemArr.push(n);
				}
			});
		}else if(k.length>1){
			elem_temp.each(function(n){
				if(attsel[j].indexOf("!=")!=-1){
					if(n.getAttribute(k[0].trim())!=k[1].trim()){
						elemArr.push(n);
					}
				}else{
					if(k[1].indexOf("*")!=-1){
							var patrn="/^"+k[1].split("*")[0]+"[a-zA-Z0-9]+"+k[1].split("*")[1]+"$/"; 
							if(eval(patrn).exec(n.getAttribute(k[0].trim()))!=null)
							{
								elemArr.push(n);
							}
					}else if(n.getAttribute(k[0].trim())==k[1].trim()){
						elemArr.push(n);
					}
				}
			});						
		}						
		elem_temp.length = 0;
		elem_temp = elemArr;
	}
	return elem_temp; 
};
function NameSpace(){};
function StringBuffer(){this.data = []};
$$._Method = {
	Element	: function(){
		this.version = $$.Version;
		this.hide = function(){this.style.display="none"; return this};
		this.show = function(){this.style.display="block"; return this};
		this.getStyle = function(s){
			var value = this.style[s=="float"?($$.Browse.isIE()?"styleFloat":"cssFloat"):s.camelize()];
			if (!value){
				if (this.currentStyle){
					value = this.currentStyle[s.camelize()];
				}else if (document.defaultView && document.defaultView.getComputedStyle){
					var css = document.defaultView.getComputedStyle(this, null);
					value = css ? css.getPropertyValue(s) : null;
				}
			}
			return value;
		};
		this.setStyle = function(s){
			var sList = s.split(";");
			for (var i=0,j; j=sList[i]; i++){
				var k = j.split(/:(?!\/\/)/g);
				var key = k[0].trim();
				key=key=="float"?($$.Browse.isIE()?"styleFloat":"cssFloat"):key.camelize();
				this.style[key] = k[1].trim();
			}
			return this;
		};
		this.toggle = function(){this.getStyle("display")=="none"?this.show():this.hide(); return this};
		this.hasClassName = function(c){return this.className.hasSubString(c," ");};
		this.addClassName = function(c){if(!this.hasClassName(c)){this.className+=" "+c};return this};
		this.removeClassName = function(c){if(this.hasClassName(c)){this.className = (" "+this.className+" ").replace(" "+c+" "," ").trim(); return this}};
		this.toggleClassName = function(c){if(this.hasClassName(c)){this.removeClassName(c);}else{this.addClassName(c);};return this;};
		this.getElementsByClassName = function(c){return this.getElementsByAttribute("className",c)};
		this.getElementsByAttribute = function(n,v){
			var elems = this.getElementsByTagName("*");
			var elemList = [];
			for (var i=0,j; j=elems[i]; i++){
				var att = j[n] || j.getAttribute(n);
				if (att==v){
					elemList.push(j);
				}
			}
			return elemList;
		};
		this.subTag = function(){return $$A(this.getElementsByTagName(arguments[0])).each(function(n){$$(n);});};
		this.parentIndex = function(p){
			if (this==p){return 0}			
			for (var i=1,n=this; n=n.parentNode; i++){
				if(n==p){return i;}
				if(n==document.documentElement) return -1;
			}
		};
		this.remove = function(){
			if(!this||!window.recycler)return;
			window.recycler.appendChild(this);
			window.recycler.innerHTML="";
		};
		this.nextElement = function(){
			var n = this;
			for (var i=0,n; n = n.nextSibling; i++){
				if(n.nodeType==1) return $$(n);
			}
			return null;
		};
		this.previousElement = function(){
			var n = this;
			for (var i=0,n; n = n.previousSibling; i++){
				if(n.nodeType==1) return $$(n);
			}
			return null;
		};
		this.subElem = function(css){
			return $$(css,this);
		};
		this.findParent = function(p){
			for(var i=0,n=this; n=n.parentNode; i++){
				if(n==document.documentElement || n==document.body) break;
				var t = 0;
				for(var key in p){
					var m = n.key || n[key] || n.getAttribute(key);
					if(m!=p[key]){t++;break;}
				}
				if(t==0) return n;
			}
			return null;
		};
		this.getElementWidth= function()
		{
			var n=this;
			return $$(n).offsetWidth;
		};
		this.getElementHeight= function()
		{
			var n=this;
			return $$(n).offsetHeight;
		};
		this.getElementLeft= function(e)
		{
			return ($$(e)==null) ? 0 :($$(e).offsetLeft + $$(e).getElementLeft($$(e).offsetParent));
		};	
		this.getElementTop= function(e)
		{
			return ($$(e)==null) ? 0 :($$(e).offsetTop + $$(e).getElementTop($$(e).offsetParent));
		};
		this.getElementRight= function(e)
		{
			return $$(e).getElementLeft(e) + $$(e).getElementWidth();
		};
		this.getElementBottom= function(e)
		{
			return $$(e).getElementTop(e) + $$(e).getElementHeight();
		};
		this.getElement= function(e)
		{
			return {
				width : $$(e).getElementWidth(),
				height: $$(e).getElementHeight(),
				left  : $$(e).getElementLeft(e),
				top   : $$(e).getElementTop(e),
				right : $$(e).getElementRight(e),
				bottom: $$(e).getElementBottom(e)
			};
		};
	},
	Array :	function(){
		this.indexOf = function(){
			for (i=0; i<this.length; i++){
				if (this[i]==arguments[0])
					return i;
			}
			return -1;
 	    };
		this.each = function(fn){
			for (var i=0,len=this.length; i<len; i++){
				fn(this[i],i);
			}
			return this;
		};
		this.sortByValue = function(t){
			for (var i=this.length; i>0; i>>=1){
				for(var j=0; j<i; j++){
					for (var x = i+j; x<this.length; x=x+i){
						var v = this[x];
						var y = x;
						while( y>=i && t?this[y-1]<v:this[y-i]>v){
							this[y] = this[y-i];
							y = y-i;
						}
						this[y] = v;
					}
				}		
			}
			return this;
		};
	},
	String : function(){
		this.trim = function(){
			var _argument = arguments[0]==undefined ? " ":arguments[0];
			if(typeof(_argument)=="string"){
				return this.replace(_argument == " "?/(^\s*)|(\s*$$)/g : new RegExp("(^"+_argument+"*)|("+_argument+"*$$)","g"),"");
			}else if(typeof(_argument)=="object"){
				return this.replace(_argument,"")
			}else if(typeof(_argument)=="number" && arguments.length>=1){
				return arguments.length==1? this.substring(arguments[0]) : this.substring(arguments[0],this.length-arguments[1]);
			}
		};
		this.stripTags = function(){
			return this.replace(/<\/?[^>]+>/gi, '');
		};
		this.cint = function(){
		    return this.replace(/\D/g,"")*1;
		};
		this.camelize = function(){
			return this.replace(/(-\S)/g,function($$1){return $$1.toUpperCase().substring(1,2)});
		};
		this.hasSubString = function(s,f){
			if(!f) f="";
			return (f+this+f).indexOf(f+s+f)==-1?false:true;
	    };
		this.hasSubStrInArr = function(){
			for(var i=0; i<arguments[0].length; i++){
				if(this.hasSubString(arguments[0][i])){return true;}
			}
			return false;
		};
		this.toXMLString = function(){
			var arr = this.split("&");
			var str = new StringBuffer();
			for (var i=0,len=arr.length; i<len; i++){
				var item = arr[i].split("=");
				str.append("<"+item[0]+"><![CDATA["+item[1]+"]]></"+item[0]+">");
			}
			var rootStr = arguments[0]?arguments[0]:"root";
			return "<"+rootStr+">"+str.toString()+"</"+rootStr+">";
		};
		this.format = function(){
			var p = arguments;
			return this.replace(/(\{\d+\})/g,function(){
				return p[arguments[0].replace(/\D/g,"")];
			});		
		};
		this.uniq = function(){			
			var arr = this.split("");
			var obj = {};
			for(var i=0,j; j=arr[i]; i++){
				obj[j] = i;
			}
			var s = [];
			for(var key in obj){
				s[obj[key]]=key;
			}
			return s.join("");
		};
	},
	Function : function(){
		this.bind = function() {
  			var __method = this, args = $$A(arguments), object = args.shift();
  			return function() {
    			return __method.apply(object, args.concat($$A(arguments)));
  			}
		};
	},
	StringBuffer : function(){
		this.append = function(){this.data.push(arguments[0]);return this};
		this.toString = function(){return this.data.join(arguments[0]||"")};
		this.length = function(){return this.data.length};
		this.clear = function(){this.data.length=0; return this;}
	},
	NameSpace : function(){
		this.copyChild = function(ns){
			for (var key in ns){
				this[key] = ns[key];
			}
			return this;
		};
	}
};

$$._Method.Array.apply(Array.prototype);
$$._Method.String.apply(String.prototype);
$$._Method.Function.apply(Function.prototype);
$$._Method.StringBuffer.apply(StringBuffer.prototype);
$$._Method.NameSpace.apply(NameSpace.prototype);

$$.Browse = {
	isIE : function(n){if(isNaN(n))return navigator.userAgent.hasSubString("MSIE ");return navigator.userAgent.hasSubString("MSIE "+n);},
	isFF : function(){return navigator.userAgent.hasSubString("Firefox");},
	isOpera : function(){return navigator.userAgent.hasSubString("Opera")},
	isSafari : function(){return navigator.userAgent.hasSubString("Safari");},
	isGecko : function(){return navigator.userAgent.hasSubString("Gecko");},
	IEVer : function(){return $$.Browse.isIE() ? parseInt(navigator.userAgent.split(";")[1].trim().split(" ")[1]) : 0;}
};
$$(document);

var Ajax={
	xmlhttp:function (){
		var obj = null;	
		try{
			obj = new ActiveXObject('Msxml2.XMLHTTP');
		}catch(e){
			try{
				obj = new ActiveXObject('Microsoft.XMLHTTP');
			}catch(e){
				obj = new XMLHttpRequest();
			}
		}
		return Ajax.xmlObjCache = obj;
	},xmlObjCache:null
};
Ajax.Request=function (){
	if(arguments.length<2)return ;
	var para = {asynchronous:true,method:"GET",parameters:""};
	for (var key in arguments[1]){
		para[key] = arguments[1][key];
	}
	var _x= Ajax.xmlhttp();
	var _url=arguments[0];
	if(para["parameters"].length>0) para["parameters"]+='&_=';
	if(para["method"].toUpperCase()=="GET") _url+=(_url.match(/\?/)?'&':'?')+para["parameters"];
	_x.open(para["method"].toUpperCase(),_url,para["asynchronous"]);
	_x.onreadystatechange=Ajax.onStateChange.bind(_x,para);
	if(para["method"].toUpperCase()=="POST")_x.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	for (var ReqHeader in para["setRequestHeader"]){
		_x.setRequestHeader(ReqHeader,para["setRequestHeader"][ReqHeader]);
	}
	_x.send(para["method"].toUpperCase()=="POST"?(para["postBody"]?para["postBody"]:para["parameters"]):null);
	return _x;
};
Ajax.onStateChange = function(para){
	if(this.readyState==4){
		if(this.status==200)
			para["onComplete"]?para["onComplete"](this):"";
		else{
			para["onError"]?para["onError"](this):"";
		}
	}
};
$$.Ajax = {
	Request : function(url,_method,para,complete,error){return Ajax.Request(url,{method:_method||"get",parameters:para||"",onComplete:complete,onError:error});},
	get	: function(url,complete,error){ return $$.Ajax.Request(url+(url.indexOf("?")==-1?"?":"&")+Math.random(),"get","",complete,error); },
	post : function(url,para,complete,error){ return $$.Ajax.Request(url,"post",para,complete,error);},
	postXML : function(url,xmlString,complete,error){return myAjax = new Ajax.Request(url,{method:"post",postBody:xmlString,setRequestHeader:{"content-Type":"text/xml"},onComplete:complete,onError:error});},
	update : function(url,id){ return $$.Ajax.Request(url,(arguments[2]?"post":"get"),(arguments[2]?arguments[2]:Math.random()),function(x){if("INPUT,SELECT,BUTTON,TEXTAREA".hasSubString($$(id).tagName,",")){$$(id).value=x.responseText;}else{$$(id).innerHTML=x.responseText;}});}
};
$$.JsLoad = {
	load : function(sId,sUrl ,fCallback,parameter){
			var _script = document.createElement("script");
			_script.setAttribute("id", sId);
			_script.setAttribute("type", "text/javascript");
			_script.setAttribute("src", sUrl);
			document.getElementsByTagName("head")[0].appendChild(_script);
			if ($$.Browse.isIE()) {
				_script.onreadystatechange = function(){
					if (this.readyState == "loaded" || this.readyState == "complete") {
						$$(_script).remove();
						fCallback(parameter);
					}
				};
			}
			else {
				_script.onload = function(){
					$$(_script).remove();
					fCallback(parameter);
					
				}
			}
		} 
	
};
$$.Cookies = {
    get : function(n){
	    var dc = "; "+document.cookie+"; ";
	    var coo = dc.indexOf("; "+n+"=");
	    if (coo!=-1){
		    var s = dc.substring(coo+n.length+3,dc.length);
		    return unescape(s.substring(0, s.indexOf("; ")));
	    }else{
		    return null;
	    }
    },
    set : function(name,value,expires,path,domain,secure){
        var expDays = expires*24*60*60*1000;
        var expDate = new Date();
        expDate.setTime(expDate.getTime()+expDays);
        var expString = expires ? "; expires="+expDate.toGMTString() : "";
        var pathString = "; path="+(path||"/");
		var domain = domain ? "; domain="+domain : "";
        document.cookie = name + "=" + escape(value) + expString + domain + pathString + (secure?"; secure":"");
    },
    del : function(n){
	    var exp = new Date();
	    exp.setTime(exp.getTime() - 1);
	    var cval=this.get(n);
	    if(cval!=null) document.cookie= n + "="+cval+";expires="+exp.toGMTString();
    }
};
$$.Form = function(n){
	var f = typeof n =="string" ? document.forms[n] : n;
	$$.Form._Method.apply(f);
	return f;
};
$$.Form._Method = function(){
	this.serialize = function(obj){
			var arr = this.elements;
			var elem = {};
			for(var i=0,j; j=arr[i]; i++){
				if(j.disabled || !j.name){continue;}
				if(j.type && j.type.toLowerCase().hasSubStrInArr(["radio","checkbox"]) && !j.checked){continue;}
				var na = j.name.toLowerCase();
				if(typeof elem[na] == "undefined"){
					elem[na] = [];
				}
				elem[na].push($$E(j.value));
			}
			return $$.Form.serialize(obj,elem);
		};
};
$$.Form.serialize = function(obj){
	var elem = arguments[1] || {};
	for(var key in obj){
		var na = key.toLowerCase();
		if(typeof elem[na] == "undefined"){
			elem[na] = [];
		}
		elem[na].push($$E(obj[key]));
	}
	var para = new StringBuffer();
	for(var name in elem){
		for(var i=0; i<elem[name].length; i++){
			para.append(name+"="+elem[name][i]);
		}
	}
	return para.toString("&");
};
$$.Request = function(paras){
	var url = location.search;
	if(!url.hasSubString("?")){return "";}else{url=url.substring(1);};
	var obj = {};
	url.split("&").each(function(p){
		var k = p.split("=");
		var n = k[0].toLowerCase();		
		obj[n] = k[1] || "";
	});
	return obj[paras.toLowerCase()] || "";
};
$$.Redirect = function(url,paraStr){
	if(!paraStr){
		setTimeout(function(){location.href=url;},10);
		return;
	}
	var obj = {};
	if(url.indexOf("?")!=-1){
		var s = url.substring(url.indexOf("?")+1).split("&");
		for(var i=0; i<s.length; i++){
			var j=s[i].split("=");
			obj[j[0].toString().toLowerCase()]=j[1]||"";
		}		
	}
	var t = paraStr.split("&");
	for(var i=0; i<t.length; i++){
		var j = t[i].split("=");
		obj[j[0].toString().toLowerCase()]=j[1]||"";
	}
	var str = [];
	for(var p in obj){
		str.push(p+"="+obj[p]);
	}
	setTimeout(function(){location.href=url.substring(0,url.indexOf("?"))+"?"+str.join("&");},10);
};
$$.Import = function(url){
	var myAjax = new Ajax.Request(
		url,
		{
			asynchronous:false,
			onComplete:function(x){
				var js = document.createElement("script");
				js.type = "text/javascript";
				js.defer = "defer";
				js.text = x.responseText;
				document.getElementsByTagName("head")[0].appendChild(js);			
			},
			onError:function(x){
				alert("Loading script file occur an error:"+x.statusText);
			}
		}
	);
};
$$.DOMReady = function(f){
	try {
		$$.DOMReady._methodArgument = f;
		return $$.DOMReady.checkReady();
	}catch(e){}
};
$$.DOMReady.checkReady = function(){
	if(document&&document.getElementsByTagName&&document.getElementById&&document.body){
		return $$.DOMReady._methodArgument();
	}
	setTimeout("$$.DOMReady.checkReady()",10);
	return null;
}

function $$A(list){
	var arr = [];
	for (var i=0,len=list.length; i<len; i++){
		arr[i] = list[i];
	}
	return arr;
};
function $$D(str){return decodeURIComponent(str);};
function $$E(str){return encodeURIComponent(str);};
function $$V(id){return $$(id)?($$(id).tagName.hasSubStrInArr(["INPUT","TEXTAREA","SELECT","BUTTON"])?$$(id).value : $$(id).innerHTML):"";};
window.recycler=(function(){ var t=document.createElement('div');t.id="recycler";return t;})();
GT={};     
GT.compileTemplate= function(template){   
            var TEMPLATE_START="#{";   
            var TEMPLATE_END="/}";   
            var templateC=[];   
            var snippets=[];   
            var current=0;   
            while(true){   
                var start= template.indexOf( TEMPLATE_START ,current);   
                var sBegin=start+2;   
                var sEnd=template.indexOf( TEMPLATE_END ,sBegin);   
  
                if (sBegin>=2 && sEnd>sBegin){   
                    templateC.push(template.substring(current,start) );   
                    var sn=template.substring(sBegin,sEnd);   
                    if (sn.indexOf("#")==0){   
                        sn=eval( sn.substring(1) );   
                    }else{   
                        snippets.push(templateC.length);   
                    }   
                    templateC.push( sn );   
                }else{   
                    templateC.push( template.substring(current) );   
                    break;   
                }   
                current=sEnd+2;   
            }   
            templateC.push(snippets);   
            return templateC;   
    };     
GT.runTemplate= function(templateC,invar){   
        var VAR=invar;   
        var snippets=templateC[templateC.length-1];   
        var rs=[];   
        var sIdx=0;   
        for (var i=0;i<templateC.length-1;i++ ){   
            if (snippets[sIdx]==i){   
                rs.push(  eval(templateC[i]) );   
                sIdx++;   
            }else {   
                rs.push( templateC[i] )   
            }   
        }   
        return rs.join("");     
    };  
var Page = {
	getPageWidth: function()
	{
		return document.body.scrollWidth || document.documentElement.scrollWidth || 0;
	},
	getPageHeight: function()
	{
		return document.body.scrollHeight || document.documentElement.scrollHeight || 0;
	},

	getBodyWidth: function()
	{
		return document.body.clientWidth || document.documentElement.clientWidth || 0;
	},
	getBodyHeight: function()
	{
		return document.body.clientHeight || document.documentElement.clientHeight || 0;
	},
	getBodyLeft: function()
	{
		return window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
	},

	getBodyTop: function()
	{
		return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
	},
	getBody: function()
	{
		return {
			width  : this.getBodyWidth(),
			height : this.getBodyHeight(),
			left   : this.getBodyLeft(),
			top    : this.getBodyTop()
		};
	},
	getScreenWidth: function()
	{
		return window.screen.width;
	},
	getScreenHeight: function()
	{
		return window.screen.height;
	}
};
/////////////////////////////ACT3////////////////////////////
try{document.domain = 'qq.com';}catch(e){};
var JsPath = 'http://news.qq.com/act3/js/';
$$.JsLoad.load('ps',JsPath+'ps.js',function(){});
var User = {
	uin:0,
	name:'',
	logintemplate:'<div class="box21"><strong><a href="javascript:User.login(\'User.box()\')">登 录</a></strong></div>',
	islogintemplate:'<div id="uname_box" class="box23"><strong>欢迎#{ VAR.username /}</strong></div><div class="box23"><div class="but1 marjz red1 fl"><strong><a href="/'+ActId+'/join.do">参加活动</a></strong></div><div class="but1 marjz red1 fr"><strong><a href="/'+ActId+'/my.do">我的作品</a></strong></div><div class="qcfd"></div></div>',
	islogin:function(uin,name){
		if ($$.Cookies.get('uin') && $$.Cookies.get('skey')){
			this.uin = parseInt($$.Cookies.get('uin').replace(/^o0*/, ""));
			if(this.uin.length < 4 || this.uin.length > 11){
				this.uin = 0;
				return false;
			}
			if($$.Cookies.get('act3_utf8name')==null)
			{
				$$.JsLoad.load('islogin','http://act3.'+ChannelName+'.qq.com/'+ActId+'/index/islogin.do',function(){	
					try{ User.name = _php_uname;if($$("#uname_box")!=null)$$("#uname_box").innerHTML='<strong>欢迎'+_php_uname+'</strong>';}catch(e){}
				});
			}else
				this.name = Utf8ToUnicode($$.Cookies.get('act3_utf8name'));
		}else{
			this.uin = 0;
			return false;
		}
		this.name = this.name ? this.name : this.uin;
		return this.uin;
	},
	login:function(callback){
		LoginBox.login(callback);
	},
	box:function(){
		this.islogin();
		if( $$('#user_box')==null||$$('#logout_a') ==null) return;
		if(this.uin > 0){
			var templateC= GT.compileTemplate(User.islogintemplate); 
			$$('#logout_a').show();
			var inArg= {username: User.name };
			$$('#user_box').innerHTML=GT.runTemplate(templateC,inArg);   
		}else{
			$$('#logout_a').hide();
			var templateC= GT.compileTemplate(User.logintemplate); 
			var inArg= {};
			$$('#user_box').innerHTML=GT.runTemplate(templateC,inArg);   
		}
	}
};
var LoginBox = {
	oY: 0,
	oTimer: null,
	login_callback: null,
	show: function(callback)
	{
		if($$("#shadow")==null){
			var shadow =document.createElement('div');shadow.setAttribute("id", "shadow0");
			document.body.appendChild(shadow);
			$$("#shadow0").innerHTML= '<div id="shadow" style="background-color:#fff;position:absolute;top:0;left:0;width:100%;height:100%;z-index:99;display:none;filter:alpha(opacity=80);opacity:0.80;-moz-opacity:0.80;"></div>';
			$$("#shadow").setStyle("width:"+Page.getPageWidth() + "px;height:"+Page.getPageHeight() + "px;");
		}
		$$("#shadow").show();
		if($$("#loginbox")==null){
			var loginbox =document.createElement('div');loginbox.setAttribute("id", "loginbox");
			document.body.appendChild(loginbox);
			$$("loginbox").innerHTML = '<div  id="loginbox_1"><div id="loginbox_2"><img src="http://mat1.qq.com/house/images/bt_close.gif" onclick="LoginBox.cancel()" /></div><div  id="loginbox_3">用户登录</div></div><iframe frameborder="0" name="loginiframe" id="loginiframe" width="380" height="290" scrolling="no" src="about:blank"></iframe>';		
		}
		$$("#loginbox").setStyle('left:'+(Page.getBodyWidth() - 340)/2 + 'px;top:'+(parseInt(Page.getBodyTop())+100)+ 'px;');
		//$$("#loginiframe").src='http://ui.ptlogin2.qq.com/cgi-bin/login?qlogin_jumpname=jump&qlogin_param=u1%3D'+encodeURIComponent(window.location.href)+'&target=self&link_target=blank&f_url=loginerroralert&hide_title_bar=1&style=0&appid=5000501&s_url=http://act3.qq.com/checklogin.html';
		$$("#loginiframe").src='http://ui.ptlogin2.qq.com/cgi-bin/login?target=self&link_target=blank&f_url=loginerroralert&hide_title_bar=1&style=0&appid=5000501&s_url=http://act3.qq.com/checklogin.html';
		$$("#loginbox").show();
		this.oY = Page.getBodyTop();
		this.oTimer = window.setInterval("LoginBox.scroll()", 1);
	},
	hide: function()
	{
		$$("#loginbox").hide();
		$$("#shadow").hide();
		$$("#loginiframe").src = "about:blank";
		window.clearInterval(this.oTimer);
	},
	scroll: function()
	{
		var winY = Page.getBodyTop();
		var curY = $$("#loginbox").getElementTop('loginbox');
		var percent = 0.2 * (winY - this.oY);

		if (percent > 0)
		{
			percent = Math.ceil(percent);
		}
		else
		{
			percent = Math.floor(percent);
		}
		$$("#loginbox").setStyle('top:'+(parseInt(curY)+parseInt(percent)) + "px;");
		this.oY += percent;
	},

	login: function(callback)
	{
		this.login_callback = callback;
		this.show();
	},
	ok: function()
	{
		if (typeof this.login_callback == "function")
		{
			this.login_callback();
			this.login_callback = null;
		}
		this.hide();
	},
	cancel: function()
	{
		this.login_callback = null;
		this.hide();
	}
};
var Vote ={
	template:'<input class="ho" type="button" onclick="vote(#{ VAR.itemid /})" value="投票">',
	div_name:'vote_link',
	templates:{},
	act_path: function(){
		return 'http://act3.'+ChannelName+'.qq.com/'+ActId+'/';
	},
	init:function(){
		var votelist = $$("div[id="+Vote.div_name+"_*]"); 
		var templateC;
		for(var i=0;i<votelist.length;i++)
		{
			templateC	= GT.compileTemplate(Vote.template);
			if(typeof votelist[i].id.split("_")[2]!='undefined')
			{	
				if(typeof Vote.templates[votelist[i].id.split("_")[2]] !='undefined')
				{
					templateC = GT.compileTemplate(Vote.templates[votelist[i].id.split("_")[2]]); 
				}
				var inArg= {itemid: votelist[i].id.split("_")[2] };
				votelist[i].innerHTML=GT.runTemplate(templateC,inArg);  
			}
		}
	},
	vote:function(wid,verify,type){
		
		var self = this;
		if(!verify){
			this.verifyInput = null;
			this.verifyImg = null;
			//clearTimeout(this.verifyOff);
			if($$("#verifyBody")!=null)$$("#verifyBody").remove();
		}
		if(!/^\d+$/.test(wid)) {
			alert('错误的作品ID');
			return false;
		}
		var verifycode = '';
		if(this.verifyInput){
			verifycode = this.verifyInput.value;
			if(verifycode.length != 4){
				alert('请输入正确的验证码');
				this.verifyInput.focus();
				return;
			}
			this.removeVerify();
		}
		var dom_num = $$('#vote_num_'+wid);
		var dom_link = $$('#vote_link_'+wid);
		var dom_link_oldhtml = dom_link.innerHTML;
		dom_link.innerHTML='<img src="http://mat1.qq.com/news/act3/images/digging.gif">';
		date = new Date();
		t = date.getTime();
		$$.Cookies.set('act3_votetime',t,30);
		a = K.md5(t);
		//verifycode='';//linyang
		if(type=="uvote")
var url=Vote.act_path()+'vote/user.do?inajax=2&uid='+wid+'&verifycode='+verifycode+'&s='+a+'&c='+ChannelName+'&u='+User.uin+'&t='+Math.random();
		else
var url=Vote.act_path()+'vote/work.do?inajax=2&wid='+wid+'&verifycode='+verifycode+'&s='+a+'&c='+ChannelName+'&u='+User.uin+'&t='+Math.random();
		$$.Ajax.get(url,function(x){
			eval(x.responseText);
			if(typeof _callBack == 'undefined'){
				alert("服务器繁忙，请稍候再试！");
				return;
			}
			var s = _callBack;
			//s='输入验证码';//linyang
			if(s.indexOf('成功') == -1){
				if(s.indexOf('登录') > -1){
					try{dom_link.innerHTML=dom_link_oldhtml;}catch(e){};
					User.login(function(){
						Vote.vote(wid,0,type);
					});
				}else if(s.indexOf('投过票了') > -1){
					dom_link.innerHTML='投过啦';
				}else if(s.indexOf('输入验证码') > -1){
					if(dom_link.length  == 0){
						dom_link.innerHTML='失败啦';
						return;
					}
					try{dom_link.innerHTML=dom_link_oldhtml;}catch(e){};
					if(type=="uvote")self.showVerify(dom_link,wid,0);
					else self.showVerify(dom_link,wid,1);
					return;
				}else if(s.indexOf('验证码不正确') > -1){
					try{dom_link.innerHTML=dom_link_oldhtml;}catch(e){};
					alert(s);
					if(type=="uvote")self.showVerify(dom_link,wid,0);
					else self.showVerify(dom_link,wid,1);
				}else if(s && typeof s == 'string'){
					dom_link.innerHTML='失败啦';
					alert(s);
				}
			}else{
				try{
					var votenum = dom_num.innerHTML;
					votenum = parseInt(votenum)+1;
					dom_num.innerHTML=votenum;
					if(type=="uvote") dom_link.innerHTML='<a href="'+Vote.act_path()+'user/show-uid-'+wid+'.html" target="top">浏 览</a>';
					else dom_link.innerHTML='<a href="'+Vote.act_path()+'work/show-id-'+wid+'.html" target="top">浏 览</a>';
				}catch(e){}
			}
		});
	},
	
	verifyDiv:null,
	verifyImg:null,
	verifyArrow:null,
	verifyBody:null,
	verifyInput:null,
	verifyOff:null,
	showVerify:function(element,id,type){
		var self = this;
		var type2='';
		if(type == 1)
			type2 = 'vote';
		else
			type2 = 'uvote';
		type = 'vote';
		try{this.verifyDiv.remove();}catch(e){}
		this.verifyImg = $$('<img onclick="updateVerify(this)" ref="verify" style="cursor:pointer;margin-bottom:5px" src="about:blank" alt="获取中..." title="点击更换" width="130" height="53">');
		//this.verifyImg.bind('click',function(){self.updateVerify()});
		this.verifyDiv = $$('<div id="verifyDiv" ref="verify" style="width:130px;height:100px;position:absolute;left:100;top:0;z-index:1000"></div>');
		this.verifyBody = $$('<div  id="verifyBody" ref="verify" style="width:130px;height:100px;background:#505050;border:solid 1px #545454;padding:3px;color:white;"></div>');
		this.verifyArrow = $$('<div ref="verify" style="background-image: url(http://mat1.qq.com/news/act3/images/jtip_arrow_left.gif);background-repeat: no-repeat;background-position: left top;position: absolute;z-index:99;left:-18px;top:75px;height:34px;width:18px;"></div>');
		this.verifyInput = $$('<input ref="verify" name="verifycode" style="height:16px;width:60px" onkeydown="if(event.keyCode==13)Vote.'+type+'(\''+id+'\',1,\''+type2+'\')" maxlength="4" size="4" autocomplete="off" style="ime-mode:disabled;" />');
		this.verifyBody.appendChild(this.verifyImg);
		this.verifyBody.appendChild(this.verifyInput);
		this.verifyBody.appendChild($$('<span ref="verify" style="font-weight:bold;cursor:hand" onclick="Vote.'+type+'(\''+id+'\',1,\''+type2+'\')">确 定</span>'));
		this.verifyBody.appendChild($$('<span ref="verify" onclick="Vote.updateVerify()" style="color:white;cursor:pointer">看不清楚?换一个</span>'));
		var offset = $$(element).getElement($$(element));
		var left = offset.left+$$(element).getElementWidth()+10;
		var top = offset.top-82;
		document.body.appendChild(this.verifyDiv.appendChild(this.verifyArrow));
		document.body.appendChild(this.verifyBody);
		//alert(left+" "+top)
		this.verifyBody.setStyle("left:"+left+"px;top:"+top+"px;");
		//this.verifyDiv.style.left='11px';//parseInt(left)+"px";//("left:"+left+" px;top:"+top+" px;");
		//this.verifyDiv.style.top='11px';//parseInt(top)+"px";
		//alert(this.verifyDiv.style.top+"    "+this.verifyDiv.style.left)
		this.verifyDiv.show();
		this.updateVerify();
		this.verifyInput.focus();
		//Vote.verifyOff = setTimeout("Vote.removeVerify()",10000);
		this.verifyDiv.onmouseover= (function(){Vote.clear_timeout()}).bind(this.verifyDiv);
		//this.verifyDiv.bind('mouseover',function(){});
		this.verifyDiv.mouseout=(function(){Vote.set_timeout()}).bind(this.verifyDiv);
		//this.verifyDiv.bind('mouseout',function(){V.verifyOff = setTimeout("V.removeVerify()",10000)});
		if($$.Browse.isIE())$$(document).onclick=(function(){Vote.d_click()}).bind($$(document));
		else $$(document).onclick=(function(event){Vote.d_click(event)}).bind($$(document));
	},
	d_click:function(e){
		if(e==null)e=window.event;//IE
			var srcElement = e.srcElement ? e.srcElement : e.target;
			if(srcElement.getAttribute('ref') == 'verify'){
				return;
			}
			this.removeVerify(e);
	},
	updateVerify:function(){
		this.verifyImg.src='http://ptlogin2.qq.com/getimage?aid=5000501&'+Math.random();
	},
	clear_timeout:function(){
		clearTimeout(Vote.verifyOff);
	},
	set_timeout:function(){
		Vote.verifyOff = setTimeout("Vote.removeVerify()",10000);
	},
	removeVerify:function(e){
		this.verifyInput = null;
		this.verifyImg = null;
		//clearTimeout(this.verifyOff);
		try{$$("#verifyBody").remove();}catch(e){}
	}
};
function updateVerify(o){
		o.src='http://ptlogin2.qq.com/getimage?aid=5000501&'+Math.random();
	}
function vote(wid){	Vote.vote(wid,0);}
function uvote(wid){	Vote.vote(wid,0,'uvote');}
function Utf8ToUnicode(strUtf8)
{
if(strUtf8==''||strUtf8==null)return;
var bstr = "";
var nTotalChars = strUtf8.length; 
var nOffset = 0; 
var nRemainingBytes = nTotalChars; 
var nOutputPosition = 0;
var iCode, iCode1, iCode2; 
while (nOffset < nTotalChars)
{
iCode = strUtf8.charCodeAt(nOffset);
if ((iCode & 0x80) == 0) // 1 byte.
{
if ( nRemainingBytes < 1 ) // not enough data
break;
bstr += String.fromCharCode(iCode & 0x7F);
nOffset ++;
nRemainingBytes -= 1;
}
else if ((iCode & 0xE0) == 0xC0) // 2 bytes
{
iCode1 =   strUtf8.charCodeAt(nOffset + 1);
if ( nRemainingBytes < 2 || // not enough data
    (iCode1 & 0xC0) != 0x80 ) // invalid pattern
{
break;
}
bstr += String.fromCharCode(((iCode & 0x3F) << 6) | (     iCode1 & 0x3F));
nOffset += 2;
nRemainingBytes -= 2;
}
else if ((iCode & 0xF0) == 0xE0) 
{
iCode1 =   strUtf8.charCodeAt(nOffset + 1);
iCode2 =   strUtf8.charCodeAt(nOffset + 2);
if ( nRemainingBytes < 3 || 
    (iCode1 & 0xC0) != 0x80 || 
    (iCode2 & 0xC0) != 0x80 )
{
break;
}
bstr += String.fromCharCode(((iCode & 0x0F) << 12) |
((iCode1 & 0x3F) <<   6) |
(iCode2 & 0x3F));
nOffset += 3;
nRemainingBytes -= 3;
}
else
break;
}
if (nRemainingBytes != 0)
{
return "";
}
return bstr;
}/*  |xGv00|281b14bb5f796878fe38690ff5cda729 */