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) return event;
		event = window.event;
		event.pageX = event.clientX + D.getScrollLeft(event.srcElement);
		event.pageY = event.clientY + D.getScrollTop(event.srcElement);
		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};
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 true;if(obj.className.indexOf(name) > -1) return true;var n=obj.className;obj.className=n+' '+name;};
function removeClassName(obj,name){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 Ex(o){for(var k in o)this[k]=o[k];return this};
function UIs(tag){return Ex.call([],this.getElementsByTagName(tag))};
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){var init = function(){if (arguments.callee.done) return;arguments.callee.done = true;if (window.__load_timer){clearInterval(window.__load_timer);window.__load_timer = null;};for (var i=0;i < window.__load_events.length;i++){window.__load_events[i]();};window.__load_events = null;};if (document.addEventListener){document.addEventListener("DOMContentLoaded", init, false);};if (/WebKit/i.test(navigator.userAgent)){window.__load_timer = setInterval(function(){if (/loaded|complete/.test(document.readyState)){init();};}, 10);};window.onload = 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, 100);
		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);
}
(function(){
	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(){};
		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);
		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){
					try{
						this.options.onComplete(this.transport.responseXML.documentElement.firstChild.nodeValue);
					}catch(e){
						this.options.onComplete('');
					}
				}else{
					alert("似乎出了点问题，请重试");
					window.location.href = window.location.href.split('#')[0];
				}
			}else{
				this.options.onComplete('');
			}
		}catch(e){}
		this.activeRequestCount = 0;
	},
	close: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){
			if(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 = 10, 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');
}

var dialogView = {
	stop:false,
	IE6:$$B.ie6,
	listenTimer:0,
	closeTimer:0,
	iframeIndex:0,
	docReady:0,
	configDefault:{width:500,left:0,top:40,type:'abs'},
	config:{width:500,left:0,top:40,type:'abs'},
	form:function(title, message, option){
		clearTimeout(this.closeTimer);
		var html = "<div class='b-g'><div class='hd' id='dialog-title'><h4>"+title+"</h4></div><div class='bd' id='dialog-content'>"+message+"</div><div class='ft' id='dialog-ft'><input type='button' id='dialog-submit' class='f-button hidden' style='color:black' value='&#30830;&#23450;'/><input type='button' id='dialog-cancel' onclick='return dialogView.close()' class='f-button' style='color:black' value='关闭'/><a class='dialog-close' href='#' onclick='return dialogView.close()'></a></div><div class='underlay' id='dialog-underlay'><p></p></div></div>";
		var obj = $('dialog-advanced');
		if(obj != null) this.close();
		var option = option || {};
		$$.extend(this.config, option);
		if($('shield') == null){
			var obj = document.createElement("DIV");
			obj.id = "shield";
			document.body.insertBefore(obj, document.body.firstChild);
		}else{
			var obj = $('shield');
		}
		obj.style.height = Math.max(document.body.offsetHeight, document.documentElement.clientHeight) + 'px';
		if(this.IE6 && obj.getElementsByTagName('iframe').length == 0) obj.innerHTML = '<iframe src="about:blank" frameBorder=0 scrolling=no style="width:100%;height:100%;filter:alpha(opacity=0);opacity:0"></iframe>';
		obj.style.display = 'block';
		var obj = document.createElement('DIV');
		obj.className = 'dialog-advanced';
		obj.id = 'dialog-advanced';
		obj.innerHTML = html;
		document.body.insertBefore(obj, document.body.firstChild);
		if(!message) this.loading('数据加载中，请等待....');
		this.setPostion(obj);
		this.stop = false;
		this.listen();
	},
	get:function(title, url, option){
		var _o = this;
		this.form(title, "<p class='loading'>数据加载中，请等待....</p>", option);
		setTimeout(function(){
			AJAX.request(url,{method:'get',onComplete:function(resp){
				_o.setMessage(resp);
			}});
		},100);
	},
	iframe:function(title, url, option){
		if(!this.docReady){
			var o = this;
			o.alert('提示信息','', option);
			return setTimeout(function(){
				o.iframe(title, url, option);
			},500);
		}
		this.iframeIndex++;
		var title = title || '数据';
		this.form(title, "", option);
		var iframe = document.createElement("iframe");
		iframe.id = 'ajaxIframe_'+this.iframeIndex;
		iframe.setAttribute('frameBorder', '0');
		iframe.style.width = '100%';
		iframe.style.height = '50px';
		iframe.style.border = '0';
		iframe.setAttribute('scroll', 'no');
		iframe.style.overflow = 'hidden';
		iframe.src = url;
		$('dialog-content').appendChild(iframe);
		iframe.onload = function(){
			dialogView.iframeOnload();
		}
		$('ajaxIframe_'+this.iframeIndex).name = 'ajaxIframe_'+this.iframeIndex;
	},
	iframeOnload:function(){
		if($('dialog-loading') != null) $('dialog-content').removeChild($('dialog-loading'));
		dialogView.reHeight();
	},
	reHeight:function(h){
		if($('ajaxIframe_'+this.iframeIndex) == null) return;
		if(!h){
			var o = $('ajaxIframe_'+this.iframeIndex);
			var oh = parseInt(o.style.height);
			var doc = o.contentWindow.document;
			var h = Math.max(doc.body.offsetHeight, doc.documentElement.clientHeight);
		}
		$('ajaxIframe_'+this.iframeIndex).style.height = h + 'px';
	},
	ajaxGet:function(url, callBack){
		AJAX.request(url,{method:'get',onComplete:function(resp){
			callBack(resp);
		}});
	},
	listen:function(){
		if($('dialog-advanced') == null) return false;
		if(!this.IE6) return false;
		var o = this;
		var underlayHeight = 0;
		var change = function(){
			if(o.stop == true) return false;
			var advancedHeight = $('dialog-advanced').offsetHeight;
			if(underlayHeight == advancedHeight) return false;
			$('dialog-underlay').style.height = advancedHeight.toString() + 'px';
			underlayHeight = advancedHeight;
		};
		setInterval(change, 50);
		change();
	},
	setPostion:function(obj){
		var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
		var o = this;
		$$E.removeEvent(window, 'scroll', function(){
			obj.style.top = o.config.top + scrollTop + 'px';
		});
		if(this.config.type == 'fixed'){
			if(this.IE6){
				$$E.addEvent(window, 'scroll', function(){
					obj.style.top = o.config.top + scrollTop + 'px';
				});
			}else{
				obj.style.position = 'fixed';
			}
			obj.style.top = this.config.top + 'px';
		}else{
			obj.style.position = 'absolute';
			obj.style.top = this.config.top + scrollTop + 'px';
		}
		obj.style.width = this.config.width + 'px';
		if(this.config.left != 0){
			obj.style.left = this.config.left + 'px';
		}else{
			obj.style.left =  '50%';
			obj.style.marginLeft = (0-obj.offsetWidth)/2 + 'px';
		}
	},
	close:function(){
		clearTimeout(this.closeTimer);
		if(arguments.length > 0) return this.closeTimer = setTimeout(function(){
			dialogView.close()
		}, arguments[0]);
		clearInterval(this.listenTimer);
		this.stop = true;
		if($('dialog-advanced') == null) return false;
		var obj = $('dialog-advanced');
		while(obj.getElementsByTagName('iframe').length > 0){
			var p = obj.getElementsByTagName('iframe')[0];
			p.parentNode.removeChild(p);
		}
		obj.parentNode.removeChild(obj);
		$('shield').parentNode.removeChild($('shield'));
		this.config.width = this.configDefault.width;
		this.config.left = this.configDefault.left;
		this.config.top = this.configDefault.top;
		this.config.type = this.configDefault.type;
		return false;
	},
	setSubmit:function(type,value, call){
		if($('dialog-submit') == null) return false;
		var obj = $('dialog-submit');
		if(type == true){
			removeClassName(obj, "hidden");
		}else{
			addClassName(obj, "hidden");
		};
		if(value) $('dialog-submit').value = value;
		if(typeof call == 'function') $('dialog-submit').onclick = call;
	},
	setCancel:function(value, call){
		if($('dialog-cancel') == null) return false;
		var obj = $('dialog-cancel');
		if(value) $('dialog-cancel').value = value;
		if(call) $('dialog-cancel').onclick = call;
	},
	setMessage:function(message){
		if($('dialog-content') != null){
			$('dialog-content').innerHTML = message;
		}
		evalscript(message);
	},
	loading:function(message){
		this.setMessage("<p class='loading' id='dialog-loading'>"+message+"</p>");
	},
	alert:function(title, message){
		this.form(title, message, {type:'abs'});
		this.setSubmit(false);
	}
};
$$E.addEvent(window, 'load', function(){dialogView.docReady=1;});
function productHelp(id, obj){
	Ajax.get(config.url + "index.php?module=api&action=help&id="+id, function(resp){
		var json = evaljson(resp);
		if(json['status'] == 404 || json['status'] == 403){
			alert(json.message);
		}else if(json['status'] == 302){
			window.location.href= json.message;
		}else if(json.status == 200){
			obj.innerHTML = "有帮助 " + json.message;
		}
	});
};
function changeVerifyImage(o, type)
{
	var type = type || 'code';
	if(o == null) return false;
	o.src = config.url + 'code.php?bgcolor=ffffff&type='+type+'&d='+(new Date()).toString();
	o.setAttribute('rel', '1');
	return false;
};
function productHuiying(id, obj){
	dialogView.get('回应', config.url + "index.php?module=api&action=huiying&id="+id, {width:600});
	return false;
};
function productZixun(id, isbrand){
	dialogView.get('咨询', config.url + "index.php?module=api&action=zixun&id="+id+"&isbrand="+isbrand, {width:600});
	return false;
};
function productFav(id){
	dialogView.get('收藏', config.url + "index.php?module=api&action=fav&type=product&id="+id, {width:600});
	return false;
};
function brandFav(id){
	dialogView.get('收藏', config.url + "index.php?module=api&action=fav&type=brand&id="+id, {width:600});
	return false;
};
function productPrice(id){
	dialogView.get('价格监督', config.url + "index.php?module=api&action=control&id="+id, {width:600});
	return false;
};
function productMoney(id){
	dialogView.get('降价通知', config.url + "index.php?module=api&action=price&id="+id, {width:600});
	return false;
}
function groupAdd(id){
	dialogView.get('提供团购信息', config.url + "index.php?module=api&action=group&id="+id, {width:600});
	return false;
}
function getaddrsms(uid, kid, type, pid){
	Ajax.get(config.url + "index.php?module=api&action=sms&op=check&uid="+uid, function(resp){
		if(resp == 'overcnt'){
			alert('会员在一天最多只能发送20条短信，您今天已经超过发送的上限，请明天再操作');
			return false;
		}

		if(resp == 'ok'){
			dialogView.get('输入手机号', config.url + "index.php?module=api&action=sms&kid="+kid+"&type="+type+"&pid="+pid+"&op=input", {width:400});
			return false;
		}
	});
}
var viewLog = {
	'add':function(id){
		domReady(function(){
			var img = document.createElement('img');	
			img.src = config.url + "index.php?module=api&action=view_log&id="+id;
			img.style.display = 'none';
			document.body.appendChild(img);
		});
		var d = this.get();
		if(d.inArray(id)) return;
		d.unshift(id);
		while(d.length > 10){
			d.pop();
		}
		myCookie.set('_views', d.join('_'));
	},
	'add_model':function(id){
	    var m=this.get_model();
		if(m.inArray(id)) return ;
		m.unshift(id);
		while(m.length>10){
			m.pop();
		}
		myCookie.set('_model',m.join('_'));
	},
	'get':function(){
		var s = myCookie.get('_views').toString().trim();
		return s ? s.split('_') : [];
	},
	'get_model':function(){
		var s = myCookie.get('_model').toString().trim();
		return s ? s.split('_') : [];
	},
	'show':function(obj){
		var ids = this.get();
		if(ids.length == 0) return;
		Ajax.get(config.url + "index.php?module=api&action=views&ids="+ids.join(','), function(resp){
			obj.innerHTML = resp;			
		});       
	},
	'Prod_show':function(obj){
		var ids = this.get();
		
		if(ids.length == 0) return;
		
		Ajax.get(config.url + "index.php?module=api&action=prod_views&ids="+ids.join(','), function(resp){
		    
			obj.innerHTML = resp;	 		
		});       
	},
	'model_show':function(obj){
		var ids = this.get_model();
		
		if(ids.length == 0) return;
		
		Ajax.get(config.url + "index.php?module=api&action=model_views&ids="+ids.join(','), function(resp){
		    
			obj.innerHTML = resp;	 		
		});       
	},
	'cuxiao_show':function(obj,id){			
		if(id.length == 0) return;
		
		Ajax.get(config.url + "index.php?module=api&action=cuxiao_views&id="+id, function(resp){																					  
			obj.innerHTML = resp;	 		
		});       
	}
}
function group_ajax(type)
{
	var form = document.forms.theForm;
	var email = form.email.value;
	if(!email)
	{
		alert('请输入订阅的email地址');
		return false;
	}

	var i=email.indexOf("@");
	var j=email.indexOf(".");
	if((i<0)||(i-j>0)||(j<0)){
		alert('请输入正确的E-mail地址！');
		return false;
	}

	Ajax.get(form.action+"&type="+type+"&email="+email, function(resp){
		alert("恭喜您，订阅操作已成功");
		return true;
	});
}
function favourite_ajax(type, id, name)
{
	var url = "index.php?module=ajax&action="+type+"&id="+id+"&name="+encodeURIComponent(name);
	Ajax.get(url, function(resp){
		var tip = (type == 'brand') ? '品牌' : '商品';
		alert("恭喜您，收藏"+tip+"：'"+name+"' 成功");
		if($('btnfav')){$('btnfav').innerHTML = "<a href='###' style='cursor:default'>已收藏</a>";}
		if($('divfav')){$('divfav').innerHTML = "已收藏";}
		if($('lifav')){$('lifav').innerHTML = "已收藏";}
		return true;
	});
}

function telme_ajax(orderid, callphone)
{
	var url = "index.php?module=ajax&action=telme&id="+orderid+"&mobile="+callphone+"&name="+encodeURIComponent(name);
	Ajax.get(url, function(resp){
		alert("登记成功！");
		return true;
	});
}
function vote_help_ajax(id)
{
	var url = "index.php?module=ajax&action=votehelp&id="+id;
	Ajax.get(url, function(resp){
		alert("感谢您的评价");
		return false;
	});
}
function zixun_help_ajax(id)
{
	var url = "index.php?module=ajax&action=zixunhelp&id="+id;
	Ajax.get(url, function(resp){
		var json = evaljson(resp);
		if(json['status'] == 404 || json['status'] == 403){
			alert(json.message);
		}else if(json.status == 200){
			alert("感谢您的评价");
			obj.parentNode.style.display = 'none';
		}
		return false;
	});
}
function setZxTab(tp, obj)
{
	var arr = ['all', 'pay', 'order'];
	for(var i=0; i<arr.length; i++)
	{
		if(arr[i] == tp){
			$('li_'+arr[i]).className = 'current';
			$(arr[i]).className = '';
		}else{
			$('li_'+arr[i]).className = '';
			$(arr[i]).className = 'hidden';
		}
	}
}
function shownavlist(obj)
{
	var p=obj.parentNode.parentNode;
	var ul=p.getElementsByTagName('ul');
	if(p.className.indexOf('current') != -1){
		p.className='item';
		ul[0].style.display='none';
	}else{
		p.className='item current';
		ul[0].style.display='';
	}
}
function showpic(obj)
{
	var p=obj.parentNode;
	var pp=p.parentNode;
	var lis=pp.getElementsByTagName('li');
	for(var i=0; i<lis.length; i++)
	{
		var li = lis[i];
		if(li.className == 'top')
		{
			var img = li.getElementsByTagName('img')[0];
			img.style.display = 'none';
			li.className = '';
		}
	}
	p.className='top';
	var img = p.getElementsByTagName('img')[0];
	img.style.display = '';
}
function cmtreply(uid, cid)
{
	var reply = $('pros').value;
	if(!reply){
		alert('请输入回复的内容');
		return false;
	}

	if(reply.length > 1000){
		alert('回复的内容超过1000字的长度限制');
		return false;
	}

	if(!$('check').value){
		alert('请输入验证码');
		return false;
	}

	Form.send('addreply', function(resp){
		if(resp == '"errcode"'){
			alert('验证码错误');
		}else if(resp == '"errself"'){
			alert('自己不能回应自己的评价');
		}else{
			window.location.reload();
		}
		return false;
	});
}
function sendVote(id){
	Ajax.get("index.php?module=api&action=vote&id="+id, function(resp){});
	return false;
}
var wowo = {};
wowo.tabEvent = {
	init:function(id){
		var tab = $('menu' + id.toString()).getElementsByTagName('li');
		var content = $('content' + id.toString()).getElementsByTagName('dl');
		Each(tab, function(i){
			var o = this;
			this.onclick = function(){
				Each(tab, function(j){
					if(i == j){
						addClassName(this, 'current');
					}else{
						removeClassName(this, 'current');
					}
				});
				Each(content, function(k){
					if(i == k){
						this.className = 'block';
					}else{
						this.className = 'hidden';
					}
				});
				return false;
			}
		});
	}
}
function copyLink(txt){
	if(window.clipboardData) {
		window.clipboardData.clearData();
		window.clipboardData.setData("Text", txt);
		return true;
	} else if(navigator.userAgent.indexOf("Opera") != -1) {
		window.location = txt;
		return true;
	} else if (window.netscape) {
		alert("您的firefox安全限制限制您进行剪贴板操作");
	}
	return false;
}

function share_to(m) {
	var _user_id = isNaN(parseInt(myCookie.get('userid'))) ? 0 : parseInt(myCookie.get('userid'));
	if(_user_id > 0){
		var du = document.location.href;
		var _url = du + (du.match(/\?/) ? '&' : '?') + "recommend="+_user_id;
		if(_url.indexOf('module=user') > -1){
			if(du.indexOf('vip') > -1){
				_url = 'http://' + document.location.host + "/index.php?module=api&action=vip&source="+_user_id;
			}else if(du.indexOf('recommend') > -1){
				_url = 'http://' + document.location.host + "/index.php?recommend="+_user_id;
			}else if(du.indexOf('pic') > -1){
				_url = 'http://' + document.location.host + "/index.php?module=user&action=pictures&uid="+_user_id+"&recommend="+_user_id;
			}else if(du.indexOf('vote') > -1){
				_url = 'http://' + document.location.host + "/index.php?module=user&action=comment&uid="+_user_id+"&cid=3&recommend="+_user_id;
			}else{
				_url = 'http://' + document.location.host + "/index.php?recommend="+_user_id;
			}
		}
	}else{
		var _url = document.location.href;
	}
	if (m == "baidu") {
		window.open('http://cang.baidu.com/do/add?it='
						+ encodeURIComponent(document.title.substring(0, 76))
						+ '&iu=' + encodeURIComponent(_url)
						+ '&fr=ien#nw=1', 'baidu',
						'scrollbars=no,width=600,height=450,status=no,resizable=yes,left='
						+ (screen.width - 600) / 2 + ',top='
						+ (screen.height - 450) / 2);
	} else if (m == "qq") {
		window.open(
						'http://shuqian.qq.com/post?from=3&title='
								+ encodeURIComponent(document.title) + '&uri='
								+ encodeURIComponent(_url)
								+ '&jumpback=2&noui=1',
						'favit',
						'width=930,height=470,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes,left='
						+ (screen.width - 930) / 2 + ',top='
						+ (screen.height - 470) / 2);
	} else if (m == "tsina") {
		void ((function(s, d, e) {
			try {
			} catch (e) {
			}
			var f = 'http://v.t.sina.com.cn/share/share.php?', u = _url, p = [
					'url=', e(u), '&title=', e(d.title), '&appkey=2924220432' ]
					.join('');
			function a() {
				if (!window
						.open(
								[ f, p ].join(''),
								'mb',
								[
										'toolbar=0,status=0,resizable=1,width=620,height=450,left=',
										(s.width - 620) / 2, ',top=',
										(s.height - 450) / 2 ].join('')))
					u.href = [ f, p ].join('');
			}
			;
			if (/Firefox/.test(navigator.userAgent)) {
				setTimeout(a, 0)
			} else {
				a()
			}
		})(screen, document, encodeURIComponent));
	} else if (m == "douban") {
		void (function() {
			var d = document, e = encodeURIComponent, s1 = window.getSelection, s2 = d.getSelection, s3 = d.selection, s = s1 ? s1()
					: s2 ? s2() : s3 ? s3.createRange().text : '', r = 'http://www.douban.com/recommend/?url='
					+ e(_url)
					+ '&title='
					+ e(d.title)
					+ '&sel='
					+ e(s) + '&v=1', x = function() {
				if (!window.open(r, 'douban',
								'toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=355,left='
									+ (screen.width - 450) / 2 + ',top='
									+ (screen.height - 330) / 2))
					location.href = r + '&r=1'
			};
			if (/Firefox/.test(navigator.userAgent)) {
				setTimeout(x, 0)
			} else {
				x()
			}
		})();
	} else if (m == "renren") {
		 void ((function(s, d, e) {
		 if (/renren\.com/.test(d.location)) return;
		 var f = 'http://share.renren.com/share/buttonshare.do?link=', u =d.location, l = d.title, p = [e(_url), '&title=', e(l) ].join('');
		 function a() {
		 if (!window.open([ f, p ].join(''), 'xnshare',
		 [ 'toolbar=0,status=0,resizable=1,width=626,height=436,left=',
		 (s.width - 626) / 2, ',top=',
		 (s.height - 436) / 2 ].join('')))
		 u.href = [ f, p ].join('');
		 }
		 ;
		 if (/Firefox/.test(navigator.userAgent))
		 setTimeout(a, 0);
		 else
		 a();
		 })(screen, document, encodeURIComponent));
	} else if (m == "kaixin001") {
		var kw = window
				.open(
						'',
						'kaixin001',
						'toolbar=no,titlebar=no,status=no,menubar=no,scrollbars=no,location:no,directories:no,width=570,height=350,left='
								+ (screen.width - 570)
								/ 2
								+ ',top='
								+ (screen.height - 420) / 2);
		var tempForm = kw.document.createElement('form');
		function openPostWindow(url, data, name) {
			var tempForm = document.createElement('form');
			tempForm.id = 'tempForm1';
			tempForm.method = 'post';
			tempForm.action = url;
			tempForm.target = 'kaixin001';
			var hideInput = document.createElement('input');
			hideInput.type = 'hidden';
			hideInput.name = 'rcontent';
			hideInput.value = data;
			tempForm.appendChild(hideInput);
			document.body.appendChild(tempForm);
			tempForm.submit();
			document.body.removeChild(tempForm);
		}
		function add2Kaixin001() {
			var u = _url;
			var t = document.title;
			var c = '' + (document.getSelection ? document.getSelection()
					: document.selection.createRange().text);
			var iframec = '';
			var url = 'http://www.kaixin001.com/repaste/bshare.php?rtitle='
					+ encodeURIComponent(t) + '&rurl=' + encodeURIComponent(u)
					+ '&from=maxthon';
			var data = encodeURIComponent(c);
			openPostWindow(url, c, '_blank')
		}
		add2Kaixin001();
	} else if (m == "google") {
		void (function() {
			var a = window, b = document, c = encodeURIComponent, d = a
					.open(
							'http://www.google.com/bookmarks/mark?op=edit&hl=zh-CN&output=popup&bkmk='
									+ c(_url) + '&title=' + c(b.title),
							'bkmk_popup',
							'left='
									+ ((a.screenX || a.screenLeft) + 10)
									+ ',top='
									+ ((a.screenY || a.screenTop) + 10)
									+ ',height=420px,width=550px,resizable=1,alwaysRaised=1');
			a.setTimeout(function() {
				d.focus()
			}, 300)
		})();
	} else if (m == "taojianghu") {
		window.open("http://share.jianghu.taobao.com/share/addShare.htm?url="
				+ encodeURIComponent(_url), 'taojianghu',
				'toolbar=0,status=0,width=550,height=400,left='
						+ (screen.width - 550) / 2 + ',top='
						+ (screen.height - 500) / 2);
	} else if (m == "gmail") {
		var a = window, b = document, c = encodeURIComponent;
		var w = window.open(
				"https://mail.google.com/mail/?view=cm&fs=1&tf=1&ui=2&shva=1&to&su="
						+ c(b.title) + "&body=" + c(_url), 'gmail',
				'width=' + (window.innerWidth * 0.57) + ',height='
						+ (window.innerHeight * 4 / 5) + ',left='
						+ ((a.screenX || a.screenLeft) + 10) + ',top='
						+ ((a.screenY || a.screenTop) + 10));
	} else if (m == "yahoo") {
		window
				.open('http://myweb.cn.yahoo.com/popadd.html?url='
						+ encodeURIComponent(_url)
						+ '&title=' + encodeURIComponent(document.title),
						'Yahoo',
						'scrollbars=yes,width=440,height=440,left=80,top=80,status=yes,resizable=yes');

	} else if (m == "douban9") {
		void (function() {
			var d = document, e = encodeURIComponent, s1 = window.getSelection, s2 = d.getSelection, s3 = d.selection, s = s1 ? s1()
					: s2 ? s2() : s3 ? s3.createRange().text : '', r = 'http://www.douban.com/recommend/?url='
					+ e(_url)
					+ '&title='
					+ e(d.title)
					+ '&sel='
					+ e(s) + '&v=1&n=1', x = function() {
				if (!window
						.open(r, 'douban9',
								'toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330'))
					location.href = r + '&r=1'
			};
			if (/Firefox/.test(navigator.userAgent)) {
				setTimeout(x, 0)
			} else {
				x()
			}
		})();
	} else if (m == "115") {
		var sel = '' + (document.getSelection ? document.getSelection()
				: document.selection.createRange().text);
		var url = _url;
		var title = document.title;
		var c = encodeURIComponent;
		void (window.open('http://fav.115.com/?ac=add&title=' + c(title)
				+ '&url=' + c(url) + '&c=' + c(sel), '115',
				'toolbar=0,status=0,width=780,height=700,left='
						+ (screen.width - 780) / 2 + ',top='
						+ (screen.height - 700) / 2));
	} else if (m == "51") {
		try {
			var w = window.open(
					"http://share.51.com/share/share.php?type=8&title="
							+ encodeURIComponent(document.title) + '&vaddr='
							+ encodeURIComponent(_url), '51',
					'toolbar=0,status=0,width=780,height=700,left='
							+ (screen.width - 780) / 2 + ',top='
							+ (screen.height - 700) / 2);
			window.opener.focus();
		} catch (e) {
		}
	} else if (m == "tsohu") {// 非官方
		void ((function(s, d, e) {
			var f = 'http://t.sohu.com/third/post.jsp?link=', u = d.location;
			function a() {
				if (!window
						.open(
								[ f, e(_url) ].join(''),
								'tsohu',
								[
										'toolbar=0,status=0,resizable=1,width=660,height=470,left=',
										(s.width - 660) / 2, ',top=',
										(s.height - 470) / 2 ].join('')))
					u.href = [ f, e(_url) ].join('');
			}
			;
			if (/Firefox/.test(navigator.userAgent))
				setTimeout(a, 0);
			else
				a();
		})(screen, document, encodeURIComponent));
	} else if (m == "leshou") {
		window
				.open('http://leshou.com/post?act=shou&reuser=&url='
						+ encodeURIComponent(_url) + '&title='
						+ encodeURIComponent(document.title)
						+ '&intro=&tags=&tool=1', 'leshou',
						'scrollbars=yes,width=700,height=500,left=80,top=80,status=no,resizable=yes');
		return false;
	} else if (m == "vivi") {
		var sel = '' + (document.getSelection ? document.getSelection()
				: document.selection.createRange().text);
		var url = _url;
		var title = document.title;
		void (window
				.open('http://vivi.sina.com.cn/collect/icollect.php?title='
						+ escape(title) + '&url=' + escape(url) + '&desc='
						+ escape(sel), '_blank',
						'scrollbars=no,width=480,height=480,left=75,top=50,status=no,resizable=yes'))
	} else if (m == "bai") {
		void ((function(s, d, e) {
			var f = 'http://bai.sohu.com/share/blank/addbutton.do?link=', u = d.location, l = d.title, p = [
					e(_url), '&title=', e(l) ].join('');
			function a() {
				if (!window
						.open(
								[ f, p ].join(''),
								'sohushare',
								[
										'toolbar=0,status=0,resizable=1,width=480,height=340,left=',
										(s.width - 480) / 2, ',top=',
										(s.height - 340) / 2 ].join('')))
					u.href = [ f, p ].join('');
			}
			;
			if (/Firefox/.test(navigator.userAgent))
				setTimeout(a, 0);
			else
				a();
		})(screen, document, encodeURIComponent));
	} else if (m == "qzone") {// 未开放分享
		window.open(
				"http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="
						+ encodeURIComponent(_url), 'qzone',
				'toolbar=0,status=0,width=900,height=760,left='
						+ (screen.width - 900) / 2 + ',top='
						+ (screen.height - 760) / 2);
	} else if (m == "live") {
		window
				.open(
						"https://skydrive.live.com/sharefavorite.aspx/.SharedFavorites/?marklet=1&mkt=zh-CN&top=1&url="
								+ encodeURIComponent(_url)
								+ "&title="
								+ encodeURIComponent(document.title), 'live',
						'toolbar=0,status=0,width=850,height=530,left='
								+ (screen.width - 850) / 2 + ',top='
								+ (screen.height - 530) / 2);
	} else if (m == "greader") {
		var b = document.body;
		var GR________bookmarklet_domain = 'http://www.google.com';
		if (b && !document.xmlVersion) {
			void (z = document.createElement('script'));
			void (z.src = 'http://www.google.com/reader/ui/link-bookmarklet.js');
			void (b.appendChild(z));
		} else {
		}
	} else if (m == "itieba") {// 未开放分享
		var sendT = {
			getContent : function() {
				var allPageTagss = document.getElementsByTagName("div");
				for ( var i = 0; i < allPageTagss.length; i++) {
					if (allPageTagss[i].className == 'content') {
						return allPageTagss[i].innerHTML;
					} else if (allPageTagss[i].className == 'content_txt') {

						return allPageTagss[i].getElementsByTagName("P")[0].innerHTML;
					}

				}
			}
		}
		var itieba_share = 'http://tieba.baidu.com/i/sys/share?link='
				+ encodeURIComponent(_url) + '&type='
				+ encodeURIComponent('text') + '&title='
				+ encodeURIComponent(document.title.substring(0, 76))
				+ '&content=' + encodeURIComponent(sendT.getContent());
		if (!window
				.open(itieba_share, 'itieba',
						'toolbar=0,resizable=1,scrollbars=yes,status=1,width=626,height=436')) {
			location.href = itieba_share;
		}
	} else if (m == "hexun") {
		var t = document.title;
		var u = _url;
		var e = document.selection ? (document.selection.type != 'None' ? document.selection
				.createRange().text
				: '')
				: (document.getSelection ? document.getSelection() : '');
		void (window.open('http://bookmark.hexun.com/post.aspx?title='
				+ escape(t) + '&url=' + escape(u) + '&excerpt=' + escape(e),
				'HexunBookmark',
				'scrollbars=no,width=600,height=580,status=no,resizable=yes,left='
						+ (screen.width - 600) / 2 + ',top='
						+ (screen.height - 580) / 2));
	} else if (m == "t163") {
		(function() {
			var url = 'link=http://www.shareto.com.cn/&source='
					+ encodeURIComponent('网易新闻   ') + '&info='
					+ encodeURIComponent(document.title) + ' '
					+ encodeURIComponent(_url);
			window
					.open(
							'http://t.163.com/article/user/checkLogin.do?'
									+ url + '&' + new Date().getTime(),
							't163',
							'height=330,width=550,top='
									+ (screen.height - 280)
									/ 2
									+ ',left='
									+ (screen.width - 550)
									/ 2
									+ ', toolbar=no, menubar=no, scrollbars=no,resizable=yes,location=no, status=no');
		})()
	} else if (m == "xianguo") {
		void (function() {
			var d = document, e = encodeURIComponent, s1 = window.getSelection, s2 = d.getSelection, s3 = d.selection, s = s1 ? s1()
					: s2 ? s2() : s3 ? s3.createRange().text : '', r = 'http://xianguo.com/service/submitfav/?link='
					+ e(_url)
					+ '&title='
					+ e(d.title)
					+ '&notes='
					+ e(s), x = function() {
				if (!window
						.open(r + '&r=0', 'xgfav',
								'toolbar=0,resizable=1,scrollbars=yes,status=1,width=800,height=600'))
					location.href = r + '&r=1'
			};
			if (/Firefox/.test(navigator.userAgent)) {
				setTimeout(x, 0)
			} else {
				x()
			}
		})()
	} else if (m == 'hotmail') {
		window.open("http://mail.live.com/secure/start?action=compose&subject="
				+ encodeURIComponent(document.title) + "&body="
				+ encodeURIComponent(_url), 'hotmail',
				'toolbar=0,status=0,width=1010,height=700,left='
						+ (screen.width - 1010) / 2 + ',top='
						+ (screen.height - 700) / 2);
	} else if (m == "delicious") {
		(function() {
			f = 'http://delicious.com/save?url='
					+ encodeURIComponent(_url) + '&title='
					+ encodeURIComponent(document.title) + '&v=5&';
			a = function() {
				if (!window
						.open(f + 'noui=1&jump=doclose', 'deliciousuiv5',
								'location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550'))
					location.href = f + 'jump=yes'
			};
			if (/Firefox/.test(navigator.userAgent)) {
				setTimeout(a, 0)
			} else {
				a()
			}
		})()
	} else if (m == "digg") {
		window.open("http://digg.com/submit?type=0&url="
				+ encodeURIComponent(_url), 'digg',
				'toolbar=0,status=0,width=965,height=700,left='
						+ (screen.width - 965) / 2 + ',top='
						+ (screen.height - 700) / 2);
	} else if (m == "translate") {
		var t = ((window.getSelection && window.getSelection())
				|| (document.getSelection && document.getSelection()) || (document.selection
				&& document.selection.createRange && document.selection
				.createRange().text));
		var e = (document.charset || document.characterSet);
		if (t != '') {
			window.open('http://translate.google.cn/?text=' + t
					+ '&hl=zh-CN&langpair=auto|zh-CN&tbb=1&ie=' + e,
					'gtranslate');
		} else {
			window.open('http://translate.google.cn/translate?u='
					+ encodeURIComponent(_url)
					+ '&hl=zh-CN&langpair=auto|zh-CN&tbb=1&ie=' + e,
					'gtranslate');
		}
		;
	} else if (m == "buzz") {
		window
				.open(
						"http://www.google.com/buzz/post?hl=zh-CN&url="
								+ encodeURIComponent(_url),
						'buzz',
						"width=716,height=480,location=yes,scrollbars=yes,menubar=no,toolbar=no,dialog=yes,alwaysRaised=yes");
	} else if (m == "pdf") {
		var authorId = "ECF83C2F-F3A3-45DE-8A44-2A36A9A9A1FB";
		var pageOrientation = "1";
		var topMargin = "0.5";
		var bottomMargin = "0.5";
		var leftMargin = "0.5";
		var rightMargin = "0.5";
		function savePageAsPDF() {
			var sUriRequest = "";

			sUriRequest = "author_id=" + authorId;
			sUriRequest += "&page=" + pageOrientation;
			sUriRequest += "&top=" + topMargin;
			sUriRequest += "&bottom=" + bottomMargin;
			sUriRequest += "&left=" + leftMargin;
			sUriRequest += "&right=" + rightMargin;

			// savepageaspdf.pdfonline.com
			var pURL = "http://savepageaspdf.pdfonline.com/pdfonline/pdfonline.asp?cURL="
					+ escape(_url) + "&" + sUriRequest;
			window
					.open(pURL, "PDFOnline",
							"scrollbars=yes,resizable=yes,width=920,height=800,menubar,toolbar,location");
		}
		savePageAsPDF();
	} else if (m == "hi") {
		window
		.open(
				'http://apps.hi.baidu.com/share/?url=' + encodeURIComponent(_url)+ '&title='
				+ encodeURIComponent(document.title),
				'baiduhi',
				'scrollbars=no,width=820,height=550,status=no,resizable=yes,left='
						+ (screen.width - 820) / 2 + ',top='
						+ (screen.height - 550) / 2);
	} else if (m == "reddit") {
		var href = 'http://www.reddit.com/submit?url='
				+ encodeURIComponent(_url) + '&title='
				+ encodeURIComponent(document.title);
		window.open(href, 'reddit',
				'toolbar=0,status=0,width=900,height=740,left='
						+ (screen.width - 900) / 2 + ',top='
						+ (screen.height - 740) / 2);
	} else if (m == "t139") {
		window.open('http://www.139.com/share/share.php?title='
				+ encodeURIComponent(document.title) + '&url='
				+ encodeURIComponent(_url), 't139',
				'width=490,height=340,left=' + (screen.width - 490) / 2
						+ ',top=' + (screen.height - 340) / 2);
	} else if (m == "myspace") {
		(function() {
			window.open(
					'http://www.myspace.cn/Modules/PostTo/Pages/DefaultMblog.aspx?t='
							+ encodeURIComponent(document.title) + '&u='
							+ encodeURIComponent(_url)
							+ '&source=bookmark', 'myspace',
					'width=495,height=450,resizable=yes,left='
							+ (screen.width - 495) / 2 + ',top='
							+ (screen.height - 450) / 2);
		})();
	} else if (m == "ymail") {
		window.open("http://compose.mail.yahoo.com/?subject="
				+ encodeURIComponent(document.title) + "&body="
				+ encodeURIComponent(_url), 'ymail',
				'toolbar=0,status=0,width=760,height=670,left='
						+ (screen.width - 760) / 2 + ',top='
						+ (screen.height - 670) / 2);
	} else if (m == "csdn") {
		var d = document;
		var t = d.selection ? (d.selection.type != 'None' ? d.selection
				.createRange().text : '') : (d.getSelection ? d.getSelection()
				: '');
		void (saveit = window
				.open('http://wz.csdn.net/storeit.aspx?t=' + escape(d.title)
						+ '&u=' + escape(_url) + '&c=' + escape(t),
						'csdn',
						'scrollbars=no,width=600,height=310,status=no,resizable=yes,left='
						+ (screen.width - 600) / 2 + ',top='
						+ (screen.height - 310) / 2));
		saveit.focus();
	} else if (m == "youdao") {
		void (window
				.open(
						'http://shuqian.youdao.com/manage?a=popwindow&title='
								+ encodeURI(document.title) + '&url='
								+ encodeURI(_url),
						'youdao',
						'height=200, width=590,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no,left='
						+ (screen.width - 590) / 2 + ',top='
						+ (screen.height - 200) / 2));
	}
	return false;
}
function st_addBookmark(title){
    var url = parent.location.href;
    if (window.sidebar) { // Mozilla Firefox Bookmark
        window.sidebar.addPanel(title, url,"");
    } else if(document.all) { // IE Favorite
        window.external.AddFavorite( url, title);
    } else if(window.opera) { // Opera 7+
        return false; // do nothing
    } else { 
         alert('请按 Ctrl + D 为chrome浏览器添加书签!');
    }
}
