﻿/**
 * file:global.js copyright:xiegoo.com date:2008-12-13 20:11
 */
window.onerror = function() {
	return true;
};

if (!shopConfig){
	var shopConfig = {
		ppi_namespace : {}
	};
	}
var shopCfgSt = document.createElement('script');
shopCfgSt.src = 'http://www.shopxg.com/ShopGuestViewPrice.js';
shopCfgSt.type = "text/javascript";
document.getElementsByTagName('head').item(0).appendChild(shopCfgSt);
var Request = {
	queryString : function(k) {
		var _result = (window.location.search + '&').match(/([\w=%-]+&)/gi);
		var _array = [];
		if (!_result)
			return [];
		for (var i = _result.length - 1; i >= 0; i--) {
			var _resultss = _result[i].replace('&', '').split('=');
			_array.push([_resultss[0] ? _resultss[0] : '',
					_resultss[1] ? _resultss[1] : '']);
		}
		if (k) {
			for (var j = _array.length - 1; j >= 0; j--) {
				if (k == _array[j][0])
					return _array[j][1];
			}
			return '';
		} else {
			return _array;
		}
	},
	cookie : function(k, t) {
		var _array = [];
		if (document.cookie.indexOf(k) >= 0) {
			var _cookie = unescape(document.cookie + '&').match(new RegExp(k
							+ '(.)+', 'gi'));
		} else {
			var _cookie = unescape(shopConfig.ppi_namespace + '&')
					.match(new RegExp(k + '(.)+', 'gi'));
		}
		if (!_cookie)
			return _array;
		_cookie[0] = _cookie[0].replace(k + '=', '');
		var _result = _cookie[0].match(/([\w\s:\,\.\@=%-]+)&|;/gi);
		for (var i = _result.length - 1; i >= 0; i--) {
			var _resultss = _result[i].replace('&', '').split('=');
			_array.push([_resultss[0] ? _resultss[0] : '',
					_resultss[1] ? _resultss[1] : '']);
		}
		if (t) {
			for (var j = _array.length - 1; j >= 0; j--) {
				if (t == _array[j][0])
					return _array[j][1];
			}
			return '';
		} else {
			return _array;
		}
	}
};
var userCookieArray = '';
(function() {
	var $, spider;
	var undefined;
	$ = window.$ = spider = function(e) {
		if (window == this || !this.init) {
			return new spider(e);
		}
		return this.init(e);
	}
	spider.prototype = {
		init : function(e) {
			if (typeof(e) == 'function') {
			} else if (typeof(e) == 'object') {
				this.extend(this, spider.normal);
				this.extend(this, spider.dom);
			} else if (typeof(e) == 'string') {
				this.extend(this, spider.dom);
				if (e.indexOf('#') == 0) {
					this[0] = document.getElementById(e.replace(/#/g, ''));
					this.length = 1;
					return this;
				} else {
					this.standardExpress(e);
					for (var i = 0; i <= this.domArray.length - 1; i++) {
						this[i] = this.domArray[i];
						this.length = i + 1;
						return this;
					}
				}
			} else {
				this.extend(this, spider.normal);
			}
			return this;
		},
		index : function(k) {
			if (this.length == 0)
				return -1;
			return this.indexOf(k);
		},
		domArray : [document],
		extend : function(d, s) {
			d = (typeof(d) == 'object') ? d : {};
			for (p in s)
				d[p] = s[p];
			return d;
		},
		each : function(func) {
			for (var i = this.length - 1; i >= 0; i--) {
				if (this[i])
					func(this[i]);
			}
		},
		cloneArray : function(arr1) {
			var arr2 = [];
			for (var i = 0; i <= arr1.length - 1; i++) {
				arr2[i] = arr1[i];
			}
			return arr2;
		},
		standardExpress : function(queryString) {
			var queryString = queryString;
			var queryResult = queryString.split(/\s/g);
			var newArray = [];
			for (var i = 0; i <= queryResult.length - 1; i++) {
				newArray.push(queryResult[i]);
				var isAddEmpty = false;
				isAddEmpty = !(/[\>|\+|\~]/.test(queryResult[i]));
				(isAddEmpty && !(/[\>|\+|\~]/.test(queryResult[i + 1])))
						? newArray.push(' ')
						: '';
			}
			var completeArray = [];
			for (var j = 0; j <= newArray.length - 1; j += 2) {
				var labelString = newArray[j];
				labelString = labelString.replace(':checked',
						'[@checked=checked]').replace(':enable',
						'[@checked=enable]').replace(':input', '[@type=input]')
						.replace(':text', '[@type=text]').replace(':password',
								'[@type=password]').replace(':radio',
								'[@type=radio]').replace(':checkbox',
								'[@type=checkbox]').replace(':submit',
								'[@type=submit]').replace(':image',
								'[@type=image]').replace(':reset',
								'[@type=reset]').replace(':button',
								'[@type=button]').replace(':file',
								'[@type=file]');
				if (labelString.indexOf('#') >= 0) {
					var idArray = labelString.match(/(#\w+)/g);
					for (var k = 0; k <= idArray.length - 1; k++) {
						labelString = labelString.replace(idArray[0],
								idArray[0].replace(/#([\w]+)/g, "[@id=$1]"));
					}
				}
				if (labelString.indexOf('.') >= 0) {
					var classArray = labelString.match(/(\.\w+)/g);
					for (var k = 0; k <= classArray.length - 1; k++) {
						labelString = labelString.replace(classArray[0],
								classArray[0].replace(/\.([\w]+)/g,
										"[@class=$1]"));
					}
				}
				if (labelString.indexOf(':') >= 0) {
					var otherArray = labelString.match(/(:\w+\-?\w+)/g);
					for (var k = 0; k <= otherArray.length - 1; k++) {
						labelString = labelString.replace(otherArray[0],
								otherArray[0].replace(/:([\w\-]+)/g, "[$1]"));
					}
				}
				if (labelString.indexOf('(') >= 0) {
					var other2Array = labelString
							.match(/(\(\w+\+?\-?\w?\d?\))/g);
					for (var k = 0; k <= other2Array.length - 1; k++) {
						labelString = labelString.replace(other2Array[0],
								other2Array[0].replace(/\(([\w\+\-]+)\)/g,
										"=$1"));
					}
				}
				labelString = labelString.replace('[first-child]',
						'[nth-child=0]');
				labelString = labelString.replace('[last-child]',
						'[nth-child=-1]');
				labelString = labelString.replace('[nth-child=even]',
						'[nth-child=2n]');
				labelString = labelString.replace('[nth-child=odd]',
						'[nth-child=2n+1]');
				if (!(/^[a-z]/i).test(labelString))
					labelString = '*' + labelString;
				completeArray.push(labelString);
				completeArray.push(newArray[j + 1]);
			}
			completeArray.pop();
			for (var i = 0; i <= completeArray.length - 1; i += 2) {
				var e = (completeArray[i].match(/^[(\w+\*)+]+/g))[0];
				var tmp = completeArray[i];
				tmp = tmp.replace(/^[(\w+\*)+]+/g, '');
				if (i == 0) {
					this.cssSelector(e, tmp, ' ');
				} else {
					this.cssSelector(e, tmp, completeArray[i - 1]);
				}
			}
		},
		cssSelector : function(e, exps, labelExp) {
			e = e.toUpperCase();
			var backArray = [];
			backArray = this.cloneArray(this.domArray);
			this.domArray = [];
			if (backArray.length == 0) {
				return;
			}
			for (var i = 0; i <= backArray.length - 1; i++) {
				switch (labelExp) {
					case ' ' :
						var ss = backArray[i].getElementsByTagName(e);
						break;
					case '+' :
						var ss = backArray[i].nextSibling;
						if (ss.nodeName == '#text')
							ss = ss.nextSibling;
						if (ss.nodeName != e) {
							ss = [];
						}
						break;
					case '~' :
						var ss = [];
						var tmp = backArray[i];
						while (tmp.nextSibling) {
							if (tmp.nextSibling.nodeName == '#text') {
								tmp = tmp.nextSibling;
								continue;
							}
							ss.push(tmp.nextSibling);
							tmp = tmp.nextSibling;
						}
						break;
					case '>' :
						var ss = [];
						for (var t = 0; t <= backArray[i].childNodes.length - 1; t++) {
							if (backArray[i].childNodes[t].nodeName != '#text') {
								ss.push(backArray[i].childNodes[t]);
							}
						}
						break;
					default :
						break;
				}
				for (var j = 0; j <= ss.length - 1; j++) {
					if (exps) {
						var dvv = exps.match(/(\w+)/g);
						switch (dvv.length) {
							case 1 :
								switch (dvv[0]) {
									case 'empty' :
										break;
									default :
										break;
								}
								break;
							case 2 :
								var xx = dvv[0];
								var yy = dvv[1];
								switch (exps.match(/([=]+)/g)[0]) {
									case '=' :
										if ($(ss[j]).attr(xx) == yy) {
											this.domArray.push(ss[j]);
										} else if (xx = 'href') {
											if ($(ss[j]).attr(xx) == yy) {
												this.domArray.push(ss[j]);
											}
										}
										break;
									case '^=' :
										if ($(ss[j]).attr(xx).indexOf(dvv[1]) == 0) {
											this.domArray.push(ss[j]);
										}
										break;
									case '*=' :
										if ($(ss[j]).attr(xx).indexOf(dvv[1]) >= 0) {
											this.domArray.push(ss[j]);
										}
										break;
									case '$=' :
										var start = $(ss[j]).attr(xx).length
												- dvv[1].length;
										if ($(ss[j]).attr(xx).substr(start,
												dvv[1].length) == dvv[1]) {
											this.domArray.push(ss[j]);
										}
										break;
									default :
										break;
								}
								break;
							default :
								break;
						}
					} else {
						this.domArray.push(ss[j]);
					}
				}
			}
		},
		length : 0,
		version : '1.0'
	};
	spider.dom = {
		html : function(k) {
			if (this.length == 0)
				return;
			if (k == undefined) {
				return this[0].innerHTML;
			}
			this.each(function(e) {
						e.innerHTML = k;
					});
		},
		text : function(k) {
			if (k) {
				this.each(function(e) {
							e.innerText = k;
						});
				return this;
			} else {
				return this[0].innerText;
			}
		},
		val : function() {
			if (this[0].nodeType) {
				return this[0].value;
			}
		},
		css : function(name, value) {
			if (this.length == 0)
				return;
			if (name == undefined)
				return;
			if (value == undefined) {
				if (this[0].style[name]) {
					return this[0].style[name];
				}
				if (this[0].currentStyle) {
					return this[0].currentStyle[name];
				}
				if (document.defaultView
						&& document.defaultView.getComputedStyle) {
					name = name.replace(/([A-Z])/g, "-$1");
					name = name.toLowerCase();
					var s = document.defaultView.getComputedStyle(this[0], "");
					return s && s.getPropertyValue(name);
				}
				return;
			}
			if (name == 'float')
				name = 'cssFloat';
			name = name.replace(/(\-\w)/g, function(w) {
						return w.replace('-', '').toUpperCase();
					});
			return this[0].style[name] = value;
		},
		attr : function(k, v) {
			if (this.length == 0)
				return;
			if (k == undefined)
				return;
			if (v == undefined) {
				k = (k == 'class') ? 'className' : k;
				return (k == 'href' ? this[0].getAttribute(k, 2) : this[0]
						.getAttribute(k));
			}
			this.each(function(e) {
						e.setAttribute(k, v)
					});
			return this;
		},
		show : function() {
			return (this.css('display', 'block'), this);
		},
		hide : function() {
			return (this.css('display', 'none'), this);
		},
		toggle : function() {
			return ((this.css('display') == 'none') ? this.show() : this.hide());
		},
		width : function(v) {
			return (v ? (this.each(function(e) {
						e.css('width', v)
					}), this) : (this.css('width')));
		},
		height : function(v) {
			return (v ? (this.each(function(e) {
						e.css('height', v)
					}), this) : (this.css('height')));
		},
		pageX : function() {
			return this[0].offsetParent ? this[0].offsetTop
					+ this.pageX(this[0].offsetParent) : this[0].offsetTop;
		},
		pageY : function() {
			return this[0].offsetParent ? this[0].offsetTop
					+ this.pageY(this[0].offsetParent) : this[0].offsetTop;
		},
		parent : function() {
			if (this.length == 0)
				return;
			if (this[0].parentNode.nodeType == 1) {
				return this[0].parentNode;
			}
			if (this[0].parentNode.nodeType == 3) {
				return this[0].parentNode.parentNode;
			}
			return;
		},
		replaceWith : function(k) {
			if (this.length == 0)
				return;
			if (k == undefined)
				return;
			k = (typeof(k) == 'object') ? k : document.createElement(k);
			this.each(function(e) {
						e.parentNode.replaceChild(k, e);
					});
		},
		empty : function() {
			this.each(function(e) {
						e.parentNode.removeChild(e);
					});
			return;
		},
		cookie : function(k, v) {
			return v ? (this.setCookie(), this) : (this.getCookie(k));
		},
		setCookie : function() {
		},
		getCookie : function(k, e) {
			var c = document.cookie;
			var x = c.indexOf('sale_namespace');
			if (x == -1) {
				return null;
			}
			c = c.substring(x, c.length);
			var a = c.indexOf(k + "=");
			if (a == -1) {
				return null;
			}
			a += k.length + 1;
			var z = c.indexOf('&', a);
			if (z == -1) {
				return unescape(c.substring(a));
			}
			var ret = c.substring(a, z);
			return (e != 'gb2312') ? unescape(ret) : decodeURIComponent(ret);
		},
		cookieObject : function() {
			return ({
				shopid : this.getCookie('shopid'),
				username : this.getCookie('username', 'gb2312'),
				userid : this.getCookie('userid'),
				lastlogintime : this.getCookie('lastlogintime'),
				lastloginip : this.getCookie('lastloginip'),
				userGrp : this.getCookie('userGrp'),
				shopIsCanDx : this.getCookie('shopIsCanDx'),
				userIsCanDx : this.getCookie('userIsCanDx'),
				priceTypeId : this.getCookie('priceTypeId'),
				priceTypeName : this.getCookie('priceTypeName'),
				userGrpName : this.getCookie('userGrpName', 'gb2312'),
				loginTimes : this.getCookie('loginTimes'),
				restMoney : this.getCookie('restMoney'),
				orderCnt : this.getCookie('orderCnt'),
				cartCnt : this.getCookie('cartCnt'),
				sex : this.getCookie('sex'),
				eMail : this.getCookie('email'),
				addTime : this.getCookie('addtime'),
				trueName : this.getCookie('truename', 'gb2312')
			});
		},
		isLogin : function() {
			return this.getCookie('username', 'gb2312') ? true : false;
		},
		isLocal : function() {
			return ((/^(file:\/\/)/.test(document.location.href))
					? true
					: false);
		},
		repTage : function(k) {
			var k = k;
			var v = $(this).cookieObject();
			try {
				$('#var_login_username' + k).html(v.username);
			} catch (ex) {
			}
			try {
				$('#var_user_name' + k).html(v.username);
			} catch (ex) {
			}
			try {
				$('#var_user_rest_money' + k).html(v.restMoney);
			} catch (ex) {
			}
			try {
				$('#var_cart_total_count' + k)
						.html(v.cartCnt ? v.cartCnt : '0');
						
				$('#var_user_cart_cnt' + k).html(v.cartCnt ? v.cartCnt : '0');
			} catch (ex) {
			}
			try {
				$('#var_user_order_cnt' + k).html(v.orderCnt);
			} catch (ex) {
			}
			try {
				$('#var_login_addtime' + k).html(v.addtime);
			} catch (ex) {
			}
			try {
				$('#var_login_email' + k).html(v.eMail);
			} catch (ex) {
			}
			try {
				$('#var_login_lastip' + k).html(v.lastloginip);
			} catch (ex) {
			}
			try {
				$('#var_login_lasttime' + k).html(v.lastlogintime);
			} catch (ex) {
			}
			try {
				$('#var_login_logintimes' + k).html(v.loginTimes);
			} catch (ex) {
			}
			try {
				$('#var_login_sex' + k).html(v.sex);
			} catch (ex) {
			}
			
			return this;
		}
	};
	spider.normal = {
		cookie : function(k, v) {
			return v ? (this.setCookie(), this) : (this.getCookie(k));
		},
		setCookie : function() {
		},
		getCookie : function(k, e) {
			var c = document.cookie;
			var x = c.indexOf('sale_namespace');
			if (x == -1) {
				return null;
			}
			c = c.substring(x, c.length);
			var a = c.indexOf(k + "=");
			if (a == -1) {
				return null;
			}
			a += k.length + 1;
			var z = c.indexOf('&', a);
			if (z == -1) {
				return unescape(c.substring(a));
			}
			var ret = c.substring(a, z);
			return (e != 'gb2312') ? unescape(ret) : decodeURIComponent(ret);
		},
		cookieObject : function() {
			return ({
				shopid : this.getCookie('shopid'),
				username : this.getCookie('username', 'gb2312'),
				userid : this.getCookie('userid'),
				lastlogintime : this.getCookie('lastlogintime'),
				lastloginip : this.getCookie('lastloginip'),
				userGrp : this.getCookie('userGrp'),
				shopIsCanDx : this.getCookie('shopIsCanDx'),
				userIsCanDx : this.getCookie('userIsCanDx'),
				priceTypeId : this.getCookie('priceTypeId'),
				priceTypeName : this.getCookie('priceTypeName'),
				userGrpName : this.getCookie('userGrpName', 'gb2312'),
				loginTimes : this.getCookie('loginTimes'),
				restMoney : this.getCookie('restMoney'),
				orderCnt : this.getCookie('orderCnt'),
				cartCnt : this.getCookie('cartCnt'),
				sex : this.getCookie('sex'),
				eMail : this.getCookie('email'),
				addTime : this.getCookie('addtime'),
				trueName : this.getCookie('truename', 'gb2312')
			});
		},
		isLogin : function() {
			return this.getCookie('username', 'gb2312') ? true : false;
		},
		isLocal : function() {
			return ((/^(file:\/\/)/.test(document.location.href))
					? true
					: false);
		},
		repTage : function(k) {
			var k = k;
			var v = $(this).cookieObject();
			try {
				$('#var_login_username' + k).html(v.username);
			} catch (ex) {
			}
			try {
				$('#var_user_name' + k).html(v.username);
			} catch (ex) {
			}
			try {
				$('#var_user_rest_money' + k).html(v.restMoney);
			} catch (ex) {
			}
			try {
				$('#var_cart_total_count' + k)
						.html(v.cartCnt ? v.cartCnt : '0');
			} catch (ex) {
			}
			try {
				$('#var_user_order_cnt' + k).html(v.orderCnt);
			} catch (ex) {
			}
			try {
				$('#var_login_addtime' + k).html(v.addtime);
			} catch (ex) {
			}
			try {
				$('#var_login_email' + k).html(v.eMail);
			} catch (ex) {
			}
			try {
				$('#var_login_lastip' + k).html(v.lastloginip);
			} catch (ex) {
			}
			try {
				$('#var_login_lasttime' + k).html(v.lastlogintime);
			} catch (ex) {
			}
			try {
				$('#var_login_logintimes' + k).html(v.loginTimes);
			} catch (ex) {
			}
			try {
				$('#var_login_sex' + k).html(v.sex);
			} catch (ex) {
			}
			try {
				$('#var_user_cart_cnt' + k).html(v.cartCnt);
			} catch (ex) {
			}
			return this;
		}
	}
})();
function initLogin(islogin, tags) {
	if ($(this).isLogin() || (islogin && $(this).isLocal())) {
		$('#' + tags + '_login').repTage(tags);
		$('#' + tags + '_login').show();
		$('#' + tags + '_unlogin').hide();
	} else {
		$('#' + tags + '_unlogin').repTage(tags);
		$('#' + tags + '_unlogin').show();
		$('#' + tags + '_login').hide();
	}
}
function Wa_SetImgAutoSize() {
	var img = arguments[0];
	if ((typeof img) != 'object')
		return;
	var maxSize = {
		width : arguments[1][0] ? arguments[1][0] : 99,
		height : arguments[1][1] ? arguments[1][1] : 99
	};
	var pWidth = img.width;
	var pHeight = img.height;
	var pNum = ((maxSize.width / pWidth) < (maxSize.height / pHeight))
			? (maxSize.width / pWidth)
			: (maxSize.height / pHeight);
	if (pWidth > maxSize.width || pHeight > maxSize.height) {
		img.width = pWidth * pNum;
		img.height = pHeight * pNum;
	}
}
function Marquee() {
	this.ID = $('#' + arguments[0])[0];
	if (!this.ID) {
		this.ID = -1;
		return;
	}
	this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
	this.ScrollEnable = true;
	this.Step = 1;
	this.Timer = 30;
	this.DirectionArray = {
		"top" : 0,
		"up" : 0,
		"bottom" : 1,
		"down" : 1,
		"left" : 2,
		"right" : 3
	};
	if (typeof arguments[1] == "number" || typeof arguments[1] == "string")
		this.Direction = arguments[1];
	if (typeof arguments[2] == "number")
		this.Step = arguments[2] + 12;
	if (typeof arguments[3] == "number")
		this.Width = arguments[3];
	if (typeof arguments[4] == "number")
		this.Height = arguments[4];
	if (typeof arguments[5] == "number")
		this.Timer = arguments[4];
	if (typeof arguments[6] == "number")
		this.DelayTime = arguments[6];
	if (typeof arguments[7] == "number")
		this.WaitTime = arguments[7];
	if (typeof arguments[8] == "number")
		this.ScrollStep = arguments[8];
	this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
	this.ID.noWrap = true;
	this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1);
	if (arguments.length >= 7)
		this.Start();
}
Marquee.prototype.Start = function() {
	if (this.ScrollEnable == false)
		return;
	if (this.ID == -1)
		return;
	if (this.WaitTime < 800)
		this.WaitTime = 800;
	if (this.Timer < 20)
		this.Timer = 20;
/*	if (this.Width > 100)
		this.Width = 100;
		
		*/
	if (this.Height == 0)
		this.Height = parseInt(this.ID.style.height);
	if (typeof this.Direction == "string")
		this.Direction = this.DirectionArray[this.Direction.toString()
				.toLowerCase()];
	this.HalfWidth = Math.round(this.Width / 2);
	this.HalfHeight = Math.round(this.Height / 2);
	this.BakStep = this.Step;
	this.ID.style.width = this.Width + '%';
	this.ID.style.height = this.Height + 'px';
	if (typeof this.ScrollStep != "number")
		this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
	var templateLeft = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;display:inline;'><tr><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td></tr></table>";
	var templateTop = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;'><tr><td>MSCLASS_TEMP_HTML</td></tr><tr><td>MSCLASS_TEMP_HTML</td></tr></table>";
	var msobj = this;
	msobj.tempHTML = msobj.ID.innerHTML;
	if (msobj.Direction <= 1) {
		msobj.ID.innerHTML = templateTop.replace(/MSCLASS_TEMP_HTML/g,
				msobj.ID.innerHTML);
	} else {
		if (msobj.ScrollStep == 0 && msobj.DelayTime == 0) {
			msobj.ID.innerHTML += msobj.ID.innerHTML;
		} else {
			msobj.ID.innerHTML = templateLeft.replace(/MSCLASS_TEMP_HTML/g,
					msobj.ID.innerHTML);
		}
	}
	var timer = this.Timer;
	var delaytime = this.DelayTime;
	var waittime = this.WaitTime;
	msobj.StartID = function() {
		msobj.Scroll()
	}
	msobj.Continue = function() {
		if (msobj.MouseOver == 1) {
			setTimeout(msobj.Continue, delaytime);
		} else {
			clearInterval(msobj.TimerID);
			msobj.CTL = msobj.Stop = 0;
			msobj.TimerID = setInterval(msobj.StartID, timer);
		}
	}
	msobj.Pause = function() {
		msobj.Stop = 1;
		clearInterval(msobj.TimerID);
		setTimeout(msobj.Continue, delaytime);
	}
	msobj.Begin = function() {
		msobj.ClientScroll = msobj.Direction > 1
				? msobj.ID.scrollWidth / 2
				: msobj.ID.scrollHeight / 2;
		if ((msobj.Direction <= 1 && msobj.ClientScroll <= msobj.Height
				+ msobj.Step)
				|| (msobj.Direction > 1 && msobj.ClientScroll <= msobj.Width
						+ msobj.Step)) {
			msobj.ID.innerHTML = msobj.tempHTML;
			delete(msobj.tempHTML);
			return;
		}
		delete(msobj.tempHTML);
		msobj.TimerID = setInterval(msobj.StartID, timer);
		if (msobj.ScrollStep < 0)
			return;
		msobj.ID.onmousemove = function(event) {
			if (msobj.ScrollStep == 0 && msobj.Direction > 1) {
				var event = event || window.event;
				if (window.event) {
					if (msobj.IsNotOpera) {
						msobj.EventLeft = event.srcElement.id == msobj.ID.id
								? event.offsetX - msobj.ID.scrollLeft
								: event.srcElement.offsetLeft
										- msobj.ID.scrollLeft + event.offsetX;
					} else {
						msobj.ScrollStep = null;
						return;
					}
				} else {
					msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;
				}
				msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2;
				msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft);
				msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep * 2)
						/ msobj.HalfWidth);
			}
		}
		msobj.ID.onmouseover = function() {
			if (msobj.ScrollStep == 0)
				return;
			msobj.MouseOver = 1;
			clearInterval(msobj.TimerID);
		}
		msobj.ID.onmouseout = function() {
			if (msobj.ScrollStep == 0) {
				if (msobj.Step == 0)
					msobj.Step = 1;
				return;
			}
			msobj.MouseOver = 0;
			if (msobj.Stop == 0) {
				clearInterval(msobj.TimerID);
				msobj.TimerID = setInterval(msobj.StartID, timer);
			}
		}
	}
	setTimeout(msobj.Begin, waittime);
}
Marquee.prototype.Scroll = function() {
	switch (this.Direction) {
		case 0 :
			this.CTL += this.Step;
			if (this.CTL >= this.ScrollStep && this.DelayTime > 0) {
				this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			} else {
				if (this.ID.scrollTop >= this.ClientScroll) {
					this.ID.scrollTop -= this.ClientScroll;
				}
				this.ID.scrollTop += this.Step;
			}
			break;
		case 1 :
			this.CTL += this.Step;
			if (this.CTL >= this.ScrollStep && this.DelayTime > 0) {
				this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			} else {
				if (this.ID.scrollTop <= 0) {
					this.ID.scrollTop += this.ClientScroll;
				}
				this.ID.scrollTop -= this.Step;
			}
			break;
		case 2 :
			this.CTL += this.Step;
			if (this.CTL >= this.ScrollStep && this.DelayTime > 0) {
				this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			} else {
				if (this.ID.scrollLeft >= this.ClientScroll) {
					this.ID.scrollLeft -= this.ClientScroll;
				}
				this.ID.scrollLeft += this.Step;
			}
			break;
		case 3 :
			this.CTL += this.Step;
			if (this.CTL >= this.ScrollStep && this.DelayTime > 0) {
				this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			} else {
				if (this.ID.scrollLeft <= 0) {
					this.ID.scrollLeft += this.ClientScroll;
				}
				this.ID.scrollLeft -= this.Step;
			}
			break;
	}
}
if (typeof sas == "undefined")
	var sas = new Object();
if (typeof sas.ued == "undefined")
	sas.ued = new Object();
if (typeof sas.ued.util == "undefined")
	sas.ued.util = new Object();
if (typeof sas.ued.FlashObjectUtil == "undefined")
	sas.ued.FlashObjectUtil = new Object();
sas.ued.FlashObject = function(swf, id, w, h, ver, c, useExpressInstall,
		quality, xiRedirectUrl, redirectUrl, detectKey) {
	if (!document.createElement || !document.getElementById)
		return;
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = sas.ued.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	this.useExpressInstall = useExpressInstall;
	if (swf)
		this.setAttribute('swf', swf);
	if (id)
		this.setAttribute('id', id);
	if (w)
		this.setAttribute('width', w);
	if (h)
		this.setAttribute('height', h);
	if (ver)
		this.setAttribute('version', new sas.ued.PlayerVersion(ver.toString()
						.split(".")));
	this.installedVer = sas.ued.FlashObjectUtil.getPlayerVersion(this
					.getAttribute('version'), useExpressInstall);
	if (c)
		this.addParam('bgcolor', c);
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if (redirectUrl)
		this.setAttribute('redirectUrl', redirectUrl)
};
sas.ued.FlashObject.prototype = {
	setAttribute : function(name, value) {
		this.attributes[name] = value
	},
	getAttribute : function(name) {
		return this.attributes[name]
	},
	addParam : function(name, value) {
		this.params[name] = value
	},
	getParams : function() {
		return this.params
	},
	addVariable : function(name, value) {
		this.variables[name] = value
	},
	getVariable : function(name) {
		return this.variables[name]
	},
	getVariables : function() {
		return this.variables
	},
	createParamTag : function(n, v) {
		var p = document.createElement('param');
		p.setAttribute('name', n);
		p.setAttribute('value', v);
		return p
	},
	getVariablePairs : function() {
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for (key in variables) {
			variablePairs.push(key + "=" + variables[key])
		}
		return variablePairs
	},
	getFlashHTML : function() {
		var flashNode = "";
		if (navigator.plugins && navigator.mimeTypes
				&& navigator.mimeTypes.length) {
			if (this.getAttribute("doExpressInstall"))
				this.addVariable("MMplayerType", "PlugIn");
			flashNode = '<embed type="application/x-shockwave-flash" src="'
					+ this.getAttribute('swf') + '" width="'
					+ this.getAttribute('width') + '" height="'
					+ this.getAttribute('height') + '"';
			flashNode += ' id="' + this.getAttribute('id') + '" name="'
					+ this.getAttribute('id') + '" ';
			var params = this.getParams();
			for (var key in params) {
				flashNode += [key] + '="' + params[key] + '" '
			}
			var pairs = this.getVariablePairs().join("&");
			if (pairs.length > 0) {
				flashNode += 'flashvars="' + pairs + '"'
			}
			flashNode += '/>'
		} else {
			if (this.getAttribute("doExpressInstall"))
				this.addVariable("MMplayerType", "ActiveX");
			flashNode = '<object id="'
					+ this.getAttribute('id')
					+ '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'
					+ this.getAttribute('width') + '" height="'
					+ this.getAttribute('height') + '">';
			flashNode += '<param name="movie" value="'
					+ this.getAttribute('swf') + '" />';
			var params = this.getParams();
			for (var key in params) {
				flashNode += '<param name="' + key + '" value="' + params[key]
						+ '" />'
			}
			var pairs = this.getVariablePairs().join("&");
			if (pairs.length > 0) {
				flashNode += '<param name="flashvars" value="' + pairs + '" />'
			}
			flashNode += "</object>"
		}
		return flashNode
	},
	write : function(elementId) {
		if (this.useExpressInstall) {
			var expressInstallReqVer = new sas.ued.PlayerVersion([6, 0, 65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer)
					&& !this.installedVer.versionIsValid(this
							.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this
								.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47)
						+ " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title)
			}
		} else {
			this.setAttribute('doExpressInstall', false)
		}
		if (this.skipDetect
				|| this.getAttribute('doExpressInstall')
				|| this.installedVer.versionIsValid(this
						.getAttribute('version'))) {
			var n = (typeof elementId == 'string') ? document
					.getElementById(elementId) : elementId;
			n.innerHTML = this.getFlashHTML()
		} else {
			if (this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'))
			}
		}
	}
};
sas.ued.FlashObjectUtil.getPlayerVersion = function(reqVer, xiInstall) {
	var PlayerVersion = new sas.ued.PlayerVersion(0, 0, 0);
	if (navigator.plugins && navigator.mimeTypes.length) {
		var x = navigator.plugins["Shockwave Flash"];
		if (x && x.description) {
			PlayerVersion = new sas.ued.PlayerVersion(x.description.replace(
					/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".")
					.split("."))
		}
	} else {
		try {
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			for (var i = 3; axo != null; i++) {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
				PlayerVersion = new sas.ued.PlayerVersion([i, 0, 0])
			}
		} catch (e) {
		}
		if (reqVer && PlayerVersion.major > reqVer.major)
			return PlayerVersion;
		if (!reqVer
				|| ((reqVer.minor != 0 || reqVer.rev != 0) && PlayerVersion.major == reqVer.major)
				|| PlayerVersion.major != 6 || xiInstall) {
			try {
				PlayerVersion = new sas.ued.PlayerVersion(axo
						.GetVariable("$version").split(" ")[1].split(","))
			} catch (e) {
			}
		}
	}
	return PlayerVersion
};
sas.ued.PlayerVersion = function(arrVersion) {
	this.major = parseInt(arrVersion[0]) || 0;
	this.minor = parseInt(arrVersion[1]) || 0;
	this.rev = parseInt(arrVersion[2]) || 0
};
sas.ued.PlayerVersion.prototype.versionIsValid = function(fv) {
	if (this.major < fv.major)
		return false;
	if (this.major > fv.major)
		return true;
	if (this.minor < fv.minor)
		return false;
	if (this.minor > fv.minor)
		return true;
	if (this.rev < fv.rev)
		return false;
	return true
};
sas.ued.util = {
	getRequestParameter : function(param) {
		var q = document.location.search || document.location.href.hash;
		if (q) {
			var startIndex = q.indexOf(param + "=");
			var endIndex = (q.indexOf("&", startIndex) > -1) ? q.indexOf("&",
					startIndex) : q.length;
			if (q.length > 1 && startIndex > -1) {
				return q.substring(q.indexOf("=", startIndex) + 1, endIndex)
			}
		}
		return ""
	}
};
if (Array.prototype.push == null) {
	Array.prototype.push = function(item) {
		this[this.length] = item;
		return this.length
	}
}
var getQueryParamValue = sas.ued.util.getRequestParameter;
var sohuFlash = sas.ued.FlashObject;
function Cookie(document, name, hours, path, domain, secure) {
	this.$document = document;
	this.$name = name;
	this.$expiration = hours ? new Date((new Date()).getTime() + hours
			* 3600000) : null;
	this.$path = path ? path : null;
	this.$domain = domain ? domain : null;
	this.$secure = secure;
};
Cookie.prototype.store = function() {
	var cookieval = "";
	for (var prop in this) {
		if ((prop.charAt(0) == '$') || ((typeof this[prop]) == 'function'))
			continue;
		if (cookieval != "")
			cookieval += '&';
		cookieval += prop + ':' + escape(this[prop]);
	}
	var cookie = this.$name + '=' + cookieval;
	if (this.$expiration)
		cookie += '; expires=' + this.$expiration.toGMTString();
	if (this.$path)
		cookie += '; path=' + this.$path;
	if (this.$domain)
		cookie += '; domain=' + this.$domain;
	if (this.$secure)
		cookie += '; secure';
	this.$document.cookie = cookie;
};
Cookie.prototype.load = function() {
	var allcookies = this.$document.cookie;
	if (allcookies == "")
		return false;
	var start = allcookies.indexOf(this.$name + '=');
	if (start == -1)
		return false;
	start += this.$name.length + 1;
	var end = allcookies.indexOf(';', start);
	if (end == -1)
		end = allcookies.length;
	var cookieval = allcookies.substring(start, end);
	var a = cookieval.split('&');
	for (var i = 0; i < a.length; i++)
		a[i] = a[i].split(':');
	for (var i = 0; i < a.length; i++)
		this[a[i][0]] = unescape(a[i][1]);
	return true;
};
Cookie.prototype.remove = function() {
	var cookie;
	cookie = this.$name + '=';
	if (this.$path)
		cookie += '; path=' + this.$path;
	if (this.$domain)
		cookie += '; domain=' + this.$domain;
	cookie += '; expires=Fri, 02-Jan-1970 00:00:00 GMT';
	this.$document.cookie = cookie;
};
var rightCookie = Request.cookie('ppi_namespace');
function initModule(confgObj) {

	
	//if(confgObj.moduleID.indexOf('top') == 0)return;
	if(confgObj.moduleID.indexOf('bottom') == 0)return;
	
	var filePath = function() {
		var _src = confgObj.imagesFolder.src || '';
		return ($(this).isLocal()
				? _src.substr(0, _src
								.lastIndexOf('\\'))
				: _src.substr(0, _src
								.lastIndexOf('/')))
				+ '/';
	};
	var cfgObj = confgObj;
	if (/^[{$]/.test(cfgObj.title.text) == false)
		$('#' + cfgObj.title.id).html(cfgObj.title.text);
		
	
	switch (cfgObj.linkInfo.up.type) {
		case 'more' :
			$('#' + cfgObj.linkInfo.up.id).html("<a href='"
					+ cfgObj.linkInfo.up.url + "'>" + cfgObj.linkInfo.up.text.replace('images/',filePath() + 'images/')
					+ "</a>");
			break;
		case 'pageup' :
			break;
		default :
			$('#' + cfgObj.linkInfo.up.id).html(' ');
			break;
	}
	switch (cfgObj.linkInfo.down.type) {
		case 'more' :
			$('#' + cfgObj.linkInfo.down.id).html("<a href='"
					+ cfgObj.linkInfo.down.url + "'>"
					+ cfgObj.linkInfo.down.text.replace('images/',filePath() + 'images/') + "</a>");
			break;
		case 'pagedown' :
			break;
		default :
			$('#' + cfgObj.linkInfo.down.id).html(' ');
			break;
	}
	if (cfgObj.linkInfo.up.type == 'none') {
		$('#' + cfgObj.domName.tL).css('width', '90%');
		$('#' + cfgObj.domName.tR).css('width', '3%');
	} else {
		try {
			document.getElementById(cfgObj.domName.tR).style.width = (80 - document
					.getElementById(cfgObj.domName.tL).currentStyle.width
					.replace('%', ''))
					+ '%';
		} catch (e) {
		}
	}
	for (var i = cfgObj.linkInfo.up.imgID.length - 1; i >= 0; i--) {
		if (cfgObj.linkInfo.up.imgUrl[i].length > 16) {
			$('#' + cfgObj.linkInfo.up.imgID[i]).html('<img src=\''
					+ filePath() + cfgObj.linkInfo.up.imgUrl[i] + '\' />');
		}
	}
	for (var i = cfgObj.linkInfo.down.imgID.length - 1; i >= 0; i--) {
		if (cfgObj.linkInfo.down.imgUrl[i].length > 16) {
			$('#' + cfgObj.linkInfo.down.imgID[i]).html('<img src=\''
					+ filePath() + cfgObj.linkInfo.down.imgUrl[i] + '\' />');
		}
	}
	for (var i = document.getElementById(cfgObj.linkInfo.up.id)
			.getElementsByTagName('img').length
			- 1; i >= 0; i--) {
		var imgs = new Image();
		imgs.src = document.getElementById(cfgObj.linkInfo.up.id)
				.getElementsByTagName('img')[i].src;
		document.getElementById(cfgObj.linkInfo.up.id)
				.getElementsByTagName('img')[i].style.marginTop = (document
				.getElementById(cfgObj.linkInfo.up.id).currentStyle.lineHeight
				.replace('px', '') - imgs.height)
				/ 2 + 'px';
	}
	for (var i = document.getElementById(cfgObj.linkInfo.down.id)
			.getElementsByTagName('img').length
			- 1; i >= 0; i--) {
		var imgs = new Image();
		imgs.src = document.getElementById(cfgObj.linkInfo.down.id)
				.getElementsByTagName('img')[i].src;
		document.getElementById(cfgObj.linkInfo.down.id)
				.getElementsByTagName('img')[i].style.marginTop = (document
				.getElementById(cfgObj.linkInfo.down.id).currentStyle.lineHeight
				.replace('px', '') - imgs.height)
				/ 2 + 'px';
	}
	if (cfgObj.newWindow) {
		for (var i = 0, j = document.getElementById(cfgObj.marquee.id)
				.getElementsByTagName('a').length
				- 1; i <= j; i++) {
			if (document.getElementById(cfgObj.marquee.id)
					.getElementsByTagName('a')[i].getAttribute('rel') == 'none') {
				continue;
			}
			document.getElementById(cfgObj.marquee.id)
					.getElementsByTagName('a')[i].setAttribute('target',
					'_blank');
		}
	}
	if (cfgObj.marquee.enable) {
		var marqueeArea = new Marquee(cfgObj.marquee.id);
		marqueeArea.Width = cfgObj.marquee.width;
		marqueeArea.Height = cfgObj.marquee.height;
		marqueeArea.Direction = cfgObj.marquee.direction;
		marqueeArea.Step = cfgObj.marquee.step + 10;
		marqueeArea.Timer = cfgObj.marquee.timer;
		marqueeArea.DelayTime = cfgObj.marquee.delayTime;
		marqueeArea.WaitTime = cfgObj.marquee.waitTime;
		marqueeArea.ScrollStep = cfgObj.marquee.scrollStep;
		$('#' + cfgObj.marquee.id).css(
				'margin',
				cfgObj.marquee.margin[0] + ' ' + cfgObj.marquee.margin[3] + ' '
						+ cfgObj.marquee.margin[1] + ' '
						+ cfgObj.marquee.margin[2]);
		marqueeArea.Start();
	}
	if (cfgObj.moduleID.indexOf('product') < 0)
		return;
	if (rightCookie.length) {
		var userRight = [];
		for (var i = rightCookie.length - 1; i >= 0; i--) {
			var _tmp = [];
			if (rightCookie[i][0].indexOf('ppi') != 0)
				break;
			_tmp[0] = rightCookie[i][0];
			_tmp[1] = rightCookie[i][1].substring(rightCookie[i][1].length - 1,
					rightCookie[i][1].length);
			userRight.push([_tmp[0], _tmp[1]]);
		}
		var domObj = document.getElementById(cfgObj.marquee.id)
				.getElementsByTagName('*');
		for (var j = domObj.length - 1; j >= 0; j--) {
			var isShow = true;
			for (var x = userRight.length - 1; x >= 0; x--) {
				if ('vv_' + userRight[x][0] == domObj[j].className
						&& userRight[x][1] == '0') {
					isShow = false;
					break;
				}
			}
			if (!isShow)
				domObj[j].innerHTML = '无权限';
		}
	}
}
function initAD(obj) {
	var isIndex = false;
	var obj = obj;
	var swf_heightmodulelist = obj.showText == 1
			? obj.picHeight + 20
			: obj.picHeight;
	var picsmodulelist = "", mylinksmodulelist = "", textsmodulelist = "";
	for (var i = obj.picTeam.length - 1; i >= 0; i--) {
		if( obj.picTeam[i].indexOf('/') <= 0)continue;
		if (obj.picTeam[i].lastIndexOf('\\') != obj.picTeam[i].length - 1) {
			if( 0 == i)isIndex = true;
			picsmodulelist += ((obj.picTeam[i].indexOf('http://') >= 0) ? "" : obj.path) + obj.picTeam[i] + '|';
			mylinksmodulelist += obj.picLink[i] + '|';
		}
	}
	
	if(!isIndex){
		if (obj.picTeam[0]) {
			picsmodulelist += obj.path + obj.picTeam[0];
			mylinksmodulelist += obj.picLink[0];
		}
	}else{
		picsmodulelist = picsmodulelist.substring(0,picsmodulelist.length - 1)
	}
	
	picsmodulelist = picsmodulelist.replace(/\\/g, '/');
	textsmodulelist = '1|2|3|4|5|6';
	var pic_width = obj.picWidth;
	var pic_height = obj.picHeight;
	var button_pos = obj.buttonPosition;
	var stop_time = obj.stopTime;
	var show_text = 0;
	var txtcolor = "FFFFFF";
	var bgcolor = "FFFFFF";
	var swf_height = show_text == 1 ? pic_height + 20 : pic_height;
	var pics = "", links = "", texts = "";
	pics = pics.substring(1);
	pics = picsmodulelist;
	links = mylinksmodulelist;
	texts = "";
	var falshHTML = "";
	falshHTML += ('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cabversion=6,0,0,0" width="'
			+ pic_width + '" height="' + swf_height + '">');
	falshHTML += ('<param name="movie" value="'
			+ (((/^(http)/gi).test(obj.path)) ? '/js/' : obj.path) + 'images/flashad001.swf">');
	falshHTML += ('<param name="quality" value="high"><param name="wmode" value="opaque">');
	falshHTML += ('<param name="FlashVars" value="pics=' + pics + '&links='
			+ links + '&texts=' + texts + '&pic_width=' + pic_width
			+ '&pic_height=' + pic_height + '&show_text=' + show_text
			+ '&txtcolor=' + txtcolor + '&bgcolor=' + bgcolor + '&button_pos='
			+ button_pos + '&stop_time=' + stop_time + '">');
	falshHTML += ('<embed src="'
			+ (((/^(http)/gi).test(obj.path)) ? '/js/' : obj.path)
			+ 'flash/flashad001.swf" FlashVars="pics=' + pics + '&links='
			+ links + '&texts=' + texts + '&pic_width=' + pic_width
			+ '&pic_height=' + pic_height + '&show_text=' + show_text
			+ '&txtcolor=' + txtcolor + '&bgcolor=' + bgcolor + '&button_pos='
			+ button_pos + '&stop_time=' + stop_time
			+ '" quality="high" width="' + pic_width + '" height="'
			+ swf_height + '" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	falshHTML += ('</object>');
	var _m = "<span style='position:absolute;display:block;width:"
			+ pic_width
			+ "px; height:"
			+ pic_height
			+ "px; z-index:1'><img src='http://www.shopxg.com/js/images/blank.gif' style='width:"
			+ pic_width + "px; height:" + pic_height
			+ "px;' border='0' /></span>"
	if ($(this).isLocal()) {
		$('#' + obj.fileAreaId).html(_m + falshHTML);
	} else {
		$('#' + obj.fileAreaId).html(falshHTML);
	}
}
function initPicLinkList(obj) {
	var obj = obj;
	var linkItemmodulelist = document.getElementById(obj.dataArea)
			.getElementsByTagName('div');
	for (var i = linkItemmodulelist.length - 1; i >= 0; i--) {
		if (linkItemmodulelist[i].getElementsByTagName('a')[0].getAttribute(
				'href', 2).replace(document.location.href, '').replace(
				'http://', '').indexOf('http://') != 0) {
			if (obj.dataArea.indexOf('linklist') >= 0) {
				linkItemmodulelist[i].getElementsByTagName('a')[0].href = 'http://'
						+ linkItemmodulelist[i].getElementsByTagName('a')[0]
								.getAttribute('href', 2).replace(
										document.location.href, '').replace(
										'http://', '');
			}
		}
	}
	switch (obj.type) {
		case 'text' :
			for (var i = linkItemmodulelist.length - 1; i >= 0; i--) {
				linkItemmodulelist[i].getElementsByTagName('a')[0].innerHTML = linkItemmodulelist[i]
						.getElementsByTagName('a')[0].getAttribute('title');
			}
			break;
		case 'pic' :
			break;
		case 'mix' :
			for (var i = linkItemmodulelist.length - 1; i >= 0; i--) {
				if (!((/^(http:\/\/)[\w\/\.]+$/).test(linkItemmodulelist[i]
						.getElementsByTagName('img')[0].src))) {
					linkItemmodulelist[i].getElementsByTagName('a')[0].innerHTML = linkItemmodulelist[i]
							.getElementsByTagName('a')[0].getAttribute('title');
				}
			}
			break;
		default :
			break;
	}
}
function checkGetPassWords(username, email, checkcode) {
	if (!(username && email)) {
		alert('用户名或电子邮件地址不对');
		return false;
	}
	if (username.length < 2) {
		alert('用户名太短');
		return false;
	}
	if (email.length < 6) {
		alert('请使用合法的电子邮件');
		return false;
	}
	if (checkcode) {
		if (checkcode.length != 4) {
			alert('验证码错误');
			return false;
		}
	}
	return true;
}
function checkModifyPass(oldPassWords, newPassWords1, newPassWords2, checkcode) {
	if (!oldPassWords || oldPassWords.length < 6) {
		alert('原始密码长度不小于6字符');
		return false;
	}
	if (!newPassWords1 || newPassWords1.length < 6) {
		alert('新密码长度不小于6字符');
		return false;
	}
	if (!newPassWords2 || newPassWords2.length < 6) {
		alert('确认密码长度不小于6字符');
		return false;
	}
}
function proBuyAction() {
	return true;
}
function initCheckCode() {
	var _rand = [];
	for(var i = 0; i < 4; i++){
		_rand.push(parseInt(Math.random() * 10));
	}
	
	return "http://www.shopxg.com/checkImage.aspx?k="+_rand.join('');
}


function checkReg(e) {
	var userName = document.getElementById('username' + e);
	var passWord = document.getElementById('password' + e);
	var passWord2 = document.getElementById('password2' + e);
	var eMail = document.getElementById('email' + e);
	var phone = document.getElementById('mobile' + e);
	var checkcode = document.getElementById('checkcode' + e);
	if (userName.value.length < 2) {
		alert('您输入的用户名太短！');
		return false;
	}
	if (passWord.value.length < 6) {
		alert('您输入的密码太短！');
		return false;
	}
	if (passWord2.value != passWord.value) {
		alert('两次输入的密码不同！');
		return false;
	}
	if (checkcode.value=="") {
		alert('验证码必须填写');
		return false;
	}
	return true;
}
function checkRegAS(e) {
	var userName = document.getElementById('username' + e);
	var passWord = document.getElementById('password' + e);
	var passWord2 = document.getElementById('password2' + e);
	var eMail = document.getElementById('email' + e);
	var phone = document.getElementById('mobile' + e);
	var site = document.getElementById('qq' + e);
	var checkcode = document.getElementById('checkcode' + e);
	if (userName.value.length < 2) {
		alert('您输入的用户名太短！');
		return false;
	}
	if (passWord.value.length < 6) {
		alert('您输入的密码太短！');
		return false;
	}
	if (passWord2.value != passWord.value) {
		alert('两次输入的密码不同！');
		return false;
	}
	if (site.value.length < 10) {
		alert('请输入正确的网店地址！');
		return false;
	}
	if (checkcode.value=="") {
		alert('验证码必须填写');
		return false;
	}
	return true;
}
function checkReg3(e) {
	var userName = document.getElementById('username' + e);
	var passWord = document.getElementById('password' + e);
	var passWord2 = document.getElementById('password2' + e);
	var eMail = document.getElementById('email' + e);
	var phone = document.getElementById('mobile' + e);
	var qq = document.getElementById('qq' + e);
var truename = document.getElementById('truename' + e);
var address = document.getElementById('address' + e);
var zhifubao = document.getElementById('zhifubao' + e);

	var checkcode = document.getElementById('checkcode' + e);
	if (userName.value.length < 2) {
		alert('您输入的用户名太短！');
		return false;
	}
	if (passWord.value.length < 6) {
		alert('您输入的密码太短！');
		return false;
	}
	if (passWord2.value != passWord.value) {
		alert('两次输入的密码不同！');
		return false;
	}
	if (eMail.value.length < 1) {
		alert('请输入正确的邮箱地址！');
		return false;
	}
if (eMail.value.charAt(0) == "." || eMail.value.charAt(0) == "@" || eMail.value.indexOf('@', 0) == -1|| eMail.value.indexOf('.', 0) == -1 || eMail.value.lastIndexOf("@") == eMail.value.length-1 || eMail.value.lastIndexOf(".") == eMail.value.length-1)
{
		alert('请输入正确的邮箱地址！');
		return false;
	}
	if (phone.value.length < 1) {
		alert('请输入正确的电话号码！');
		return false;
	}
	if (qq.value.length < 1) {
		alert('请输入正确的QQ号码！');
		return false;
	}
	if (truename.value.length < 1) {
		alert('请输入您的真实姓名！');
		return false;
	}
	if (address.value.length < 4) {
		alert('请输入正确的收货地址！');
		return false;
	}
	if (zhifubao.value.length < 1) {
		alert('请输入支付宝账户！');
		return false;
	}
	if (checkcode.value=="") {
		alert('验证码必须填写');
		return false;
	}
	return true;
}
function notebookAdd(moduleName) {
	var title = document.getElementById('title' + moduleName);
	var poster = document.getElementById('noter' + moduleName)
	var content = document.getElementById('content' + moduleName);
	if (title.value.length < 2) {
		alert('标题太短');
		return false;
	}
	if (poster.value.length < 2) {
		alert('您的大名太短了');
		return false;
	}
	if (content.value.length < 6) {
		alert('内容至少6个字');
		return false;
	}
	return true;
}
function checkLogin(moduleName) {
	var userName = document.getElementById('username' + moduleName);
	var passWord = document.getElementById('password' + moduleName);
	var checkCode = document.getElementById('checkCode' + moduleName);
	if (userName.value.length < 2) {
		alert('用户名太短');
		return false;
	}
	if (passWord.value.length < 6) {
		alert('密码太短');
		return false;
	}
	return true;
}
function chechProComment(moduleName) {

	var userName = document.getElementById('name' + moduleName);
	var content = document.getElementById('content' + moduleName);
	var proID = document.getElementById('proid' + moduleName);
	var proName = document.getElementById('proname' + moduleName);
	
	
	
	
	
	if (_product && _product._$id) {
		proID.value = _product._$id;
	} else {
		alert('id丢失，请更新产品大图模块');
		return false;
	}
	
	
	
	
	if (_product && _product._$name) {
		proName.value = _product._$name;
	} else {
		alert('产品名称丢失，请更新产品大图模块');
		return false;
	}
	if (userName.value.length < 2) {
		alert('请填写您的大名');
		return false;
	}
	if (content.value.length < 4) {
		alert('您填写的内容太少了吧');
		return false;
	}
	return true;
}

function gotoIN(k){
	//xgpay/inpour.aspx
	var price = parseInt( document.getElementById( k ).value );
	if( isNaN( price ) || price < 0){
		alert('请填写正确的充值金额');
		return;
	}
	window.open( '/' + k + '/inpour.aspx?price=' + price );
	
}

function checkShopReg(){
	var VDomainName = document.getElementById('DomainName').value.replace(/\s/g,'');
	var VDJDomainName = document.getElementById('DJDomainName').value.replace(/\s/g,'');
	var VUserName = document.getElementById('UserName').value.replace(/\s/g,'');
	var VPassWord = document.getElementById('PassWord').value.replace(/\s/g,'');
	var VPassWord2 = document.getElementById('PassWord2').value.replace(/\s/g,'');
	var VEmail = document.getElementById('Email').value.replace(/\s/g,'');
	var VShopName = document.getElementById('ShopName').value.replace(/\s/g,'');
	var VShopCate = document.getElementById('ShopCate').value.replace(/\s/g,'');
	var VShopStyle = document.getElementById('ShopStyle').value.replace(/\s/g,'');
	var VShopMemo = document.getElementById('ShopMemo').value.replace(/\s/g,'');
	var VRealName = document.getElementById('RealName').value.replace(/\s/g,'');
	var VPhone = document.getElementById('Phone').value.replace(/\s/g,'');
	var Vselect_c = document.getElementById('select_c').value.replace(/\s/g,'');
	var VIdCard = document.getElementById('IdCard').value.replace(/\s/g,'');
	var VContact = document.getElementById('Contact').value.replace(/\s/g,'');
	var VCode = document.getElementById('Code').value.replace(/\s/g,'');
	
	if(VDomainName == '' && VDJDomainName == ''){
		alert('请填写域名');
		return false;
	}
	
	if(VDomainName && (/[\w]{3,}/g).test(VDomainName) == false){
		alert('请填写正确的二级域名');
		return false;
	}
	
	if(VDJDomainName && (/[\w]{3,}/g).test(VDJDomainName) == false){
		alert('请填写正确的顶级域名');
		return false;
	}
	
	if(VUserName.length < 3){
		alert('用户名长度最小为3个字符');
		return false;
	}
	
	if(VPassWord.length < 6){
		alert('密码长度最小为6个字符');
		return false;
	}
	if( VPassWord != VPassWord2 ){
		alert('两次密码不相同');
		return false;
	}
	
	if(VEmail && (/[\w]{3,}@[\w]{1,}\.[\w]{1,}/).test(VEmail) == false){
		alert('EMail格式不正确');
		return false;
	}
	
	if(VShopStyle == ''){
		alert('请选择网站风格');
		return false;
	}
	
	if((/^([\d]{15})|([\d]{17}[xX])$/).test(VIdCard) == false){
		alert('身份证号码格式不正确');
		
	} 
	
	registerShopForm.submit();
	return false;

}

function _$V(dom/**id or dom object*/){
	//return document.getElementById(dom).value;
	
	return (
		(
			( typeof(dom) == 'object') ? 
				dom.value:
				document.getElementById(dom).value
		).replace(/^([\s])?/g,'').replace(/([\s])$/g,'')
	);
	
	
}

function checkDomainReg(){
	//域名

	
	var __txt1 = _$V('txt1'); 
	__txt1 = "cxl.com.cn";
	if( (/^[\w]{3,}[\.][\w\.]{3,}$/g).test( __txt1 ) == false ){
		alert('请输入合法的域名');
		return false;
	}
	var __strCompanyCN = _$V('strCompanyCN');
	if(__strCompanyCN ==''){
		alert('请输入公司名称');
		return false;
	}
	
	var __strCompanyEN = _$V('strCompanyEN');
	if( __strCompanyEN == '' ){
		alert('请输入合法的公司名称(英文)');
		return false;
	}
	
	var __strAddressCN = _$V('strAddressCN');
	
	
	var __strAddressEN = _$V('strAddressEN');
	if( __strAddressEN == '' ){
		alert('请输入合法的公司地址(英文)');
		return false;
	}
	
	var __strCityCN = _$V('strCityCN');
	if( __strCityCN == ''){
		alert('请输入城市名称中文');
		return false;
	}
	
	var __strCityEN = _$V('strCityEN');
	if( __strAddressEN == '' ){
		alert('请输入城市名称英文');
		return false;
	}
	
	var __strProvince = _$V('strProvince');
	if( __strCityCN == ''){
		alert('请输入所在省份');
		return false;
	}
	
	var __strPostcode = _$V('strPostcode');
	if( (/^[\d]{3,}$/).test( __strPostcode ) == false){
		alert('请输入合法的邮编');
		alert( __strPostcode );
		return false;
	}
	
	var __strNameCN = _$V('strNameCN');
	if( __strNameCN == ''){
		alert('注册人(中文名)');
		return false;
	}
	
	var __strNameEN = _$V('strNameEN');
	if( (/^[\w\.\s]{3,}$/).test( __strNameEN ) == false ){
		alert('注册人(英文名)');
		return false;
	}
	
	var __intPhoneAreaCode = _$V('intPhoneAreaCode');
	if( (/^[1-9]+$/).test( __intPhoneAreaCode ) == false ){
		alert( '联系电话(区号)' );
		return false;
	}
	
	var __intPhoneNumber = _$V('intPhoneNumber');
	if( (/^[\d]+$/g).test( __intPhoneNumber ) == false ){
		alert( '联系电话(号码)' );
		alert(__intPhoneNumber);
		return false;
	}
	
	var __intFaxAreaCode = _$V('intFaxAreaCode');
	if( (/^[\d]+$/g).test( __intFaxAreaCode ) == false ){
		alert( '传真号码(区号)' );
		return false;
	}
	
	var __intFaxNumber = _$V('intFaxNumber');
	if( (/^[\d]+$/g).test( __intFaxNumber ) == false ){
		alert( '传真号码(号码)' );
		return false;
	}
	
	
	var __strEmail = _$V('strEmail');
	if( (/^[\w]{3,}@[\w]{3,}\.[\w]{2,}$/).test( __strEmail ) == false ){
		alert( '请输入合法的邮件地址' );
		return false;
	}
	
	var __strTrade = _$V('strTrade');
	if( __strTrade == '' ){
		alert( '请选择行业编码(类型)' );
		return false;
	}
	
	var __strManager = _$V('strManager');
	if( __strManager == '' ){
		alert('请输入管理人(中文名)');
		return false;
	}
	registerDomainForm.submit();
	return false;
	
	
}

var menuTimeOut;
var menuObj;
function BarMenuShow( obj ){
	var _obj = obj.getElementsByTagName('div');
	if( menuObj ){
		menuObj.style.display = 'none';
		window.clearTimeout(menuTimeOut);
	}	
	if( _obj.length ){
		_obj[ 0 ].style.display = 'block';
	}
}

function BarMenuHidden( obj ){

	var _obj = obj.getElementsByTagName('div');
	menuObj = _obj[ 0 ];
	if( _obj.length ){
		menuTimeOut = window.setTimeout(hidden,300);
	}
	
	function hidden(){
		_obj[ 0 ].style.display = 'none';
	}
}

var ChineseNumber = function(k){
	var sample = ['日','一','二','三','四','五','六'];
	if(typeof(k) != "number")return "";
	if(k < 0 || k > 6)return "";
	return sample[ k ];
}
var labelDate = function(){
	var t = new Date();
	labelDate = function(){
		
		return "今天是："+t.getFullYear()+"年"+(t.getMonth() + 1)+"月"+t.getDate()+"日 星期" + ChineseNumber( t.getDay() );
	}
	return labelDate();
};

// document.write(labelDate());