Object.extend = function(destination, source){ for (property in source) destination[property] = source[property]; return destination;};if (window.HTMLElement){ HTMLElement.prototype.__defineSetter__("innerText",function(sText) { var parsedText=document.createTextNode(sText); this. TML=parsedText; return parsedText; }); HTMLElement.prototype.__defineGetter__("innerText",function(){ var r=this.ownerDocument.createRange(); r.selectNodeContents(this); return r.toString(); }); HTMLElement.prototype.__defineGetter__("children", function(){ for (var i = 0; i < this.childNodes.length; i++) { var node = this.childNodes[i]; if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) this.removeChild(node); } return this.childNodes; });}var Element = { next : function(elem) { var n = elem; do { n = n.nextSibling; } while (n && n.nodeType != 1) return n; }, prev : function(elem) { var n = elem; do{ n = n.previousSibling; } while (n && n.nodeType != 1) return n; }, show : function(elem, arg) { if (navigator.isIE()) if (arg=="table" || arg=="table-row" || arg=="table-cell") arg = "block"; elem.style.display = (typeof(arg) == "undefined") ? "" : arg; }, hide : function(elem) { elem.style.display = "none"; }, remove : function(elem) { elem.parentNode.removeChild(elem); }, addClass : function(elem, className) { if (!this.hasClass(elem, className)){ var arr = elem.className.split(" "); arr.push(className); elem.className = arr.join(" "); } }, removeClass :function(elem, className) { if (this.hasClass(elem, className)){ var arr = elem.className.split(" "); arr.remove(className); elem.className = arr.join(" "); } }, hasClass : function(elem, className) { var arr = elem.className.split(" "); return arr.inArray(className); }, contains : function(elem, find){ do { if (find == elem) { return true; } } while(find = find.parentNode) return false; }, getPosition : function(elem) { var valueT = 0, valueL = 0; do { valueT += elem.offsetTop || 0; valueL += elem.offsetLeft || 0; elem = elem.offsetParent; } while (elem); var pos = {top:valueT,left:valueL}; return pos; }, getStyle: function(element, style) { element = $(element); style = style == 'float' ? 'cssFloat' : style; var value = ''; try { var value = element.style[style]; } catch(ex) { return value; } if (!value) { if(element.currentStyle) { value = element.currentStyle[style]; } else { var css = document.defaultView.getComputedStyle(element, null); value = css ? css[style] : null; } } if (style == 'opacity') return value ? parseFloat(value) : 1.0; return value == 'auto' ? null : value; }, setSelectable: function(elem, selectable) { if (navigator.isFirefox()) { if (selectable) elem.style.MozUserSelect = ""; else elem.style.MozUserSelect = "none"; } else { if (selectable) Event.stopObserving(elem, "selectstart", this._falseFunction); else Event.observe(elem, "selectstart", this._falseFunction); } }, _falseFunction: function() { return false; }, cleanWhitespace: function(element) { for (var i = 0; i < element.childNodes.length; i++) { var node = element.childNodes[i]; if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) element.removeChild(node); } }};if (window.Event) { Event.prototype.__defineSetter__("returnValue",function(e){ if(!e)this.preventDefault(); return e;}); Event.prototype.__defineGetter__("srcElement",function(){ var node=this.target;while(node.nodeType!=1){node=node.parentNode};return node;}); Event.prototype.__defineSetter__("cancelBubble",function(b){ if(b)this.stopPropagation(); return b; });} else { var Event = new Object();}Object.extend(String.prototype, { trim : function() { return this.replace(/^\s*(.*?)\s*$/, '$1'); }, escape : function() { return this.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');}, isEmpty : function() { return (this.trim() == ''); },isEmail : function() { var reg = /^([a-z0-9+_]|\-|\.|\-)+@([\w|\-]+\.)+[a-z]{2,4}$/i; return reg.test(this); }, isDate : function() { var reg = /^\d{4}-(0?[1-9]|1[0-2])-(0?[1-9]|[1-2]\d|3[0-1])$/; return reg.test(this); }, isTime : function() { var reg = /^([0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$/; return reg.test(this); }});Object.extend(navigator, { isIE : function() { return this.userAgent.toLowerCase().indexOf("msie") != - 1; }, isFirefox : function() { return this.userAgent.toLowerCase().indexOf("firefox") != - 1; }, isSafari : function() { return this.userAgent.toLowerCase().indexOf("safari") != - 1; }, isOpera : function() { return this.userAgent.toLowerCase().indexOf("opera") != - 1; }});Object.extend(document, { getCookie : function(sName) { var aCookie = this.cookie.split("; "); for (var i=0; i < aCookie.length; i++){ var aCrumb = aCookie[i].split("="); if (sName == aCrumb[0]) return decodeURIComponent(aCrumb[1]); } return null; }, setCookie : function(sName, sValue, sExpires) { var sCookie = sName + "=" + encodeURIComponent(sValue); if (sExpires != null) sCookie += "; expires=" + sExpires; this.cookie = sCookie; }, removeCookie : function(sName) { this.cookie = sName + "=; expires=Fri, 31 Dec 1999 23:59:59 GMT;"; }, require : function(path, callback, type){ var s,i; var id = path.replace(".","").replace("/",""); if (!type || type == "js"){ var ss = this.getElementsByTagName("script"); for(i =0;i < ss.length; i++){ if(ss[i].src && ss[i].src.indexOf(path) != -1)return ss[i]; } s = $ce("script"); s.id = id; s.type = "text/javascript"; s.src = path; } else { var ss = this.getElementsByTagName("link"); for(i =0;i < ss.length; i++){ if(ss[i].src && ss[i].src.indexOf(path) != -1)return ss[i]; } s = $ce("link"); s = document.createElement("link"); s.rel = "stylesheet"; s.type = "text/css"; s.href = path; s.disabled = false; } var head = this.getElementsByTagName("head")[0]; head.appendChild(s); if (callback) { if (!navigator.isIE() && type == "css") { window.setTimeout(function(){callback.call()}, 500); } else { s.onload = s.onreadystatechange= function(){ if(this.readyState && this.readyState=="loading")return; callback.call(); } } } }});Object.extend(Array.prototype, { isEmpty : function() { return (this.length == 0); }, inArray : function(item) { return (this.itemIndex(item) > -1); }, remove : function(item, num) { var removed = 0; for (var i=0; i<this.length; i++) { if (this[i] == item) { this.splice(i, 1); if (num > 0 && num >= removed) break; removed++; } } }, itemIndex : function(item) { var reval = -1; for (var i=0; i<this.length; i++) { if (this[i] == item) { reval = i; break; } } return reval; }});Object.extend(Event, { pointerX: function(event) { return event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)); }, pointerY: function(event) { return event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)); }, observers: false, _observeAndCache: function(element, name, observer, useCapture) { if (!this.observers) this.observers = []; if (element.addEventListener) { this.observers.push([element, name, observer, useCapture]); element.addEventListener(name, observer, useCapture); } else if (element.attachEvent) { this.observers.push([element, name, observer, useCapture]); element.attachEvent('on' + name, observer); } }, observe: function(element, name, observer, useCapture) { useCapture = useCapture || false; if (name == 'keypress' && ((navigator.appVersion.indexOf('AppleWebKit') > 0) || element.attachEvent)) name = 'keydown'; this._observeAndCache(element, name, observer, useCapture); }, stopObserving: function(element, name, observer, useCapture) { useCapture = useCapture || false; if (name == 'keypress' && ((navigator.appVersion.indexOf('AppleWebKit') > 0) || element.detachEvent)) name = 'keydown'; if (element.removeEventListener) { element.removeEventListener(name, observer, useCapture); } else if (element.detachEvent) { element.detachEvent('on' + name, observer); } }});if (window.HTMLTableRowElement) HTMLTableRowElement.prototype.__defineGetter__('rowIndex', function() { var index = -1; var table = this.parentNode.parentNode; for (i = 0; i < table.rows.length; i ++ ) { if (table.rows[i] == this) { index = i; break; } } return index; });if (!window.HTMLElement) { window['innerHeight'] = { valueOf:function(){return document.documentElement.clientHeight;}, toString:function(){return document.documentElement.clientHeight;} }; window['innerWidth'] = { valueOf:function(){return document.documentElement.clientWidth;}, toString:function(){return document.documentElement.clientWidth;} };};if (typeof(Function.prototype.call) != "function") { Function.prototype.call = function (obj) { obj._554fcae493e564ee0dc75bdf2ebf94ca = this; var args = []; for (var i = 0; i < arguments.length - 1; i++){ args[i] = "arguments[" + (i + 1) + "]"; } var result = eval("obj._554fcae493e564ee0dc75bdf2ebf94ca(" + args.join(",") + ");"); delete obj._554fcae493e564ee0dc75bdf2ebf94ca; return result; }}Function.prototype.bind = function(object) { var __method = this; return function(){__method.apply(object, arguments); }};function $(id, win) { var elem; if (typeof win === 'undefined') win = window; elem = (typeof(id)=="string") ? win.document.getElementById(id) : elem = id; return elem;}function $ce(tagName, doc) { if (typeof doc === 'undefined') doc = document; var newElem = doc.createElement(tagName); return newElem;}function $class(className, parentElement, tagName) { var elements = new Array(); var children = ($(parentElement) || document.body).getElementsByTagName(tagName||'*'); for(var i=0; i<children.length; i++) { if (children[i].className.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) elements.push(children[i]); } elements.item = function(idx){ return this[idx]; }; return elements;}function fixEvent(e, win) { if (typeof win === 'undefined') win = window; var evt = (typeof e == "undefined") ? win.event : e; return evt;}function confirm_redirect(msg, url) { if (confirm(msg)) location.href=url; }var ui = {};var Ajax = { _onComplete : function () {}, _onRunning : function () {}, method : 'GET', setReturnType : function (type) { if (typeof(type) == 'string' && (type.toUpperCase() == 'JSON' || type.toUpperCase() == 'XML' || type.toUpperCase() == 'TEXT')) { this.returnType = type.toUpperCase(); }}, addVal : function (key, val) { if (!this.data) this.data = new Object; this.data[key] = val; }, call : function (url, callback, method, asyn) { if (typeof(method) == 'string' && (method.toUpperCase() == 'GET' || method.toUpperCase() == 'POST')) method = method.toUpperCase(); else{ if (data && data.length>0) method = 'POST'; else method = 'GET'; } if (url.indexOf('http') != 0) { url = location.href.substr(0,location.href.lastIndexOf('/')) + '/' + url; } this.method = method; var data = ''; if (this.data) { data += this.joinData(this.data); delete(this.data); } var returnType = ''; if (this.returnType) { returnType = this.returnType; delete(this.returnType); }else returnType = 'JSON'; if (asyn != undefined) asyn = asyn ? true : false; else asyn = true; if (method == "GET"){ url += url.indexOf("?") >= 0 ? "&" : "?"; if (data && data.length > 0) {url += data; data =''} } if (window.XMLHttpRequest) { var xhr = new XMLHttpRequest(); }else{ var MSXML = ['MSXML2.XMLHTTP.6.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP']; for(var n = 0; n < MSXML.length; n ++) { try { var xhr = new ActiveXObject(MSXML[n]); break; } catch(e) {} }} try { if (typeof(this._onRunning) == 'function') this._onRunning(); xhr.open(method, url, asyn); xhr.setRequestHeader('Ajax-Request', "1"); if (method == 'POST') xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8'); if (asyn) { xhr.onreadystatechange = function() { if (xhr.readyState == 4) { if (typeof(Ajax._onComplete) == 'function') Ajax._onComplete(); if (xhr.status == 200) { if (typeof(callback) == 'function') { var result = Ajax.parseResult(xhr, returnType); callback(result, xhr.responseText); }}else{ throw("An HTTP error " + xhr.status + "occurred. \n" + url); } xhr = null; } }; if (xhr != null) xhr.send(data); }else{ xhr.send(data); if (typeof(Ajax._onComplete) == 'function') Ajax._onComplete(); if (xhr.status == 200) { var result = this.parseResult(xhr, returnType); if (typeof(callback) == 'function') callback(result, xhr.responseText); return result; }else{ throw("An HTTP error " + xhr.status + "occurred. \n" + url); }} }catch(e){alert(e);} }, joinData : function (param, pre){ var returnVal = ''; if (typeof(param) == 'string') { var pos = param.indexOf('='); if (pos > 0) returnVal += this.encode(param.substr(0, pos)) + '=' + this.encode(param.substr(pos+1)) + '&'; else returnVal += 'noindex[]=' + this.encode(param) + '&'; } else if (typeof(param) == 'object') { for (n in param) { switch (typeof(param[n])) { case 'string': if (pre == undefined) { returnVal += n + '=' + this.encode(param[n]) + '&'; } else { returnVal += pre + '[' + n + ']=' + this.encode(param[n]) + '&'; } break; case 'number': if (pre == undefined) { returnVal += n + '=' + param[n] + '&'; } else { returnVal += pre + '[' + n + ']=' + param[n] + '&'; } break; case 'boolean': var val = param[i] ? 1 : 0; if (pre == undefined) { returnVal += n + '=' + val + '&'; } else { returnVal += pre + '[' + n + ']=' + val + '&'; } break; case 'object': if(param[n].length == 0){ if (pre == undefined) { returnVal += n + '=&'; } else { returnVal += pre + '[' + n + ']=&'; }}else{ if (pre == undefined) { returnVal += this.joinData(param[n], n); } else { returnVal += this.joinData(param[n], pre + '[' + n + ']'); } } break; default: } } } if (pre == undefined) returnVal = returnVal.substr(0, returnVal.length -1); return returnVal; }, encode : function(str) { return encodeURIComponent(str); }, parseResult : function (xhr, returnType) { var result; if (returnType == 'JSON') { result = Ajax.parseJSON(xhr.responseText); if (!result) result = {}; } else if (returnType == 'TEXT') { result = xhr.responseText; } else if (returnType == 'XML') { result = xhr.responseXML; } return result; }, parseJSON : function (filter) { try { if (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/. test(filter)) { var j = eval('(' + filter + ')'); if (typeof filter === 'function') { function walk(k, v) { if (v && typeof v === 'object') { for (var i in v) { if (v.hasOwnProperty(i)) { v[i] = walk(i, v[i]); }}} return filter(k, v); } j = walk('', j); } return j; } } catch (e) {}}};if ( ! Object.prototype.toJSONString) { Array.prototype.toJSONString = function () { var a = ['['], b, i, l = this.length, v; function p(s) { if (b) { a.push(','); } a.push(s); b = true; } for (i = 0; i < l; i ++) { v = this[i]; switch (typeof v) { case 'undefined': case 'function': case 'unknown': break; case 'object': if (v) { if (typeof v.toJSONString === 'function') { p(v.toJSONString()); } } else { p("null"); } break; default: p(v.toJSONString()); } } a.push(']'); return a.join(''); }; Boolean.prototype.toJSONString = function () { return String(this); }; Date.prototype.toJSONString = function () { function f(n) { return n < 10 ? '0' + n : n; } return '"' + this.getFullYear() + '-' + f(this.getMonth() + 1) + '-' + f(this.getDate()) + 'T' + f(this.getHours()) + ':' + f(this.getMinutes()) + ':' + f(this.getSeconds()) + '"'; }; Number.prototype.toJSONString = function () { return isFinite(this) ? String(this) : "null"; }; Object.prototype.toJSONString = function () { var a = ['{'], b, k, v; function p(s) { if (b) { a.push(','); } a.push(k.toJSONString(), ':', s); b = true; } for (k in this) { if (this.hasOwnProperty(k)) { v = this[k]; switch (typeof v) { case 'undefined': case 'function': case 'unknown': break; case 'object': if (v) { if (typeof v.toJSONString === 'function') { p(v.toJSONString()); } } else { p("null"); } break; default: p(v.toJSONString()); } } } a.push('}'); return a.join(''); }; (function (s) { var m = { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\' }; s.parseJSON = function (filter) { try { if (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/. test(this)) { var j = eval('(' + this + ')'); if (typeof filter === 'function') { function walk(k, v) { if (v && typeof v === 'object') { for (var i in v) { if (v.hasOwnProperty(i)) { v[i] = walk(i, v[i]); } } } return filter(k, v); } j = walk('', j); } return j; } } catch (e) { } throw new SyntaxError("parseJSON"); }; s.toJSONString = function () { var _self = this.replace("&", "%26"); if (/["\\\x00-\x1f]/.test(this)) { return '"' + _self.replace(/([\x00-\x1f\\"])/g, function(a, b) { var c = m[b]; if (c) { return c; } c = b.charCodeAt(); return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16); }) + '"'; } return '"' + _self + '"'; }; })(String.prototype);}window.threadList = {};ui.effect = { FadeTo:function(element, start, end, duration, callback){ var self = element, step = 0; if(end == undefined){ end=start; duration=0; } var tid = "___a2d3e" + Math.floor(Math.random()*10+1); if(duration<=0) start=end; else step=10*(end-start)/duration; function t(){ start+= step; if((start-end)*step>=0)start=end; self.style.filter='alpha(opacity='+Math.round(start)+')'; if(!self.style.filters) self.style.MozOpacity=Math.round(start)/100; if(start!=end) window.threadList[tid] = window.setTimeout(arguments.callee,10); else if(callback) callback.call(); }; window.threadList[tid] = window.setTimeout(t, 10); return tid; }, _setOpacity:function(elem, value) { elem.style.filter='alpha(opacity='+Math.round(value)+')'; if(!elem.style.filters) elem.style.MozOpacity=Math.round(value)/100; }, ResizeTo:function(element,width, height, duration){ var self = element, step = 0; var startWidth = self.offsetWidth; var startHeight = self.offsetHeight; stepW = 10 * (width-self.offsetWidth)/duration; stepH = 10 * (height-self.offsetHeight)/duration; function t(){ startWidth += stepW; startHeight += stepH; if((startWidth-width)*stepW>=0)startWidth=width; if((startHeight-height)*stepH>=0)startHeight=height; self.style.width = parseInt(startWidth) + "px"; self.style.height = parseInt(startHeight) + "px"; if(startWidth!=width && startHeight != height)window.setTimeout(arguments.callee,10); }; window.setTimeout(t,10); }, SlideUp: function(){}, ResizeHeightTo:function(element, height, duration, callback){ var self = element, step = 0; var startHeight = self.offsetHeight; step = parseInt(10 * (height-self.offsetHeight)/duration); s = true; if (step>0) { s = false; } function t(){ startHeight += step; if((s && (startHeight-height) < 0) || (!s && (startHeight-height) > 0)) { startHeight=height; } self.style.height = startHeight + "px"; if(startHeight != height)window.setTimeout(arguments.callee,10); else if(callback) callback(); }; window.setTimeout(t,10); } ,MoveTo:function(element, x, y, duration){ var self = element, step = 0; var startLeft = Element.getPosition(self).left; var startTop = Element.getPosition(self).top; stepL = 10 * (x-self.offsetWidth)/duration; stepH = 10 * (height-self.offsetHeight)/duration; function t(){ startWidth += stepW; startHeight += stepH; if((startWidth-width)*stepW>=0)startWidth=width; if((startHeight-height)*stepH>=0)startHeight=height; self.style.width = parseInt(startWidth) + "px"; self.style.height = parseInt(startHeight) + "px"; if(startWidth!=width && startHeight != height)window.setTimeout(arguments.callee,10); }; window.setTimeout(t,10); }, blink : function(element, time) { var count = 0; function t() { if (count>=time) { ui.effect._setOpacity(element, 100); return; } count++; if (count%2 == 0)ui.effect._setOpacity(element, 90);else ui.effect._setOpacity(element, 30); window.setTimeout(arguments.callee, 120); } window.setTimeout(t,10); } ,scroll:function(direction, element, distance, duration, callback){ var self = element; var step = 10*(distance)/duration; var scrollLeft = self.scrollLeft; var target = distance; var callback = callback ? callback : new Fucnction(); function t() { switch(direction){ case 'left': if(self.scrollLeft > (target+scrollLeft)) { self.scrollLeft = distance+scrollLeft; callback.call(); return; }; self.scrollLeft += step; break; case 'right': self.scrollLeft -= step; if (self.scrollLeft<=0 || self.scrollLeft<=(scrollLeft - distance)) { self.scrollLeft = scrollLeft - distance; callback.call(); return; }; break; }; window.setTimeout(arguments.callee,10); }; window.setTimeout(t,10); }, shadow: function (obj) { var shadow = $ce('div'); shadow.className = 'ECM_shadow_layer'; shadow.style.cssText = 'background:#aaaaaa none repeat scroll 0%;'; shadow.style.zIndex= obj.style.zIndex; shadow.style.height= obj.style.height; shadow.style.top = obj.style.top; shadow.style.left = obj.style.left; shadow.style.position = 'fixed'; if (navigator.isIE()) { shadow.style.position = 'absolute'; Event.observe(window, 'scroll', function () { shadow.style.top= (document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop) + 100; }); } obj.style.position = 'relative'; obj.style.left = '-3px'; obj.style.top = '-3px'; shadow.appendChild(obj); return shadow; }};Event.observe(window, 'load', function(){document.require("js/ui.dialog/style.css", null, "css");});var DIALOG_WARNING = 0;var DIALOG_MESSAGE = 1;var DIALOG_CONFIRM = 2;var DIALOG_USERDEF = 3;var DIALOG_PROMPT = 4;var DIALOG_LOGINFORM = 5;var DIALOG_TIP = 6;var DIALOG_PROGRESS = 7;var DIALOG_ACTION_CLOSE = 10;Dialog = function (dType) { var self = this; this.type = dType; this.body = null; this.className = null; this.content = 'Undefine'; this.title = ''; this.width = 300; this.height = 0; this.isLockScreen = true; this.summary = ''; this.inputSize = 25; this.inputType = 'text'; this.value = ''; this.locker = null; this.isShadow = true; this.isSingle = false; this.inDoc = false; this.isDraggable = true; this.refer = null; this.autoCloseTime = 0; this.timeoutID = null; this.fadeTime = 0; this.okBtnName = lang.confirm ? lang.confirm : 'OK'; this.cancelBtnName = lang.cancel ? lang.cancel : 'Cancel'; this.closeBtnName = lang.close ? lang.close : 'X'; this.value = ''; this.components = { icon : 'info', buttons : [], inputs : [], summary : null, titleBar: null, titleText:null, closeButton:null, contentBody:null, messageBody:null, messageText:null, buttonsBar :null, progressBar:null }; this.onChange = function () { self.value = this.value; }; this.onClose = function () { return true; }; this.onOK = function () { self.close(); }; this.onLoad = function () { }; this.createDialogBody();};Dialog.prototype.init = function () { switch (this.type) { case DIALOG_CONFIRM: this.addButton(this.okBtnName, this.onOK, true); this.addButton(this.cancelBtnName, DIALOG_ACTION_CLOSE); break; case DIALOG_PROMPT: this.value= ''; this.content += ': '; this.addButton(this.okBtnName, this.onOK, true); this.addButton(this.cancelBtnName, DIALOG_ACTION_CLOSE); this.addInput(this.inputSize, this.inputType); this.addSummary(this.summary); break; case DIALOG_WARNING: this.components.icon = 'warn'; this.addButton(this.okBtnName, this.onOK, true); this.addButton(this.cancelBtnName, DIALOG_ACTION_CLOSE); break; case DIALOG_MESSAGE: this.addButton(this.okBtnName, this.onOK, true); break; case DIALOG_USERDEF: break; case DIALOG_TIP: this.isLockScreen = false; this.isShadow = false; this.isDraggable = false; this.className = 'ECM_dialog_tip'; break; case DIALOG_PROGRESS: this.showProgressCtrl(); break; default: break; }};Dialog.prototype.createDialogBody = function () { this.body = $ce('div'); this.components.titleBar = $ce('h3'); this.components.titleText = $ce('span'); this.components.closeButton = $ce('span'); this.components.contentBody = $ce('div'); this.components.messageBody = $ce('div'); this.components.messageText = $ce('div'); this.components.buttonsBar = $ce('div'); this.body.appendChild(this.components.titleBar); this.body.appendChild(this.components.contentBody); this.components.titleBar.appendChild(this.components.titleText); this.components.titleBar.appendChild(this.components.closeButton); this.components.contentBody.appendChild(this.components.messageBody); this.components.messageBody.appendChild(this.components.messageText); this.components.contentBody.appendChild(this.components.buttonsBar);};Dialog.prototype.setSize = function (w, h) { if (!isNaN(w)) { this.width = w; } if (!isNaN(h)) { this.height = h; }};Dialog.prototype.setStyle = function (c) { if (c) { this.className = c; }};Dialog.prototype.setContent = function (t, c) { this.title = t; this.content = c;};Dialog.prototype.changeContent = function (t, c) { this.components.titleText.innerHTML = t; this.components.messageText.innerHTML = c;};Dialog.prototype.addButton = function (n, e, strike, close) { var self = this; var b = $ce('input'); b.type = 'button'; b.value = n; if (strike) { b.className = 'ECM_dialog_strike_button'; } switch (e) { case DIALOG_ACTION_CLOSE: b.onclick = this.close.bind(this); break; default: if (close) { b.onclick = function () { if(e)e(); self.close(); }; } else { if(e)b.onclick = e; } break; } if (!this.inDoc) { this.components.buttons.push(b); } else { this.components.buttonsBar.appendChild(b); if (this.components.buttonsBar.style.display == 'none') { this.components.buttonsBar.style.display = ''; } }};Dialog.prototype.addInput = function (size, type) { if (!type) { type = 'text'; } if (!size) { size = 25; } var _ipt = $ce('input'); _ipt.type = type; _ipt.size = size; _ipt.onchange = this.onChange; this.components.inputs.push(_ipt);};Dialog.prototype.addSummary = function (text) { var _s = $ce('div'); _s.className = 'ECM_dialog_summary'; _s.innerHTML = text; this.components.summary = _s;};Dialog.prototype.showProgressCtrl = function () { this.components.progressCtrl = $ce('div'); this.components.progressCtrl.className = 'ECM_dialog_progress_bar'; this.components.icon = null; this.components.progressDetail = $ce('div'); this.components.progressDetail.className = 'ECM_dialog_progress_detail'; this.components.messageBody.style.textAlign = 'center'; this.components.messageBody.appendChild(this.components.progressCtrl); this.components.messageBody.appendChild(this.components.progressDetail);};Dialog.prototype.addResult = function (n, r, e) { var l = $ce('div'); var rzt = $ce('span'); var m = $ce('span'); l.className = 'ECM_dialog_progress_result_item'; rzt.innerHTML = r; rzt.className = 'result'; m.innerHTML = n; l.appendChild(rzt); l.appendChild(m); if (e) { e(); } this.components.progressDetail.appendChild(l);};Dialog.prototype.hideProgressCtrl = function () { this.components.progressCtrl.style.display = 'none';};Dialog.prototype.pointTo = function (o) { this.refer = o;};Dialog.prototype.show = function () { this.init(); var self = this; this.components.titleText.innerHTML = this.title; this.components.closeButton.innerHTML = this.closeBtnName; this.components.closeButton.title = this.closeBtnName; this.components.closeButton.onclick = this.close.bind(this); this.components.messageText.innerHTML = this.content; this.body.className = this.className ? this.className : 'ECM_dialog_box'; this.components.titleBar.className = 'ECM_dialog_title'; this.components.closeButton.className = 'ECM_dialog_close_button'; this.components.titleText.className = 'ECM_dialog_title_span'; this.components.contentBody.className = 'ECM_dialog_body'; this.components.messageBody.className = 'ECM_dialog_message_body'; this.components.messageText.className = 'ECM_dialog_message_text'; this.components.buttonsBar.className = 'ECM_dialog_button_bar'; if (this.components.inputs.length > 0) { for (var i=0; i<this.components.inputs.length; i++) { this.components.messageText.appendChild(this.components.inputs[i]); } } if (this.components.summary != null) { this.components.messageBody.appendChild(this.components.summary); } if (this.components.buttons.length > 0) { for (var i=0; i<this.components.buttons.length; i++) { this.components.buttonsBar.appendChild(this.components.buttons[i]); } this.components.messageBody.style.paddingBottom = '10px'; } else { this.components.buttonsBar.style.display = 'none'; } if (this.components.icon !== null) { this.components.contentBody.className += ' ECM_dialog_icon_'+this.components.icon; this.components.messageBody.style.paddingLeft = '35px'; } if (this.className) { this.body.className = this.className; } if (this.width) { this.body.style.width = this.width + 'px'; } if (this.height) { this.body.style.height = this.height + 'px'; } if (this.isShadow) { this.body = ui.effect.shadow(this.body); } if (this.isLockScreen) { this.body.style.zIndex = 99999; this.lockScreen(); } else { this.body.style.zIndex = 999; } if (this.isDraggable) { new ui.Draggable(this.body, this.components.titleBar); } if (!this.isSingle || !this.inDoc) { this.body.style.visibility = 'hidden'; this.body.style.top = '-100000px'; document.body.appendChild(this.body); this.inDoc = true; } else { Element.show(this.body); } if (this.refer) { this.body.style.position = 'absolute'; var pos = Element.getPosition(this.refer); this.body.style.left= pos.left - this.body.offsetWidth/2 + this.refer.offsetWidth/2 + 'px'; if ((pos.top - (document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop))+this.body.offsetHeight > window.innerHeight) { this.body.style.top = pos.top - this.body.offsetHeight + 'px'; this.components.titleBar.className = 'ECM_dialog_title_bottom'; this.body.appendChild(this.components.titleBar); } else { this.body.style.top = pos.top + this.refer.offsetHeight + 'px'; } } else { this.moveToCenter(); } if (this.fadeTime > 0) { this.body.style.opacity = 0; this.body.style.filter='alpha(opacity=0)'; this.body.style.visibility = 'visible'; this.setAutoClose(); ui.effect.FadeTo(this.body, 0, 100, this.fadeTime * 1000); } else { this.body.style.visibility = 'visible'; this.setAutoClose(); } if (this.onLoad) { this.onLoad(); }};Dialog.prototype.moveToCenter = function () { var _x = document.body.scrollWidth; var _y = window.innerHeight > 0 ? window.innerHeight : document.body.clientHeight; var _s_h=0; if (this.body.style.position != 'fixed') { _s_h= document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop; } c_x = _x /2 - this.width/2; c_y = _y/2 + _s_h - this.body.clientHeight/2; this.body.style.left = c_x + 'px'; this.body.style.top = c_y + 'px';};Dialog.prototype.close = function () { if (this.body !== null) { var self = this; if (this.onClose) { if(!this.onClose())return; } if (this.fadeTime) { ui.effect.FadeTo(this.body, 100, 0, this.fadeTime * 1000, function () { if (!self.isSingle) { Element.remove(self.body); self.body = null; } else { Element.hide(self.body); } }); } else { if (!this.isSingle) { Element.remove(this.body); this.body = null; } else { Element.hide(this.body); } } if (this.isLockScreen) { this.unlockScreen(); } }};Dialog.prototype.isClosed = function () { return (this.body.style.display == 'none' || !this.inDoc) ? true : false;};Dialog.prototype.lockScreen = function () { if (this.locker === null) { this.locker = new ui.utils.locker(); } this.locker.lock(20);};Dialog.prototype.unlockScreen= function () { if (this.locker !== null) { this.locker.unLock(); }};Dialog.prototype.setAutoClose = function () { if (this.autoCloseTime) { var self = this; this.body.onmouseover = function () { clearTimeout(self.timeoutID); }; this.body.onmouseout = function () { self.setAutoClose(); }; this.timeoutID = setTimeout(function () { self.close(); }, (this.autoCloseTime+this.fadeTime) * 1000); }};Dialog.prototype.focus = function () { if (this.components.inputs[0]) { this.components.inputs[0].focus(); }};ui.utils = {};ui.utils.tabForm = function (formName, classActived) { this._curr = 0; if (classActived) this.actived = classActived; else this.actived = "actived"; var _self = this; var form = $(formName); var tabBar = $class("tab-bar", form)[0]; var tabPage = $class("tab-page", form)[0]; $(formName).style.display = "block"; tabBar.children[0].className = _self.actived; for (i=0; i<tabPage.children.length; i++) if (i > 0) Element.hide(tabPage.children[i]); tabBar.onclick = function(e) { var evt = fixEvent(e); var obj = evt.srcElement; if (obj.tagName == "LI") { for (i=0; i<tabBar.children.length; i++) { if (tabBar.children[i] == obj) { if (tabBar.children[i].getAttribute("disabled") == "true") return; tabBar.children[_self._curr].className = ''; obj.className = _self.actived; Element.hide(tabPage.children[_self._curr]); Element.show(tabPage.children[i],'table'); _self._curr = i; break; } } } };};ui.utils.ImagePreview = function(src, width, height){ var img = new Image(); var div = $ce("DIV"); div.style.position = "absolute"; div.style.top = "300px"; div.innerHTML = "loading"; img.src = src + "?r=" + Math.random(); img.onload = function() { img.width = img.height = 0; _w = img.width; _h = img.height; img.style.display = ""; ui.effect.ResizeTo(img, _w, _h,200); }; div.appendChild(img); document.body.appendChild(div);};ui.utils.locker = function(color) { this.layer = $ce("div"); this.innerLayer = $ce("div"); if (!color) color = "#000"; this.layer.style.cssText = "background:" + color + ";left:0px;position:absolute;top:0px;z-index:9999;"; this.innerLayer.style.position = "relative"; this.innerLayer.style.left = this.innerLayer.style.top = "0px"; ui.effect._setOpacity(this.layer, 30); this.layer.appendChild(this.innerLayer); Element.hide(this.layer); this.locked = false; document.body.appendChild(this.layer);};ui.utils.locker.prototype = { lock : function(opa) { if (!opa) opa = 50; ui.effect._setOpacity(this.layer, opa); Element.show(this.layer); this.locked = true; this.resize(); if (navigator.isIE()) { dropDownLists = document.getElementsByTagName("SELECT"); Outer: for (var i = 0; i< dropDownLists.length; i++) { var list = dropDownLists[i]; var elem = list; Inter: do { if (Element.getStyle(elem, "position") == "absolute") { continue Outer; } } while((elem = elem.parentNode) != document.body) list.style.visibility = "hidden"; } } }, resize : function() { if (window.self.innerHeight) { this.innerHeight = Math.max(window.self.innerHeight,document.body.scrollHeight); } else { if (document.documentElement && document.documentElement.clientHeight) { this.innerHeight = Math.max(document.documentElement.clientHeight,document.documentElement.scrollHeight); } else if (document.body) { this.innerHeight = Math.max(document.body.clientHeight,document.body.scrollHeight); } } var innerWidth = Math.min(document.body.scrollWidth, self.innerWidth||document.body.clientWidth); this.layer.style.width = innerWidth + "px"; this.innerLayer.style.width = this.layer.style.width; var h = this.innerHeight-1; this.layer.style.height = h + "px"; this.innerLayer.style.height = h + "px"; }, unLock : function() { this.locked = false; Element.hide(this.layer); if (navigator.isIE()) { dropDownLists = document.getElementsByTagName("SELECT"); for (var i = 0; i< dropDownLists.length; i++) { dropDownLists[i].style.visibility = ""; } } }, appendChild : function(elem){ this.innerLayer.appendChild(elem); }};ui.inlineEditBox = { sender : false, edit : function(sender,callback) { var self = this; this.sender = sender; if (sender.getAttribute("editing")!=null) return; var cacheText = sender.innerHTML; sender.innerHTML = ""; var textBox = $ce("input"); textBox.value = cacheText; textBox.onblur = (function(){ sender.innerHTML = textBox.value; if (textBox.value != cacheText) callback(sender); this.endEdit(); }).bind(this); textBox.onkeypress = function(event) { event = fixEvent(event); if (event.keyCode == 13) { this.blur(); self.endEdit(); } else if (event.keyCode == 27) { try { self.sender.innerHTML = cacheText; self.endEdit(); } catch(ex) { alert(ex.description); } } }; sender.appendChild(textBox); textBox.focus(); sender.setAttribute("editing", true); }, endEdit: function(){ this.sender.removeAttribute("editing"); }};ui.Draggable = function (o, h, m) { var x = 0, y = 0; var i=0; var draging = function (e) { e = fixEvent(e); o.style.left = (Event.pointerX(e) - x) + "px"; o.style.top = (Event.pointerY(e) - y) + "px"; }; var endDrag = function() { Event.stopObserving(document.body, 'mousemove', draging); Event.stopObserving(document.body, 'mouseup', endDrag); if(m)m.style.display = 'none'; Element.setSelectable(document.body, true); }; var starDrag = function(e) { e.returnValue = false; e = fixEvent(e); x = Event.pointerX(e) - o.offsetLeft; y = Event.pointerY(e) - o.offsetTop; Event.observe(document.body, 'mousemove', draging); Event.observe(document.body, 'mouseup', endDrag); Element.setSelectable(document.body, false); if(m)m.style.display = ''; }; Event.observe(h, 'mousedown', starDrag); h.style.cursor = 'move';};var hiddenobj = new Array();var pmwinposition = new Array();function pmwin(action, param) { var objs = document.getElementsByTagName("OBJECT"); if(action == 'open') { for(i = 0;i < objs.length; i ++) { if(objs[i].style.visibility != 'hidden') { objs[i].setAttribute("oldvisibility", objs[i].style.visibility); objs[i].style.visibility = 'hidden'; } } var clientWidth = document.body.clientWidth; var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight; var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop; var pmwidth = 800; var pmheight = clientHeight * 0.9; if(!$('pmlayer')) { div = $ce('div');div.id = 'pmlayer'; div.style.width = pmwidth + 'px'; div.style.height = pmheight + 'px'; div.style.left = ((clientWidth - pmwidth) / 2) + 'px'; div.style.position = 'absolute'; div.style.zIndex = '999'; document.body.appendChild(div); var code = ""; if (navigator.isIE()) { code = '<iframe href="return false" style="width:' + pmwidth + 'px;height:'+pmheight+'px; position: absolute; left:0px;top:0px; z-Index=-1;filter:alpha(opacity=0);" frameborder="0"></iframe>'; } $('pmlayer').style.visibility = 'hidden'; $('pmlayer').innerHTML = '<div style="width: 800px; background: #666666; margin: 5px auto; text-align: left">' + '<div style="width: 800px; height: ' + pmheight + 'px; padding: 1px; background: #FFFFFF; border: 1px solid #7597B8; position: relative; left: -6px; top: -3px;">' + '<div id="_pm_header_" style="cursor: move; position: relative; left: 0px; top: 0px; width: 800px; height: 30px; margin-bottom: -30px;"></div>' + '<a href="javascript:;" onclick="pmwin(\'close\')"><img style="position: absolute; right: 20px; top: 15px" src="data/images/close.gif" alt="' + lang.close + '" title="' + lang.close + '" /></a>' + '<div id="pmwinmask" style="margin-top: 30px; position: absolute; width: 100%; height: '+pmheight+'px; display: none"></div><iframe scrolling="yes" id="pmframe" name="pmframe" style="width:' + pmwidth + 'px;height:100%; overflow-x:hidden" allowTransparency="true" frameborder="0"></iframe>'+code+'</div></div>'; new ui.Draggable(div, $('_pm_header_'), $('pmwinmask')); $('pmlayer').style.height = $('pmframe').clientHeight; $('pmlayer').style.visibility = 'visible'; } $('pmlayer').style.display = ''; $('pmlayer').style.top = ((clientHeight - pmheight) / 2 + scrollTop) + 'px'; if(!param) { pmframe.location = 'index.php?app=pm'; } else { pmframe.location = 'index.php?app=pm' + param; } } else if(action == 'close') { for(i = 0;i < objs.length; i ++) { if(objs[i].attributes['oldvisibility']) { objs[i].style.visibility = objs[i].attributes['oldvisibility'].nodeValue; objs[i].removeAttribute('oldvisibility'); } } hiddenobj = new Array(); $('pmlayer').style.display = 'none'; }}Event.observe(window, 'load', function() { elms = $class("avatar"); for (var i=0; i<elms.length; i++) { elms[i].onmouseover = function() {var mnu = $class("avatar-menu", this);var lnk = $class("avatar-link", this);mnu[0].style.display="block";lnk[0].className = "avatar-hover"; }; elms[i].onmouseout = function() {var mnu = $class("avatar-menu", this);var lnk = $class("avatar-hover", this);mnu[0].style.display="none"; lnk[0].className = "avatar-link"; }; } check_pm(); if ($('pm_button')) { $('pm_button').onclick = function () { pmwin('open'); }; } if ($('addcart')) { $('addcart').onmouseover = showCartStatus; } cart_status_tip = new Dialog(DIALOG_TIP); cart_status_tip.setSize(250); cart_status_tip.isSingle = true; cart_status_tip.isDraggable = false; cart_status_tip.autoCloseTime = 3; cart_status_tip.fadeTime = 0.3;});function showCartStatus() { if (cart_status_tip) { if(!cart_status_tip.isClosed()){ return; } var cont = lang.cart_status.replace('[cart_goods_count]', $('cart_goods_count').innerHTML); cont = cont.replace('[cart_goods_amount]', priceFormat($('hidden_cart_goods_amount').value)); cart_status_tip.setContent('', cont); cart_status_tip.pointTo($('addcart')); cart_status_tip.show(); }}function check_pm() { if ($class("check_new_pm", "A").length > 0) { Ajax.call("index.php?app=member&act=check_new_pm", function(res){ if (res.done) { var elem = $class("check_new_pm", "A")[0]; if (!lang.pm) lang.pm = elem.innerHTML; if (res.retval == "new_pm") { elem.innerHTML = lang.new_pm; elem.style.color = "red"; } else { elem.innerHTML = lang.pm; elem.style.color = ""; } elem.onclick = function() { pmwin('open'); if (elem.innerHTML == lang.new_pm){ elem.innerHTML = lang.pm; elem.style.color = ""; } } } }); }}function add_friend(userId, noAlert){ Ajax.addVal('ret_url', encodeURIComponent(location.href)); Ajax.addVal("friend_id", userId); Ajax.call("index.php?app=member&act=add_friend", function(res){ if (res.msg == "NO_LOGIN") { document.location.href = res.retval; } else { if (!noAlert) { var d = new Dialog(DIALOG_MESSAGE); d.setContent(lang.system_notice, res.msg); d.show(); } } }, "GET", false);}function addTag(goods_id){ var tag_words = $('tag_words').value; if (tag_words.length == 0){ alert(lang.tag_empty); return false; } Ajax.addVal('tag_words', tag_words); Ajax.call('index.php?app=goods&act=add_tag&id=' + goods_id, addTagResponse); return false;}function addTagResponse(result){ if (!result.done){ if (result.msg == 'NO_LOGIN') { if (confirm(lang.no_login)) { location.href = "index.php?app=member&act=login&ret_url=" + encodeURIComponent(location.href); } return; } } else { $("tag_content").innerHTML = result.retval; $('tag_words').value = ""; } if (result.msg.length > 0){ alert(result.msg); }}function loadNextImage(){ if (curImage + 1 > imageUrl.length){ curImage = 1; }else{ curImage ++; } gotoImage();}function loadPreImage(){ if (curImage - 1 < 1){ curImage = imageUrl.length; } else { curImage --; } gotoImage();}function gotoImage(){ var elem = $class("curPage"); for (var i=0; i<elem.length; i++ ){ elem[i].innerHTML = curImage; } var newImage = imageUrl[curImage -1].replace(/&amp;/g, '&'); $("previewImage").src = newImage;}

var magnifier = function(sender, width, height){  
  this.img = sender;  
  this.width =  (width != undefined) ? width : this.img.width;  
  this.height = (height != undefined) ? height : this.img.height;  
  
  this.img.parentNode.style.width = this.img.width;  
  this.img.parentNode.style.height = this.img.height;  
  this.img.parentNode.style.position = "relative";  
  
  this.outer = this.img.parentNode;  
  this.org = new Image();  
  this.org.src = sender.getAttribute("org");  
  
  //alert(this.org.src);
  
  var self = this;  
  this.org.onload = function() {    
    this.style.margin = "";    
	   if ((this.height-this.width)>0){
        this.style.marginLeft = this.style.marginRight = ((this.height-this.width)/2) + "px";    
	   }      
	   if ((this.height-this.width)<0){        
		    this.style.marginTop = this.style.marginBottom = (Math.abs(this.height-this.width)/2) + "px";    
	   }  
  };
  
    
  this.delegate = new Object();  
  this.delegate.select = this.select.bind(this);  
  this.delegate.start = this.start.bind(this);  
  
  Event.observe(this.img, "mousemove", this.delegate.start); 
   
  this.box = $ce("DIV");  
  this.box.className = "showBox"; 
  this.box.style.width =  this.width + "px";  
  this.box.style.height = this.height + "px";  
  this.box.style.overflow = "hidden";  
  this.box.style.position = "absolute";  
  this.box.style.left = this.box.style.top = "0px";  
  this.box.style.border = "1px solid #0C0";  
  this.box.style.background = "#fff";  
  this.box.appendChild(this.org);  
  
  Element.hide(this.box);  
  document.body.appendChild(this.box);
};


magnifier.prototype = {  
  setImage : function(url) {    
  var self = this;    var img = $ce("IMG");    
  img.src = url;    img.onload = function() 
    {        this.style.margin = "";        
             if ((this.height-this.width)>0)
             {            this.style.marginLeft = this.style.marginRight = ((this.height-this.width)/2) + "px";        }        
             if ((this.height-this.width)<0){            this.style.marginTop = this.style.marginBottom = (Math.abs(this.height-this.width)/2) + "px";        }
      };    
      
      Element.remove(this.org);    
      self.box.appendChild(img);    
      this.org = img;  },  
      
      start: function() {    
      Event.observe(document, "mousemove", this.delegate.select);    
      Event.stopObserving(this.img, "mousemove", this.delegate.start);  },  
      
      select : function(event) {    
      if (!this.selArea) {      
            this.selArea = $ce("div");      
            this.selArea.className = "selArea";      
            this.selArea.style.width = "40px";      
            this.selArea.style.height = parseInt(this.height / this.width * 40) + "px";      
            this.selArea.style.position = "absolute";      
            this.selArea.style.background = "#666";      
            this.selArea.style.border = "1px solid #0F0";      
            this.selArea.style.cursor = "move";      
            ui.effect._setOpacity(this.selArea, 50);      
            this.img.parentNode.appendChild(this.selArea);    
        }    
        
        var X = Event.pointerX(event);    
        var Y = Event.pointerY(event);    
        var pos = Element.getPosition(this.img);    
        pos.right = pos.left + this.img.offsetWidth;    
        pos.bottom = pos.top + this.img.offsetHeight;    
        
        var paddingLeft = parseInt(Element.getStyle(this.outer.parentNode, "paddingLeft"));    
        var paddingTop  = parseInt(Element.getStyle(this.outer.parentNode, "paddingTop"));    
        var right = Element.getPosition(this.outer).left + this.outer.offsetWidth;    
        
        this.box.style.left = (right + paddingLeft + 1) + "px";    
        this.box.style.top  = (Element.getPosition(this.outer).top - paddingTop - 1) + "px";    
        
        if (X < pos.left || Y < pos.top || X > pos.right || Y > pos.bottom){
              Element.hide(this.selArea);      Element.hide(this.box);      
              Event.stopObserving(document, "mousemove", this.delegate.select);      
              Event.observe(this.img, "mousemove", this.delegate.start);      
              return;    
        } else {      
              Element.show(this.selArea);      
              Element.show(this.box);    
        }    
        
        var scaleOrg = this.org.offsetWidth / this.org.offsetHeight;    
        var scaleBox = this.box.offsetWidth / this.box.offsetHeight;    
        var scaleImg = this.img.parentNode.offsetWidth / this.img.parentNode.offsetHeight;    
        var l = X - pos.left - 1 - (this.selArea.offsetWidth / 2);    
        var t = Y - pos.top - 1 - (this.selArea.offsetHeight / 2);    
        
        if (l <= 0) l = 0;    if (t <= 0) t = 0;    
          if ((l + this.selArea.offsetWidth) > this.img.offsetWidth) l = this.img.offsetWidth-this.selArea.offsetWidth;    
          if ((t + this.selArea.offsetHeight) > this.img.offsetHeight) t = this.img.offsetHeight-this.selArea.offsetHeight;    
          this.selArea.style.left = l + "px";    
          this.selArea.style.top = t + "px";    
          
          var thumbCenter = {"X":(pos.left + (this.img.offsetWidth / 2)), "Y":(pos.top + this.img.offsetHeight / 2) };    
          var mouseOffset = {"X": X-thumbCenter.X, "Y": Y-thumbCenter.Y};    
          var orgOffset = {"X" : mouseOffset.X/this.img.offsetWidth*this.box.scrollWidth, "Y": mouseOffset.Y/this.img.offsetHeight*this.box.scrollHeight};    
          var orgCenter = { "X": this.box.scrollWidth/2, "Y": this.box.scrollHeight/2};    
          var orgMoved = {"X" : orgCenter.X + orgOffset.X, "Y": orgCenter.Y + orgOffset.Y};    
          this.box.scrollLeft = orgMoved.X - this.box.offsetWidth / 2;    this.box.scrollTop = orgMoved.Y - this.box.offsetHeight / 2;  
}};

var lang ={"add_address":"新增收货地址","add_button_name":"添加到购物车","ask_dialog_title":" 您希望？","cancel":"取消","cancel_order_confirm":"取消后订单就无法恢复，若您还想购买只能通过再次下单，并且我们将不会为您预留商品，您确定要取消该订单吗？","cancel_order_dialog_title":"您确定要取消该订单吗？", "cancel_use_coupon":"取消使用该优惠券","cart_status":"<p>您的购物车中有 [cart_goods_count] 件商品<\/p><p>总金额：<span class=\"cart_price\">[cart_goods_amount]<\/span><\/p>","checkout_button_name": "到收银台结算","close":"关闭","common_button":"中评","confirm":"确认", "coupon_has_value":"该优惠券有效，将抵扣您商品总价中如下所示相应的金额","currency":"RM", "dateFormat":"$year年$month月","delivered":"确认收货", "delivered_dialog_content":"若您已收到货，请您对此交易进行评价，若您还没有收到货，请您点击对话框右上角的关闭按钮", "delivered_dialog_title":"收货及评价","dialog_password_field":"密码","dialog_username_field":"用户名","drop_address_confirm":"您确定要删除该收货地址吗？", "edit_address":"修改收货地址","edit_avatar":"编辑我的头像","email_invalid":"邮件地址格式不正确","empty_username_password":"用户名或密码为空","error":"出错啦！", "error_goods_number":"您输入的商品数量不正确，请您重新输入。","good_button":"好评", "goods_number":"数量：","input_pass_first":"请先输入密码","input_title":"请输入您要购买的数量","invalid_coupon_sn":"请输入优惠券号码","invalid_goods_num":"抱歉，商品数量应该是一个不为0的正整数","is_add_friend":"加卖家为好友","login_dialog_title":"登录对话框", "mobile_phone_format_invalid":"手机号码格式错误","new_pm":"您有新短消息","no_login":"只有登录用户才能使用该功能。您是否立即登录？","no_tip":"不要再提示我！","offline":"离线","online":"在线", "order_status_rejected":"已取消","phone_format_invalid":"电话号码格式错误", "phone_number_required":"请您至少填写手机、家庭电话或办公电话中的一项","poor_button":"差评", "repeat_pass_empty":"重复密码不能为空","repeat_pass_invalid":"重复密码与密码不一致", "select_action_first":"请先选择您要进行的操作，要继续将商品加入购物车，请点击“继续购物”", "shopping_button_name":"继续购物","sign_in_button":"登录","sys_msg":"系统提示", "system_notice":"系统提示","tag_empty":"请输入你要添加的标签","tip":"小提示", "undifine_price_range":"未指定价格区间","use_coupon_dialog_content":"优惠券号码", "use_coupon_dialog_ok":"使用","use_coupon_dialog_old_coupon_sn":"您上次使用的优惠券是：[coupon_sn]<br \/>若您不想使用上次的优惠券，请点击“取消”","use_coupon_dialog_tip":"注意：优惠券只可抵扣商品的价格，使用了优惠券后，请不要再删减购物车的内容（包括更新商品数量，从购物车内删除商品，但不包括新加商品到购物车），因为这样会导致您输入的优惠券信息丢失。", "use_coupon_dialog_title":"使用优惠券","username_short":"用户名少于３个字符", "validator":{"formSubmit":"您提交的表单中有无效的内容,请检查高亮部分内容","gtNote":"大于", "invaild":"不是一个有效的值","is_not_date":"不是一个有效的日期格式","is_not_email":"不是有效的 Email格式","is_not_float":"不是一个有效的浮点数","is_not_id_card":"不是一个有效的身份号码", "is_not_int":"你输入的值不是一个整数","is_not_mobile":"格式错误","is_not_post_code":"不是一个有效的邮编","is_not_tel_num":"不是一个有效的电话号码","is_not_url":"不是一个有效URL地址", "ltNote":"小于","required":"该选项必填","requiredNote":"必填","theValue":"输入值应", "hack":{"note":"hack for smarty"}},"week":["日","一","二","三","四","五","六"],"where_to_go":"添加到购物车成功，现在您可以到收银台去结算，也可以继续购物，您想？","yuan":"元"};

