// JavaScript Document //交换图象存储 function MM_swapImgRestore() { //v3.0 var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc; } //预载入图象 function MM_preloadImages() { //v3.0 var d = document; if (d.images) { if (!d.MM_p) d.MM_p = new Array(); var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++) if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; } } } //查找对象 function MM_findObj(n, d) { //v4.01 var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) { d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p); } if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n]; for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document); if (!x && d.getElementById) x = d.getElementById(n); return x; } //交换图象 function MM_swapImage() { //v3.0 var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2) ; i += 3) if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; } } //隐藏显示层 function MM_showHideLayers() { //v9.0 var i, p, v, obj, args = MM_showHideLayers.arguments; for (i = 0; i < (args.length - 2) ; i += 3) with (document) if (getElementById && ((obj = getElementById(args[i])) != null)) { v = args[i + 2]; if (obj.style) { obj = obj.style; v = (v == 'show') ? 'visible' : (v == 'hide') ? 'hidden' : v; } obj.visibility = v; } } //隐藏显示层,加强版 function MM_showHideLayers_pro() { //v9.0 var i, p, v, obj, args = MM_showHideLayers_pro.arguments; for (i = 0; i < (args.length - 2) ; i += 3) with (document) if (getElementById && ((obj = getElementById(args[i])) != null)) { v = args[i + 2]; if (obj.style) { obj = obj.style; v = (v == 'show') ? 'block' : (v == 'hide') ? 'none' : v; } obj.display = v; } } //重新获取验证码 function ReGetVerifyCode(myIMG) { MM_findObj(myIMG).src = "/VerifyCodeImg.aspx?ID=" + MM_GetTime(); } //更换控件的css样式 function ChangeClassName(obj, classname) { obj.className = classname; } //ASCII字符长度 String.prototype.len = function () { return this.replace(/[^x00-xff]/g, "**").length; } //去掉字符串头部和尾部的空格 String.prototype.trim = function () { // 用正则表达式将前后空格 // 用空字符串替代。 return this.replace(/(^\s*)|(\s*$)/g, ""); } //截取字符串前面几个字符(按英文字节算、带省略号) String.prototype.sub = function (n) { var r = /[^\x00-\xff]/g; if (this.replace(r, "mm").length <= n) return this; // n = n - 3; var m = Math.floor(n / 2); for (var i = m; i < this.length; i++) { if (this.substr(0, i).replace(r, "mm").length >= n) { return this.substr(0, i) + "..."; } } return this; }; //获取时间 function MM_GetTime() { var d = new Date(); return d.getTime(); } //判断浏览器 var userAgent = navigator.userAgent, isIE = false; if (userAgent.indexOf('MSIE') != -1) { isIE = true; } if (!isIE) { //firefox innerText define HTMLElement.prototype.__defineGetter__("innerText", function () { var anyString = ""; var childS = this.childNodes; for (var i = 0; i < childS.length; i++) { if (childS[i].nodeType == 1) anyString += childS[i].tagName == "BR" ? '\n' : childS[i].innerText; else if (childS[i].nodeType == 3) anyString += childS[i].nodeValue; } return anyString; } ); HTMLElement.prototype.__defineSetter__("innerText", function (sText) { this.textContent = sText; } ); } //跳转地址 function GotoPage(url, objName) { obj = MM_findObj(objName); url = url.replace("page=", "page=" + obj.value) window.location.href = url; } //设置控件的HTML function SetControlHTML(obj, str) { MM_findObj(obj).innerHTML = str; } //获取xmlhttp对象 function GetXmlHttpRequest() { var oBao; if (window.XMLHttpRequest) { oBao = new XMLHttpRequest(); } else if (window.ActiveXObject) { oBao = new ActiveXObject("Microsoft.XMLHT ارسال استعلام - KEYTON MOTOR
Thank you
We have received your enquiry and will contact you soon.