var $$, $$B, $$A, $$F, $$D, $$E, $$CE, $$S;
(function(){
var O, B, A, F, D, E, CE, S;
O = function (id) {return "string" == typeof id ? document.getElementById(id) : id;};
O.extend = function (destination, source, override) {
	if (override === undefined) override = true;
	for (var property in source) {
		if (override || !(property in destination)) {
			try{
				destination[property] = source[property];
			}catch(e){}
		}
	}
	return destination;
};
O.wrapper = function(me, parent) {
    var ins = function() { me.apply(this, arguments); };
    var subclass = function() {};
    subclass.prototype = parent.prototype;
    ins.prototype = new subclass;
    return ins;
};
B = (function(ua){
	var b = {
		msie: /msie/.test(ua) && !/opera/.test(ua),
		opera: /opera/.test(ua),
		safari: /webkit/.test(ua) && !/chrome/.test(ua),
		firefox: /firefox/.test(ua),
		chrome: /chrome/.test(ua)
	};
	var vMark = "";
	for (var i in b) {
		if (b[i]) { vMark = "safari" == i ? "version" : i; break; }
	}
	b.version = vMark && RegExp("(?:" + vMark + ")[\\/: ]([\\d.]+)").test(ua) ? RegExp.$1 : "0";
	b.ie = b.msie;
	b.ie6 = b.msie && parseInt(b.version, 10) == 6;
	b.ie7 = b.msie && parseInt(b.version, 10) == 7;
	b.ie8 = b.msie && parseInt(b.version, 10) == 8;
	return b;
})(window.navigator.userAgent.toLowerCase());
A = function(){
	var ret = {};
	function each( object, callback ) {
		try{
			if ( undefined === object.length ){
				for ( var name in object ) {
					if (false === callback( object[name], name, object )) break;
				}
			} else {
				for ( var i = 0, len = object.length; i < len; i++ ) {
					if (i in object) { if (false === callback( object[i], i, object )) break; }
				}
			}
		}catch(e){}
	};
	each({
			forEach: function( object, callback, thisp ){
				each( object, function(){ callback.apply(thisp, arguments); } );
			},
			map: function( object, callback, thisp ){
				var ret = [];
				each( object, function(){ ret.push(callback.apply(thisp, arguments)); });
				return ret;
			},
			filter: function( object, callback, thisp ){
				var ret = [];
				each( object, function(item){
						callback.apply(thisp, arguments) && ret.push(item);
					});
				return ret;
			}
		}, function(method, name){
			ret[name] = function( object, callback, thisp ){
				if (object[name]) {
					return object[name]( callback, thisp );
				} else {
					return method( object, callback, thisp );
				}
			}
		});
	return ret;
}();
F = (function(){
	var slice = Array.prototype.slice;
	return {
		bind: function( fun, thisp ) {
			var args = slice.call(arguments, 2);
			return function() {
				return fun.apply(thisp, args.concat(slice.call(arguments)));
			}
		},
		bindAsEventListener: function( fun, thisp ) {
			var args = slice.call(arguments, 2);
			return function(event) {
				return fun.apply(thisp, [E.fixEvent(event)].concat(args));
			}
		}
	};
})();
D = {
	getScrollTop: function(node) {
		var doc = node ? node.ownerDocument : document;
		return doc.documentElement.scrollTop || doc.body.scrollTop;
	},
	getScrollLeft: function(node) {
		var doc = node ? node.ownerDocument : document;
		return doc.documentElement.scrollLeft || doc.body.scrollLeft;
	}
};
E = (function(){
	var addEvent, removeEvent, guid = 1;
	if ( window.addEventListener ) {
		addEvent = function( element, type, handler ){
			element.addEventListener(type, handler, false);
		};
		removeEvent = function( element, type, handler ){
			element.removeEventListener(type, handler, false);
		};
	} else {
		addEvent = function( element, type, handler ){
			if (!handler.$$guid) handler.$$guid = guid++;
			if (!element.events) element.events = {};
			var handlers = element.events[type];
			if (!handlers) {
				handlers = element.events[type] = {};
				if (element["on" + type]) {
					handlers[0] = element["on" + type];
				}
			}
			handlers[handler.$$guid] = handler;
			element["on" + type] = handleEvent;
		};
		removeEvent = function( element, type, handler ){
			if (element.events && element.events[type]) {
				delete element.events[type][handler.$$guid];
			}
		};
		function handleEvent() {
			var returnValue = true, event = fixEvent();
			var handlers = this.events[event.type];
			for (var i in handlers) {
				this.$$handleEvent = handlers[i];
				if (this.$$handleEvent(event) === false) {
					returnValue = false;
				}
			}
			return returnValue;
		};
	}
	function fixEvent(event) {
		if (event && !document.all) return event;
		event = window.event;
		event.pageX = event.clientX + D.getScrollLeft();
		event.pageY = event.clientY + D.getScrollTop();
		event.target = event.srcElement;
		event.stopPropagation = stopPropagation;
		event.preventDefault = preventDefault;
		var relatedTarget = {
				"mouseout": event.toElement, "mouseover": event.fromElement
			}[ event.type ];
		if ( relatedTarget ){ event.relatedTarget = relatedTarget;}
		
		return event;
	};
	function stopPropagation() { this.cancelBubble = true; };
	function preventDefault() { this.returnValue = false; };
	return {
		"addEvent": addEvent,
		"removeEvent": removeEvent,
		"fixEvent": fixEvent
	};
})();
CE = (function(){
	var guid = 1;
	return {
		addEvent: function( object, type, handler ){
			if (!handler.$$$guid) handler.$$$guid = guid++;
			if (!object.cusevents) object.cusevents = {};
			if (!object.cusevents[type]) object.cusevents[type] = {};
			object.cusevents[type][handler.$$$guid] = handler;
		},
		removeEvent: function( object, type, handler ){
			if (object.cusevents && object.cusevents[type]) {
				delete object.cusevents[type][handler.$$$guid];
			}
		}
	};
})();
S = {
	camelize: function(s){
		return s.replace(/-([a-z])/ig, function(all, letter) { return letter.toUpperCase(); });
	}
};
$$ = O; $$B = B; $$A = A; $$F = F; $$D = D; $$E = E; $$CE = CE; $$S = S;
})();
function getParam(name){var search = document.location.search;var pattern = new RegExp("[?&]"+name+"\=([^&]+)", "g");var matcher = pattern.exec(search);var items = null;if(null != matcher){try{items = decodeURIComponent(decodeURIComponent(matcher[1]));}catch(e){try{items = decodeURIComponent(matcher[1]);}catch(e){items = matcher[1];}}}return items;};
var evalscripts = new Array();
var win = {width:0,height:0,top:0,left:0};
var qmeCms = window.qmeCms || {};
function $(_sId){return typeof _sId == 'string' ? document.getElementById(_sId) : _sId;}
function evaljson(resp){var json;try{eval("json = " + resp);}catch(e){var l = resp.indexOf('{');var r = resp.lastIndexOf('}');try{eval("json="+resp.substr(l, r-l+1));}catch(e){}};return json;};
function fetchOffset(obj) {var leftOffset = obj.offsetLeft;var topOffset = obj.offsetTop;while((obj = obj.offsetParent) != null) {leftOffset += obj.offsetLeft;topOffset += obj.offsetTop;};return { 'left' : leftOffset, 'top' : topOffset };};
function getElementsByClassName(ele, className){if(document.all){var children = ele.all;}else{var children = ele.getElementsByTagName('*');};var elements = new Array();for (var i = 0; i < children.length; i++){var child = children[i];var classNames = child.className.split(' ');for(var j = 0; j < classNames.length; j++){if (classNames[j].trim() == className){elements[elements.length] = child;break;}}};return elements;};
function addClassName(obj,name){if(obj == null) return;if(obj.className.indexOf(name) > -1) return true;var n=obj.className;obj.className=n+' '+name;};
function removeClassName(obj,name){if(obj == null) return;var n=obj.className;obj.className = obj.className.replace(name, '');};
function hash(string, length) {var length = length ? length : 32;var start = 0;var i = 0;var result = '';filllen = length - string.length % length;for(i = 0; i < filllen; i++){string += "0";}while(start < string.length) {result = stringxor(result, string.substr(start, length));start += length;}return result;}
function stringxor(s1, s2) {var s = '';var hash = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';var max = Math.max(s1.length, s2.length);for(var i=0; i<max; i++) {var k = s1.charCodeAt(i) ^ s2.charCodeAt(i);s += hash.charAt(k % 52);}return s;}
function evalscript(s) {if(s.indexOf('<script') == -1) return s;var p = /<script[^\>]*?>([^\x00]*?)<\/script>/ig;var arr = new Array();while(arr = p.exec(s)) {var p1 = /<script[^\>]*?src=\"([^\>]*?)\"[^\>]*?(reload=\"1\")?(?:charset=\"([\w\-]+?)\")?><\/script>/i;var arr1 = new Array();arr1 = p1.exec(arr[0]);if(arr1) {appendscript(arr1[1], '', arr1[2], arr1[3]);} else {p1 = /<script(.*?)>([^\x00]+?)<\/script>/i;arr1 = p1.exec(arr[0]);appendscript('', arr1[2], arr1[1].indexOf('reload=') != -1);}}return s;}
function appendscript(src, text, reload, charset) {var id = hash(src + text);if(!reload && evalscripts.inArray(id)) return;if(reload && $(id)) {$(id).parentNode.removeChild($(id));}evalscripts.push(id);var scriptNode = document.createElement("script");scriptNode.type = "text/javascript";scriptNode.id = id;scriptNode.charset = charset ? charset : ($$B.firefox ? document.characterSet : document.charset);try {if(src) {scriptNode.src = src;} else if(text){scriptNode.text = text;}document.getElementsByTagName('head')[0].appendChild(scriptNode);} catch(e) {}}
function stripscript(s) {return s.replace(/<script.*?>.*?<\/script>/ig, '');}
function Each(a,fn){for(var i=0;i<a.length;i++)fn.call(a[i],i,a)};
function domReady(func){
	if (!window.__load_events){
		window._init = function(){
			if (arguments.callee.done) return;
			arguments.callee.done = true;
			if (window.__load_timer){
				clearInterval(window.__load_timer);
				window.__load_timer = null;
			};
			if(window.__load_events) for (var i=0;i < window.__load_events.length;i++){
				window.__load_events[i]();
			};
			window.__load_events = null;
		};
		if (document.addEventListener){
			document.addEventListener("DOMContentLoaded", window._init, false);
		};
		if (/WebKit/i.test(navigator.userAgent)){
			window.__load_timer = setInterval(function(){
				if (/loaded|complete/.test(document.readyState)){
					window._init();
				};
			}, 10);
		};
		window.onload = window._init;
		window.__load_events = [];
	};
	window.__load_events.push(func);
};
function getHost(url){var host = "null";if(typeof url == "undefined" || typeof url == "unknown" || null == url) url = window.location.href;var regex = /.*\:\/\/([^\/]*).*/;var match = url.match(regex);if(typeof match != "undefined" && typeof match != 'unknown' && null != match)  host = match[1];return host;};
String.prototype.trim = function(){return this.replace(/(^\s+)|(\s+$)/g,"");};
String.prototype.strlen = function(){return this.replace(/[^\x00-\xff]/g,"--").length;};
String.prototype.stripTags = function(){return this.replace(/<\/?[^>]+>/gi, '');};
String.prototype.inArray = function(arr){for(var i=0;i<arr.length;i++){if(this==arr[i]) return true;};return false;};
Array.prototype.inArray = function(str){var _o = this; var len = _o.length;for(var i=0;i<len;i++){if(_o[i] == str) return true;};return false;};
Array.prototype.del = function(n){if (n<0) return this;return this.slice(0,n).concat(this.slice(n+1,this.length));};
Array.prototype.indexOf = function(o){for (var i=0; i<this.length; i++) if (this[i]==o) return i;return -1;};
(function(){if($$B.ie6) try{document.execCommand("BackgroundImageCache", false, true);}catch(e){}})();
function getWin(){
	var htmlBody = ((typeof window.opera == 'undefined' || typeof window.opera == 'unknown') && !window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
	if(htmlBody == null || document.body == null || document.documentElement == null){
		setTimeout(getWin, 50);
		return;
	}
	win.width = htmlBody.offsetWidth;
	win.height = htmlBody.offsetHeight;
	win.left = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
	win.top = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
};
domReady(getWin);
$$E.addEvent(window, 'resize', getWin);
$$E.addEvent(window, 'scroll', getWin);
var log = {
	debug:false,
	out:function(msg){
		if(this.debug) alert(msg);
		return false;
	}
}
function loadJS(urls, fun){
	var url = '';
	var fun = fun || function(){};
	if(typeof urls != 'string'){
		if(urls.length == 0) return fun();
		url = urls.shift();
		var oldFun = fun;
		var fun = function(){
			loadJS(urls, oldFun);
		}
	}else{
		url = urls;
	}
	var sc = document.createElement('script');
	sc.src = url;
	sc.setAttribute('async', 'async');
	sc.setAttribute('type', 'text/javascript');
	sc.setAttribute('charset', config.charset);
	if(document.all){
		sc.onreadystatechange = function(){
			if(sc.readyState == 'loaded' || sc.readyState == 'complete'){
				fun();
			}
		}
	}else{
		sc.onload = fun;
	}
	document.documentElement.firstChild.insertBefore(sc, document.documentElement.firstChild.lastChild);
}
function loadCSS(url){
	var sc = document.createElement('link');
	sc.href = url;
	sc.setAttribute('rel', 'stylesheet');
	sc.setAttribute('type', 'text/css');
	sc.setAttribute('async', 'async');
	document.documentElement.firstChild.insertBefore(sc, document.documentElement.firstChild.lastChild);
}
function makeSure(){
	if( window.confirm('你确实要这么操作？') ){
		return true;
	}
	return false;
}
var Ajax = AJAX ={
	hashTable:{},
	jsonpIndex:0,
	activeRequestCount: 0,
	closeTime:0,
	getTransport: function(){if (window.ActiveXObject && !window.XMLHttpRequest){var msxmls = ['Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'];for(var i = 0; i < msxmls.length; i++){try{return new window.ActiveXObject(msxmls[i]);}catch(e){}};return null;}else{return new XMLHttpRequest();}},
	get: function(url, call){
		this.request(url,{method:'get',onComplete: function(resp){
			if(typeof call == 'function') call(resp);
			evalscript(resp);
			return true;
		}});
	},
	jsonp: function(url, call){
		if(Ajax.activeRequestCount>0) return setTimeout(function(){Ajax.jsonp(url, call);} ,50);
		this.activeRequestCount++;
		if(typeof call != 'function') call = function(){};
		if($('divProcessing') != null) $('divProcessing').style.display = 'block';
		this.jsonpIndex++;
		var key = hash(call.toString());
		var id = "jsonp_"+hash(url)+"_"+this.jsonpIndex;
		if($(id) != null) $(id).parentNode.removeChild($(id));
		if(typeof this.hashTable[key] == 'undefined') this.hashTable[key] = call;
		var sc = document.createElement("iframe");
		sc.frameborder = 0;
		sc.style.border = 0;
		sc.style.height = '1px';
		sc.style.display = 'none';
		sc.src = "about:blank";
		sc.id = id;
		sc.charset = config.charset;
		sc.name = id;
		document.body.insertBefore(sc, $('divProcessing'));
		url = url + (url.match(/\?/) ? '&' : '?') + "jsonp=1";
		sc.contentWindow.document.write("<html><head><meta http-equiv=Content-Type content=\"text/html; charset="+config.charset+"\"></head><body><script type='text/javascript'>var id='"+id+"';var key='"+key+"';function _output_back(resp){parent.AJAX.jsonpComplete(id, key, resp);};var sc=document.createElement('script');sc.charset = '"+config.charset+"';sc.type='text/javascript';sc.src='"+url+"';document.documentElement.firstChild.insertBefore(sc, document.documentElement.firstChild.lastChild);</script></body></html>");
	},
	jsonpComplete: function(id, key, resp){
		if(typeof this.hashTable[key] == 'undefined' || $(id) == null) return false;
		$(id).parentNode.removeChild($(id));
		this.hashTable[key](resp);
		delete this.hashTable[key];
		this.close();
		this.activeRequestCount=0;
	},
	request: function(url, options){
		if(Ajax.activeRequestCount>0) return setTimeout(function(){Ajax.request(url, options);} ,50);
		clearTimeout(this.closeTime);
		if($('divProcessing') != null) $('divProcessing').style.display = 'block';
		this.activeRequestCount++;
		this.transport= this.getTransport();
		this.url = url;
		this.options={
			method:'POST',
			asynchronous:true,
			contentType:'application/x-www-form-urlencoded',
			parameters:'',
			onLoading:function(){},
			onLoaded:function(){},
			onInteractive:function(){},
			onComplete:function(){}
		};
		this.requestHeaders = ['X-Requested-With', 'XMLHttpRequest','Accept', 'text/javascript, text/html, application/xml, text/xml, */*'];
		options= options || {};
		$$.extend(this.options, options);
		if (this.options.method.toUpperCase() == 'GET' && this.options.parameters.length > 0){
			this.url += (this.url.match(/\?/) ? '&' : '?') + this.options.parameters;
		};
		if((this.url.substr(0,7) == 'http://' || this.url.substr(0,8) == 'https://') && getHost(this.url) != document.location.host){
			this.activeRequestCount = 0;
			if(this.options.method.toUpperCase() != 'GET' && this.options.parameters.length > 0){
				var temp = this.options.parameters.replace(/&amp;/g, '&').split("&");
				var obj = [];
				for(var i=0;i<temp.length;i++){
					var tmp = temp[i].split('=');
					if(tmp.length != 2) continue;
					obj.push("_post_" + tmp[0] + "=" + tmp[1]);
				}
				this.url += (this.url.match(/\?/) ? '&' : '?') + obj.join('&');
			}
			return this.jsonp(this.url, this.options.onComplete);
		}
		if (this.options.requestHeaders){
			this.requestHeaders.push.apply(this.requestHeaders, this.options.requestHeaders);
		};
		this.url += (this.url.match(/\?/) ? '&' : '?') + 'ajax=1';
		this.transport.open(this.options.method.toUpperCase(), this.url, this.options.asynchronous);
		if (this.options.asynchronous){
			var self = this;
			this.transport.onreadystatechange = function(){
				switch(self.transport.readyState){
					case 1:
						self.options.onLoading(self.transport);
					break;
					case 2:
						self.options.onLoaded(self.transport);
					break;
					case 3:
						self.options.onInteractive(self.transport);
					break;
					case 4:
						self.complete();
					break;
				}
			};
		};
		if (this.options.method.toUpperCase() == 'POST'){
			this.requestHeaders.push('Content-type', this.options.contentType);
			if (this.transport.overrideMimeType){
				this.requestHeaders.push('Connection', 'close');
			}
		};
		this.requestHeaders.push('Charset', 'utf-8');
		for (var j = 0; j < this.requestHeaders.length; j += 2){
			this.transport.setRequestHeader(this.requestHeaders[j], this.requestHeaders[j+1]);
		};
		this.transport.send(this.options.method.toUpperCase() == 'POST' ? this.options.parameters : null);
		if(!this.options.asynchronous){
			this.complete();
		};
	},
	complete:function(){
		this.close();
		try{
			var xml = this.transport.getResponseHeader('Content-Type');
			var json = this.transport.getResponseHeader('X-JSON');
			if(xml != null){
				if(json != null && typeof json == 'string' && json){
					this.options.onComplete(evaljson(this.transport.getResponseHeader('X-JSON')));
				}else if(xml.indexOf('text/xml') > -1 && this.transport.responseText){
					try{
						this.options.onComplete(this.transport.responseXML.documentElement.firstChild.nodeValue);
					}catch(e){
						this.options.onComplete(this.transport.responseText);
					}
				}else{
					this.options.onComplete(this.transport.responseText);
				}
			}
		}catch(e){}
		this.activeRequestCount = 0;
	},
	close:function(){
		if(typeof $ == 'function' && $('divProcessing') != null){
			this.closeTime = setTimeout(function(){
				$('divProcessing').style.display = 'none';
			}, 500 );
		}
	},
	abort:function(){

	}
};
var myCookie = {
	'get':function (Name){
		if(document.cookie.length > 0){
			var arrStr = document.cookie.split(";");
			for(var i = 0;i < arrStr.length;i ++){
				var temp = arrStr[i].split("=");
				if(temp.length > 1 && temp[0].toString().trim() == Name) return unescape(temp[1]);
			} 
			return "";
		}else{
			return "";
		}
	},
	'set':function(name,value,day){
		if(!day){day=365;};
		var today = new Date();
		var expires = new Date();
		expires.setTime(today.getTime() + 3600*24*1000*day);
		document.cookie = name + "=" + escape(value) + "; path=/; domain="+document.domain+";expires=" + expires.toGMTString();
	},
	'del':function (name){
		var today = new Date();
		var expires = new Date();
		expires.setTime(today.getTime() - 86400*1000*365);
		document.cookie = name + "=0; path=/;domain="+document.domain+";expires=" + expires.toGMTString();
	}
};
var Form = {
	'serialize':function(name){
		var obj = document.forms[name];
		if(typeof obj == 'undefined' || typeof obj == 'unknown') return log.out('Form '+name+' not exists');
		var para = "";
		var arr = obj.elements;
		var elem = {};
		for(var i=0,j; j=arr[i]; i++){
			if(j.disabled || !j.name){continue;};
			if(j.type && j.type.toLowerCase().inArray(["radio","checkbox"]) && !j.checked){continue;};
			var na = j.name;
			if(typeof elem[na] == "undefined" || typeof elem[na] == "unknown" ){
				elem[na] = [];
			};
			elem[na].push(encodeURIComponent(j.value));
		};
		var para = [];
		for(var name in elem){
			for(var i=0; i<elem[name].length; i++){
				para[para.length] = name+"="+elem[name][i];
			}
		};
		return para.join("&");
	},
	'disabledCtrl':function(e){
		var e = e || window.event;
		if(e.keyCode == 13 || e.keyCode == 17) return false;
	},
	'ob':function(e, forq){
		if($(forq) == null) return true;
		var e = e || window.event;
		if(e.keyCode == 13 || e.keyCode == 17){
			$(forq).onclick();
			return false;
		}
		return true;
	},
	'autoSend':function(e, form){
		var e = e || window.event;
		if(e.ctrlKey && e.keyCode == 13){
			$(form).submit();
			return false;
		}
		return true;
	},
	'send':function(name, fun){
		var obj = document.forms[name];
		if(typeof obj == 'undefined' || typeof obj == 'unknown') return log.out('Form '+name+' not exists');
		var _url = obj.getAttribute('action');
		var _method = obj.getAttribute("method") || 'post';
		var _parameters = Form.serialize(name);
		Ajax.request(_url,{method: _method,parameters:_parameters + '&myFormAc=update',onComplete: function(resp){
			evalscript(resp);
			if(typeof fun == 'function') fun(resp);
			return true;
		}});
		return false;
	}
};
function colorInt(color){return [parseInt(color.substr(1, 2), 16), parseInt(color.substr(3, 2), 16), parseInt(color.substr(5, 2), 16)];}
function colorFocus(obj, cs, ce, type, fun){
	var me = this;
	var colorData = [];
	clearInterval(me.only);
	obj.style[type] = cs;
	var s=curColor=colorInt(cs),e=colorInt(ce), t = 5, index = 0;
	var step = [(e[0]-s[0])/t, (e[1]-s[1])/t, (e[2]-s[2])/t];
	me.only=setInterval(function (){
		for(var i=0; i<3;i++){curColor[i] = parseInt(curColor[i] + step[i]);}
		obj.style[type] = "rgb("+curColor.join(',')+")";
		if(index<t) index++; 
		else{
			obj.style[type] = ce;
			clearInterval(me.only);
			obj.style[type] = ce;
			if(typeof fun == 'function') fun(obj);
		}
	},20);
	return false;
}
var Tweener = {
    easeNone: function(t, b, c, d) {
        return c*t/d + b;
    },    
    easeInExpo: function(t, b, c, d) {
        return(t==0) ? b : c * Math.pow(2, 10 *(t/d - 1)) + b - c * 0.001;
    },    
    easeOutExpo: function(t, b, c, d) {
        return(t==d) ? b+c : c * 1.001 *(-Math.pow(2, -10 * t/d) + 1) + b;
    }, 
    easeOutInBounce: function(t, b, c, d) {
        if(t < d/2) return Tweener.easeOutBounce(t*2, b, c/2, d);
        return Tweener.easeInBounce((t*2)-d, b+c/2, c/2, d);
    },
	easeInOutCubic: function(t, b, c, d) {if((t/=d/2) < 1) return c/2*t*t*t + b;return c/2*((t-=2)*t*t + 2) + b;},
	easeOutCubic: function(t, b, c, d) {return c*((t=t/d-1)*t*t + 1) + b;}
};
function panelChange(id, num, pre){
	for(var i=0; i<num;i++){
		removeClassName($(pre+'-item-' + i.toString()), 'selected');
		addClassName($(pre+'-content-' + i.toString()), 'hidden');
	}
	addClassName($(pre+'-item-' + id.toString()), 'selected');
	removeClassName($(pre+'-content-' + id.toString()), 'hidden');
}
function checkVote(o, id){
	var e = o.getElementsByTagName('input');
	var index = 0;
	for(var i=0;i<e.length;i++){
		if(e[i].type.toLowerCase() == 'checkbox' || e[i].type.toLowerCase() == 'radio'){
			if(e[i].checked == true) index++;
		}
	}
	if(index == 0){
		alert("请选择投票选项");
		return false;
	}
	$('vote-submit-'+id).disabled = true;
	return true;
};
qmeCms.tab = {
	tabTime:{},
	init:function(pre, index, num){
		var _o = this;
		clearTimeout(_o.tabTime[pre]);
		if(arguments.length == 3){
			return _o.tabTime[pre] = setTimeout(function(){
				_o.init(pre, index, num, 1);
			}, 200);
		};
		for(var i=0;i<num;i++){
			if(i == index){
				addClassName($(pre+'-tab-'+i.toString()), 'current');
				$(pre+'-tabc-'+i.toString()).style.display = '';
			}else{
				removeClassName($(pre+'-tab-'+i.toString()), 'current');
				$(pre+'-tabc-'+i.toString()).style.display = 'none';
			}
		}
	}
};
qmeCms.face = {
	show:function(obj, source){
		var source = source.parentNode;
		var id = 'source_' + obj;
		var div = $(id);
		var timer;
		if(div == null){
			var div = document.createElement('div');
			div.className = 'face-list';
			div.id = id;
			source.appendChild(div);
			var o = this;
			$$E.addEvent(source, 'click', function(e){
				var e = e || window.event;
				e.stopPropagation();
				div.style.display = 'block';
			});			
			$$E.addEvent(source, 'mouseout', function(){
				timer = setTimeout(function(){
					div.style.display = 'none';
				},500);
			});
			$$E.addEvent(source, 'mouseover', function(){
				clearTimeout(timer);
			});

			var s = [];
			for(var i=1;i<31;i++){
				s.push("<img src='"+config.url+"images/face/"+i+".gif' width='20' height='20' />");
			}
			div.innerHTML = s.join('');
			Each(div.getElementsByTagName('img'), function(i){
				$$E.addEvent(this, 'click', function(e){
					var e = e || window.event;
					e.stopPropagation();
					o.insertFace(i+1, obj, div);
					return false;
				});
			});
	
		}else{
			div.style.display = 'block';
		}
		document.body.focus();
		return false;
	},
	insertFace:function(id, obj, layout){
		var text = '[em:'+id+':]';
		if($(obj) != null) {
			this.insertContent(obj, text);
		}
		layout.style.display = 'none';
		return false;
	},
	insertContent:function(target, text) {
		var obj = $(target);
		selection = document.selection;
		if(!obj.hasfocus) obj.focus();
		if(typeof obj.selectionStart != 'undefined') {
			var opn = obj.selectionStart + 0;
			obj.value = obj.value.substr(0, obj.selectionStart) + text + obj.value.substr(obj.selectionEnd);
		} else if(selection && selection.createRange) {
			var sel = selection.createRange();
			sel.text = text;
			sel.moveStart('character', 0 - text.length);
		} else {
			obj.value += text;
		}
	}
};
qmeCms.digg = {
	key:'_digg',
	tip:'你已经顶过了，不要重复顶',
	maxLogNum:10,
	load:false,
	send:function(channelid, id, type){
		if(this.load == true) return false;
		this.load = true;
		var hasDigg = myCookie.get(this.key);
		var ik = channelid +'_'+ id;
		if(hasDigg){
			var ids = hasDigg.split('.');
			if(ids.indexOf(ik) > -1){
				alert(this.tip);
				this.load = false;
				return false;
			}
		}
		var o = this;
		var ctype = type == 'good' ?  1 : 0;
		AJAX.get(config.url + 'index.php?ac=digg&channelid='+channelid+'&id='+id+'&type='+ctype,function(resp){
			var json = evaljson(resp);
			if(json == null || typeof json['status'] == 'undefined') return false;
			if(!json['status']){
				o.load = false;
				return alert(o.tip);
			}
			if(hasDigg){
				var _diggTemp = hasDigg.split('.');
				while(_diggTemp.length > o.maxLogNum) _diggTemp.shift();
				hasDigg = _diggTemp.join('.');
			}
			myCookie.set(o.key, (hasDigg ? hasDigg +'.'+ ik : ik), 1);
			o.set(json['good'], json['bad']);
			o.load = false;
		});
		document.body.focus();
	},
	set:function(good, bad){
		var num = good + bad;
		var good_percent =  (num > 0 ? (good / num) : 0) * 100;
		var bad_percent =  (num > 0 ? (bad / num) : 0) * 100;
		$('digg_good_num').innerHTML = '('+good+')';
		$('digg_bad_num').innerHTML = '('+bad+')';
		$('digg_good_percent_num').innerHTML = good_percent .toString().substr(0,4) + '%';
		$('digg_bad_percent_num').innerHTML = bad_percent.toString().substr(0,4) + '%';
		$('digg_good_percent_bar').innerHTML = '<span style="width: '+good_percent  +'%;"></span>';
		$('digg_bad_percent_bar').innerHTML = '<span style="width: '+bad_percent +'%;"></span>';
	}
};
qmeCms.fck = {
	index:0,
	get:function(id){
		if($(id) == null) return false;
		var obj = $(id).getElementsByTagName('img');
		var temp = [];
		for(var i=0;i<obj.length;i++){
			if(obj[i].className.toString().substr(0,7) == 'plugin_' ){
				temp.push(obj[i]);
			}
		}
		while(temp.length > 0){
			var o = temp.shift(0);
			this.init(o);
		}
	},
	init:function(obj){
		if(obj.className.substr(0,7) != 'plugin_') return false;
		var type = obj.className.substr(8).toLowerCase();
		if(typeof this['_' + type] != 'function') return;
		this.index++;
		var width = obj.offsetWidth;
		var height = obj.offsetHeight;
		var span = document.createElement('span');
		span.className = obj.className;
		span.style.display = 'block';
		span.style.width = width + 'px';
		var html = this['_' + type](obj, obj.getAttribute('rel'),  width, height);
		try{
			span.innerHTML = html;
			obj.parentNode.replaceChild(span, obj);
		}catch(e){}
	},
	_flv:function(obj, url,  width, height){
		url = encodeURIComponent(url);
		var autostart = obj.getAttribute('autostart') ? 'true' : 'false';
		var autobuffer = obj.getAttribute('autobuffer') ? 'true' : 'false';
		var preview = obj.getAttribute('preview') ? obj.getAttribute('preview') : '';
		if(preview) preview = '{"url":"'+preview+'","scaling":"orig"},';
		var param = 'config={"playlist":['+preview+'{"url":"'+url+'","autoPlay":'+autostart+',"autoBuffering":'+autobuffer+',"scaling":"fit"}],"plugins":{"controls":{}},"canvas":{"backgroundColor":"#000000","backgroundGradient":"none"}}';
		param = param.replace(/\"/ig, "&quot;");
		return this.setFlash(config.url+'images/flowplayer.swf', param, width, height, 'fck_player');
	},
	_sound:function(obj, url,  width, height){
		var autostart = obj.getAttribute('autostart') ? 'yes' : 'no';
		var loop = obj.getAttribute('loop') ? 'yes' : 'no';
		var param = config.url + 'images/sound.swf?soundFile='+url+'&bg=0xFF6600&leftbg=0x357DCE&lefticon=0xF2F2F2&rightbg=0x357DCE&rightbghover=0x4499EE&righticon=0xF2F2F2&righticonhover=0xFFFFFF&text=0xFFFFFF&slider=0x357DCE&track=0xFFCC66&border=0xFFFFFF&loader=0x8EC2F4&autostart='+autostart+'&loop='+loop;
		return this.setFlash(param, '', width, height, 'fck_sound');
	},
	_flash:function(obj, url,  width, height){
		var vars = obj.getAttribute('vars') ? obj.getAttribute('vars').trim() : '';
		return this.setFlash(url, vars, width, height, 'fck_flash');
	},
	setFlash:function(src, vars, width, height, name){
		return ['<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+name+'_'+this.index+'">',
								'<param name="allowScriptAccess" value="sameDomain" />',
								'<param name="FlashVars" value="'+vars+'">',
								'<param name="allowFullScreen" value="true" />',
								'<param name="movie" value="'+src+'" />',
								'<param name="quality" value="high" />',
								'<param name="bgcolor" value="#000000" />',
								'<param name="wmode" value="transparent" />',
								'<embed src="'+src+'" wmode="transparent" FlashVars="'+vars+'" quality="high" bgcolor="#000000" width="'+width+'" height="'+height+'" name="'+name+'_'+this.index+'" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ></embed>',
							'</object>'].join('');
	}
};
qmeCms.textTip = {
	init:function(q, for_q){
		var q = $(q);
		var for_q = $(for_q);
		if(q==null || for_q==null) return;
		if(!q.value) for_q.style.display = '';
		var qonblur = function(){
			if(q.value.trim().length == 0) for_q.style.display = 'block';
			else for_q.style.display = 'none';
		};
		$$E.addEvent(q, 'focus', function(){
			for_q.style.display = 'none';
			if(this.getAttribute('rel') && this.value == ''){
				this.value = this.getAttribute('rel');
				this.select();
			}
		});
		$$E.addEvent(q, 'blur', qonblur);
		$$E.addEvent(for_q, 'click', function(){
			for_q.style.display = 'none';
			q.focus();
		});
		qonblur();
	}
};

qmeCms.adManager = {
	init:function(item){
		if(typeof this['_'+item['type']] != 'function') return;
		if(item['channelid'] > 0 && (typeof config == 'undefined' || parseInt(config.channelid) != parseInt(item['channelid']))) return;
		if(item['filter_val'].trim().length > 0){
			var u = window.location.href;
			if(parseInt(item['filter_type']) > 0){
				if(u.indexOf(item['filter_val'].trim()) > -1) return;
			}else{
				if(u.indexOf(item['filter_val'].trim()) == -1) return;
			}
		}
		this['_'+item['type']](item);
	},
	_word:function(item){
		document.write("<a href='"+item['link']+"' target='_blank'>"+item['word']+"</a>");
	},
	_img:function(item){
		var s = "<a href='"+item['link']+"' target='_blank'><img src='"+item['src']+"' width='"+item['width']+"' height='"+item['height']+"' border='0' alt='"+item['subject']+"' /></a>";
		document.write(s);
	},
	_newwin:function(item){
		var winer = null;
		var open = function(){
			if(winer != null){return true;};
			winer = window.open(item['link'], "money", "width="+item['width']+"px;height="+item['width']+"px;resizable=yes,toolbar=yes,scrollbars=yes,status=yes,alwaysLowered=yes");
			$$E.removeEvent(document.documentElement, 'click', open);
		};
		open();
		if(winer == null){
			$$E.addEvent(document.documentElement, 'click', open);
		};
	},
	_iframe:function(item){
		this.__writeIframe(item);
	},
	_flash:function(item){
		var template = ['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+item['width']+'" height="'+item['height']+'">',
			'<param name="movie" value="' +item['src']+ '" />',
			'<param name="menu" value="false" />',
			'<param name="wmode" value="transparent" />',
			'<embed src="' +item['src']+ '" width="'+item['width']+'" height="'+item['height']+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" menu="false"></embed>',
			'</object>'].join('');
		var html = "<div id='money-"+item['pid']+"' style='position:relative;width:"+item['width']+"px;height:"+item['width']+"px;margin:0;padding:0;'>"+template+"<a href='"+item['link']+"' target='_blank' style='position:absolute;left:0;top:0;width:"+item['width']+"px;height:"+item['width']+"px;border:0;display:block;background:url("+config.url+"images/blank.gif) no-repeat 0 0'></a></div>";
		document.write(html);
	},
	_code:function(item){
		item['link'] = config.url + '/cache/money/mm_' + item['pid'] + ".html";
		this.__writeIframe(item);
	},
	__writeIframe:function(item){
		document.write("<iframe src='"+item['link']+"?d="+item['modifytime']+"' frameborder='0' border='0' marginheight='0' marginwidth='0' scrolling='0' style='width:"+item['width']+"px;height:"+item['height']+"px;border:0;overflow:hidden'></iframe>");
	}
};
qmeCms.pay = {
	id:'pay-info',
	pay:function(param, url){
		var o  = this;
		Ajax.get(config.url + 'index.php?ac=pay&param='+param, function(resp){
			var json = evaljson(resp);
			if(json['status'] == 200){
				window.location.href = url + (url.match(/\?/) ? '&' : '?') + 'param=' + json['location'];
			}else{
				$(o.id).innerHTML = '<p>提示信息：'+json.message + '</p>';
			}
		});
	}
};
qmeCms.scroller = function(shell){
	var Class=function (shell){
		this.list=[];
		this.pauseTime=1000;
		this.speed=20;
		this.pauseSpace=0;
		this.dir=1;
		this.shell=$(shell);
	};
	Class.prototype={
		set:function (fn){
			fn.call(this);
			var _this = this;
			$$E.addEvent(this.shell, 'mouseover', function(){clearTimeout(_this.timer);});
			$$E.addEvent(this.shell, 'mouseout', function(){
				_this.timer = setTimeout(function(){_this.start();}, 2000)
			});
			return this;
		},run:function(){
			var inner=this.shell.getElementsByTagName('UL')[0];
			this.shell.appendChild(inner.cloneNode(true));
			this.start();
		},start:function(){
			var Hidden=this;
			var inner = this.shell.getElementsByTagName('ul')[1];
			(function (){
				with(Hidden){
					if(dir>0){
						if(++shell.scrollTop==inner.offsetHeight){shell.scrollTop=0;}
					}else{
						if(--shell.scrollTop<=0){shell.scrollTop=inner.offsetHeight;}
					}
					var interval=shell.scrollTop%pauseSpace?speed:pauseTime;					
				}
				Hidden.timer = setTimeout(arguments.callee,interval);
			})();
		}
	};
	return new Class(shell);
};
function addBookmark(title,url) {
	if (window.sidebar) window.sidebar.addPanel(title, url,"");
	else if( document.all )  window.external.AddFavorite( url, title);
	else if( window.opera && window.print )  return false;
}
function changeVerifyImage(){
	var o = $('verify_code_img');
	if(o == null) return false;
	o.src = config.url + 'code.php?height=30&bgcolor=ffffff&d='+(new Date()).toString();
	o.setAttribute('rel', '1');
	return false;
};
function focusVerifyImage(){
	var o = $('verify_code_img');
	if(o == null) return true;
	var index = parseInt(o.getAttribute('rel'));
	index = isNaN(index) ? 0 : index;
	if(index == 0){
		o.src = config.url + 'code.php?height=30&bgcolor=ffffff&d='+(new Date()).toString();
		o.setAttribute('rel', '1');
	}
	return true;
};
function showWordLinkTip(id){
	if($(id) == null) return false;
	Each($(id).getElementsByTagName('a'), function(){
		$$E.addEvent(this, 'mouseout', function(){
			removeClassName(this, 'hover');
		});
		$$E.addEvent(this, 'mouseover', function(){
			addClassName(this, 'hover');
			var r = this.href.replace(/\&/g, '-').replace(/=/g, '-');
			var a = r.indexOf('-u-');
			if(a == -1) return true;
			var sp = this.getElementsByTagName('span');
			if(sp.length > 0) return true;
			var c = r.substr(a+3); 
			var span = document.createElement('span');
			span.innerHTML = "数据加载中...";
			span.style.top = this.offsetHeight + 'px';
			span.className = 'link-view link-loading';
			span.onclick = function(){
				document.body.focus();
				return false;
			};
			this.style.position = 'relative';
			this.appendChild(span);
			AJAX.get(config.url + 'index.php?ac=url&u='+c, function(resp){
				var json = evaljson(resp);
				if(json != null && json['status'] == 200){
					span.innerHTML = "今日点击："+json['dview']+"次<br />一共点击："+json['views']+"次";
				}else{
					span.innerHTML = "系统似乎出了点问题";
				}
				removeClassName(span, 'link-loading');
			});
			return true;
		});
	});
}
function sourceHighLight(id){
	/*IE下代码高亮有问题，暂不用*/
	if($(id) == null) return false;
	var obj = $(id).getElementsByTagName('pre');
	if(obj.length == 0) return;
	var language = [];
	Each(obj, function(){
		if(this.className.toString().substr(0,3) == 'sh_' ){
			language.push(config.url + "images/js/lang/sh_" + this.className.toString().substr(3) + ".min.js");
		}
		this.innerHTML = this.innerHTML.replace(/\t/ig, '    ');
	});
	language.unshift(config.url + "images/js/sh_main.js");
	loadJS(language, function(){
		sh_highlightDocument();
		loadCSS(config.url + "images/js/css/sh_nedit.min.css");
	});
}
function commentCheck()
{
	var comment_guest = parseInt(config.comment_guest);
	if($('content').value.trim() == ""){
		alert("请填写你要评论的内容!");
		$('content').focus();
		return false ;
	}
	if ($('content').value.trim().length<4){
		alert("评论的内容不得小于4个字符");
		$('content').focus();
		return false;
	} 
	var o = $('replyForm').getElementsByTagName('input');
	var flag = false;
	for(var i=0;i<o.length;i++){
		if(o[i].type.toLowerCase() == 'radio' && o[i].getAttribute('name') == 'vote' && o[i].checked == true){
			flag = true;
			break;
		}
	}
	if(flag == false){
		alert("请给一个评价");
		return false;
	}
	if($('verify_code') != null && $('verify_code').value.trim().length != 4){
		alert("需要输入验证码");
		return false;
	}
	$('reply-submit').disabled = true;
	return true;
};