function getcookieurl(cookiename) {
var val = "";
var index1 = cookiename.indexof("picurl");
if (index1 < 0)
return "";
val = cookiename.substring(index1 + 7);
return val;
}
function setbodybg() {
var cookuserid = getcookiesubval(getcookie("hmsdwebclerk"), "userid");
var cookieurl = getcookie("bgpic" + cookuserid);
if (cookieurl) {
var href = "";
var url = getbodybgurl(cookieurl);
var path1 = getrootpath();
href = path1 + url;
//alert(href);
$("body").css("background", "url(" + href + ")");
//document.all.backgroundpic.style.background = url + ' repeat';
}
}
function getbodybgurl(cookieurl) {
var url = getcookieurl(cookieurl);
//alert(url);
var index1 = url.indexof("(");
var index2 = url.indexof(")");
var val = url.substring(index1 + 1, index2);
//alert(val);
return val;
}
function getcookie(name) {
var arr, reg = new regexp("(^| )" + name + "=([^;]*)(;|$)");
if (arr = document.cookie.match(reg)) {
return decodeuricomponent(arr[2]);
}
else {
return null;
}
}
function getcookiesubval(cookiename, name) {
//alert(cookiename);
cookiename = cookiename + "&";
var index1 = cookiename.indexof(name);
if (index1 < 0)
return "";
var index2 = cookiename.substring(index1).indexof("&");
var val = cookiename.substring(index1 + name.length + 1, index1 + index2);
//return index1 + "=" + index2;
return val;
}
function setcookie(name, value, hour) {
var exp = new date();
exp.settime(exp.gettime() + hour * 60 * 60 * 1000);
document.cookie = name + "=" + escape(value) + ";expires=" + exp.togmtstring();
}
function deletecookies(name) {
var exp = new date();
exp.settime(exp.gettime() - 1);
var cval = getcookie(name);
if (cval != null)
document.cookie = name + "=" + cval + ";expires=" + exp.togmtstring();
}
function removermenu(e) {
e.preventdefault();
e.stopevent();
}
function tipsshow(objname, text, x, y, w) {
var obj = $("#" + objname);
var top = obj.offset().top;
var left = obj.offset().left;
var width = obj.width();
if ($("#tip" + objname).length <= 0) {
//$("
").appendto($(document.body));
var obsstr = "";
obsstr += "";
obsstr += "";
obsstr += "";
obsstr += "
";
$(obsstr).appendto($(document.body));
}
$("#tip" + objname).css("display", "block");
$("#tip" + objname).css("top", top + y).css("left", left + x + width).attr("tx", x).attr("ty", y);
if (w) {
$("#tip" + objname + ".blltip").css("width", w + 38);
$("#tip" + objname + " .tiptop").css("width", w + 30);
$("#tip" + objname + " .tipcenter").css("width", w);
$("#tip" + objname + " .tipbottom").css("width", w + 30);
}
$("#tip" + objname + " .tipcenter").html(text);
$("#tip" + objname + " .tiprcenter").css("height", $("#tip" + objname + " .tipcenter").height());
}
function tipshide(objname) {
if ($("#tip" + objname).length > 0) {
$("#tip" + objname).css("display", "none");
}
}
function bllcheckinput(chkobjs) {
var isvailid = true;
$.each(chkobjs, function (i, k) {
var obj = chkobjs.eq(i);
var chestr = obj.attr("bllcheck");
if (chestr.indexof("pid") == 0) {
if ($.trim(obj.attr("pid")) == "") { isvailid = false; obj.blur(); } return true;
}
if (chestr.indexof("dec") == 0) {
if (!isdecimal(obj.val())) { isvailid = false; obj.blur(); } return true;
}
if (chestr.indexof("int") == 0) {
if (!isdigit(obj.val())) { isvailid = false; obj.blur(); } return true;
}
if (chestr.indexof("str") == 0) {
var ches = chestr.split(",");
if ($.trim(ches[5]) != "") tip = ches[5];
if ($.trim(obj.val()) == "" && parseint(ches[4]) >= 0) {
isvailid = false; obj.blur(); return true;
}
else if (parseint(ches[3]) > 0 || parseint(ches[4]) > 0) {
if (getbytelen($.trim(obj.val())) > parseint(ches[3])) {
isvailid = false; obj.blur(); return true;
}
else if (getbytelen($.trim(obj.val())) < parseint(ches[4])) {
isvailid = false; obj.blur(); return true;
}
}
}
if (chestr.indexof("brief") == 0 && um) {
var ches = chestr.split(",");
var briefval = um.geteditor(ches[6]).getcontent();
if ($.trim(ches[5]) != "") tip = ches[5];
if ($.trim(briefval) == "" && parseint(ches[4]) >= 0) {
isvailid = false; um.geteditor(ches[6]).blur(); return true;
}
else if (parseint(ches[3]) > 0 || parseint(ches[4]) > 0) {
if (getbytelen($.trim(briefval)) > parseint(ches[3])) {
isvailid = false; um.geteditor(ches[6]).blur(); return true;
}
else if (getbytelen($.trim(briefval)) < parseint(ches[4])) {
isvailid = false; um.geteditor(ches[6]).blur(); return true;
}
}
}
});
return isvailid;
}
function bllcheckinputandshow(chkobjs) {
$.each(chkobjs, function (i, k) {
var tip = "请输入该项内容";
var obj = chkobjs.eq(i);
var chestr = obj.attr("bllcheck");
if (chestr.indexof("pid") == 0) {
obj.bind("blur", function () {
if ($.trim(obj.attr("pid")) == "") {
var ches = chestr.split(",");
if ($.trim(ches[5]) != "") tip = ches[5];
if (obj.attr("tipwidth")) {
tipsshow(obj.attr("id"), tip, parseint(ches[1]), parseint(ches[2]), parseint(obj.attr("tipwidth")));
}
else {
tipsshow(obj.attr("id"), tip, parseint(ches[1]), parseint(ches[2]));
}
}
else {
tipshide(obj.attr("id"));
}
});
}
if (chestr.indexof("dec") == 0) {
obj.bind("blur", function () {
if (!isdecimal(obj.val())) {
var ches = chestr.split(",");
tip = "该项只能输入数值";
if ($.trim(ches[5]) != "") tip = ches[5];
if (obj.attr("tipwidth")) {
tipsshow(obj.attr("id"), tip, parseint(ches[1]), parseint(ches[2]), parseint(obj.attr("tipwidth")));
}
else {
tipsshow(obj.attr("id"), tip, parseint(ches[1]), parseint(ches[2]));
}
}
else {
tipshide(obj.attr("id"));
}
});
}
if (chestr.indexof("int") == 0) {
obj.bind("blur", function () {
if (!isdigit(obj.val())) {
var ches = chestr.split(",");
tip = "该项只能输入整数";
if ($.trim(ches[5]) != "") tip = ches[5];
if (obj.attr("tipwidth")) {
tipsshow(obj.attr("id"), tip, parseint(ches[1]), parseint(ches[2]), parseint(obj.attr("tipwidth")));
}
else {
tipsshow(obj.attr("id"), tip, parseint(ches[1]), parseint(ches[2]));
}
}
else {
tipshide(obj.attr("id"));
}
});
}
if (chestr.indexof("str") == 0) {
obj.bind("blur", function () {
var ches = chestr.split(",");
if ($.trim(ches[5]) != "") tip = ches[5];
if ($.trim(obj.val()) == "" && parseint(ches[4]) >= 0) {
if (obj.attr("tipwidth")) {
tipsshow(obj.attr("id"), tip, parseint(ches[1]), parseint(ches[2]), parseint(obj.attr("tipwidth")));
}
else {
tipsshow(obj.attr("id"), tip, parseint(ches[1]), parseint(ches[2]));
}
}
else if (parseint(ches[3]) > 0 || parseint(ches[4]) > 0) {
if (getbytelen($.trim(obj.val())) > parseint(ches[3])) {
tip = "该项输入超过了最大长度限制,请您将长度限制在" + parseint(parseint(ches[3]) / 2) + "个汉字或" + ches[3] + "个字符以内";
if (obj.attr("tipwidth")) {
tipsshow(obj.attr("id"), tip, parseint(ches[1]), parseint(ches[2]), parseint(obj.attr("tipwidth")));
}
else {
tipsshow(obj.attr("id"), tip, parseint(ches[1]), parseint(ches[2]));
}
}
else if (getbytelen($.trim(obj.val())) < parseint(ches[4])) {
tip = "该项输入不能少于" + parseint(parseint(ches[4]) / 2) + "个汉字或" + ches[4] + "个字符的长度";
if (obj.attr("tipwidth")) {
tipsshow(obj.attr("id"), tip, parseint(ches[1]), parseint(ches[2]), parseint(obj.attr("tipwidth")));
}
else {
tipsshow(obj.attr("id"), tip, parseint(ches[1]), parseint(ches[2]));
}
}
else {
tipshide(obj.attr("id"));
}
}
else {
tipshide(obj.attr("id"));
}
});
}
if (chestr.indexof("brief") == 0 && um) {
var ches = chestr.split(",");
um.geteditor(ches[6]).addlistener("blur", function () {
var briefval = um.geteditor(ches[6]).getcontent();
if ($.trim(ches[5]) != "") tip = ches[5];
if ($.trim(briefval) == "" && parseint(ches[4]) >= 0) {
if (obj.attr("tipwidth")) {
tipsshow(ches[7], tip, parseint(ches[1]), parseint(ches[2]), parseint(obj.attr("tipwidth")));
}
else {
tipsshow(ches[7], tip, parseint(ches[1]), parseint(ches[2]));
}
}
else if (parseint(ches[3]) > 0 || parseint(ches[4]) > 0) {
if (getbytelen($.trim(briefval)) > parseint(ches[3])) {
tip = "该项输入超过了长度超限制,请您将长度限制在" + parseint(parseint(ches[3]) / 2) + "个汉字或" + ches[3] + "个字符以内";
if (obj.attr("tipwidth")) {
tipsshow(ches[7], tip, parseint(ches[1]), parseint(ches[2]), parseint(obj.attr("tipwidth")));
}
else {
tipsshow(ches[7], tip, parseint(ches[1]), parseint(ches[2]));
}
}
else if (getbytelen($.trim(briefval)) < parseint(ches[4])) {
tip = "该项输入不能少于" + parseint(parseint(ches[4]) / 2) + "个汉字或" + ches[4] + "个字符的长度";
if (obj.attr("tipwidth")) {
tipsshow(ches[7], tip, parseint(ches[1]), parseint(ches[2]), parseint(obj.attr("tipwidth")));
}
else {
tipsshow(ches[7], tip, parseint(ches[1]), parseint(ches[2]));
}
}
else {
tipshide(ches[7]);
}
}
else {
tipshide(ches[7]);
}
});
}
});
}
function resettipposition() {
$(".blltip").each(function (i) {
var objname = $(this).attr("id").replace("tip", "");
var obj = $("#" + objname);
var top = obj.offset().top;
var left = obj.offset().left;
var width = obj.width();
var x = parseint($(this).attr("tx"));
var y = parseint($(this).attr("ty"));
if ($(this).css("top") != top + y || $(this).css("left") != left + width + x) {
$(this).css("top", top + y).css("left", left + x + width);
}
});
}
function rgbtohex(rgb) {
if (rgb.substr(0, 1) == "#") {
return rgb;
}
if (rgb == "black")
return "#000000";
if (rgb == "white")
return "#ffffff";
if (rgb == "blue")
return "#0000ff";
if (rgb == "red")
return "#ff0000";
if (rgb == "green")
return "#008000";
var regexp = /[0-9]{0,3}/g;
var re = rgb.match(regexp); //利用正则表达式去掉多余的部分,将rgb中的数字提取
var hexcolor = "#"; var hex = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
for (var i = 0; i < re.length; i++) {
var r = null, c = re[i], l = c;
var hexar = [];
while (c > 16) {
r = c % 16;
c = (c / 16) >> 0;
hexar.push(hex[r]);
} hexar.push(hex[c]);
if (l < 16 && l != "") {
hexar.push(0)
}
hexcolor += hexar.reverse().join('');
}
if (hexcolor == "#")
hexcolor = "#cccccc";
return hexcolor;
}
function islastver(ver) {
if (ver != "1.0.02") {
return false;
}
return true;
}
function getjianbiancss(color, color1, color2) {
var moz = "";
if (ext.isie || $.browser.version == "11.0") {
moz = "background-color:" + color + ";filter: progid:dximagetransform.microsoft.gradient(startcolorstr='" + color1 + "',endcolorstr='" + color2 + "',gradienttype='0');";
if ($.browser.version == "10.0" || $.browser.version == "11.0" || $.browser.version == "12.0") {
moz = "background: -ms-linear-gradient(top, " + color1 + ", " + color2 + ") !important;";
}
}
else if (ext.isgecko) {
moz = "background:-moz-linear-gradient(center top , " + color1 + ", " + color2 + ");";
}
else {
moz = "background-color:" + color + ";background: -webkit-gradient(linear, 100% 0%, 100% 100%, from(" + color1 + "), to(" + color2 + "));";
}
return moz;
}
function getjianbianlinecss(color, color1, color2) {
var moz = "";
if (ext.isie || $.browser.version == "11.0") {
moz = "filter: progid:dximagetransform.microsoft.gradient(startcolorstr='" + color1 + "',endcolorstr='" + color2 + "',gradienttype='1');";
if ($.browser.version == "10.0" || $.browser.version == "11.0" || $.browser.version == "12.0") {
moz = "background: -ms-linear-gradient(left, " + color1 + ", " + color2 + ") !important;";
}
}
else if (ext.isgecko) {
moz = "background:-moz-linear-gradient(center left , " + color1 + ", " + color2 + ");";
}
else {
moz = "background-color:" + color + ";background: -webkit-gradient(linear, 0% 100%, 100% 100%, from(" + color1 + "), to(" + color2 + "));";
}
return moz;
}
function setcomboxdefaultval(obj, idname) {
var mystore = obj.getstore();
if (mystore.getcount() <= 0) {
return;
}
obj.setvalue(mystore.getat(0).data[idname]);
}
function closetab(tabpanelid) {
var tab = ext.getcmp(tabpanelid);
tab.close();
}
function close() {
var id = geturlpara("tabpanelid");
window.parent.closetab(id);
}
function bllencodeurl(str) {
return encodeuri(str).replace('+', '%2b');
}
function getparenturl(param) {
var params = ext.urldecode(window.parent.location.search.substring(1));
return param ? params[param] : params;
}
function padleft(str, pad, count) {
while (str.length < count)
str = pad + str;
return str;
}
function chinesenumber(num) {
if (isnan(num) || num > math.pow(10, 12)) return ""
var cn = "零壹贰叁肆伍陆柒捌玖"
var unit = new array("拾百千", "分角")
var unit1 = new array("万亿", "")
var numarray = num.tostring().split(".")
var start = new array(numarray[0].length - 1, 2)
function tochinese(num, index) {
var num = num.replace(/\d/g, function ($1) {
return cn.charat($1) + unit[index].charat(start-- % 4 ? start % 4 : -1)
})
return num
}
for (var i = 0; i < numarray.length; i++) {
var tmp = ""
for (var j = 0; j * 4 < numarray[i].length; j++) {
var strindex = numarray[i].length - (j + 1) * 4
var str = numarray[i].substring(strindex, strindex + 4)
var start = i ? 2 : str.length - 1
var tmp1 = tochinese(str, i)
tmp1 = tmp1.replace(/(零.)+/g, "零").replace(/零+$/, "")
tmp1 = tmp1.replace(/^壹拾/, "拾")
tmp = (tmp1 + unit1[i].charat(j - 1)) + tmp
}
numarray[i] = tmp
}
numarray[1] = numarray[1] ? numarray[1] : ""
numarray[0] = numarray[0] ? numarray[0] + "元" : numarray[0], numarray[1] = numarray[1].replace(/^零+/, "")
numarray[1] = numarray[1].match(/分/) ? numarray[1] : numarray[1] + "整"
return numarray[0] + numarray[1]
}
function geturlpara(name) {
var reg = new regexp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
///** jquery **/
//(function ($) {
// $.fn.geturlparam = function (name) {
// var reg = new regexp("(^|&)" + name + "=([^&]*)(&|$)", "i");
// var r = window.location.search.substr(1).match(reg);
// if (r != null) return unescape(r[2]); return null;
// }
//})(jquery);
//new function(settings) { var $separator = settings.separator || '&';var $spaces = settings.spaces === false ? false : true;var $suffix = settings.suffix === false ? '' : '[]';var $prefix = settings.prefix === false ? false : true;var $hash = $prefix ? settings.hash === true ? "#" : "?" : "";var $numbers = settings.numbers === false ? false : true;jquery.query = new function() {var is = function(o, t) {return o != undefined && o !== null && (!!t ? o.constructor == t : true);};var parse = function(path) {var m, rx = /\[([^[]*)\]/g, match = /^([^[]+)(\[.*\])?$/.exec(path), base = match[1], tokens = [];while (m = rx.exec(match[2])) tokens.push(m[1]);return [base, tokens];};var set = function(target, tokens, value) {var o, token = tokens.shift();if (typeof target != 'object') target = null;if (token === "") {if (!target) target = [];if (is(target, array)) {target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));} else if (is(target, object)) {var i = 0;while (target[i++] != null);target[--i] = tokens.length == 0 ? value : set(target[i], tokens.slice(0), value);} else {target = [];target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));}} else if (token && token.match(/^\s*[0-9]+\s*$/)) {var index = parseint(token, 10);if (!target) target = [];target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);} else if (token) {var index = token.replace(/^\s*|\s*$/g, "");if (!target) target = {};if (is(target, array)) {var temp = {};for (var i = 0; i < target.length; ++i) {temp[i] = target[i];}target = temp;}target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);} else {return value;}return target;};var queryobject = function(a) {var self = this;self.keys = {};if (a.queryobject) {jquery.each(a.get(), function(key, val) {self.set(key, val);});} else {jquery.each(arguments, function() {var q = "" + this;q = q.replace(/^[?#]/,'');q = q.replace(/[;&]$/,'');if ($spaces) q = q.replace(/[+]/g,' ');jquery.each(q.split(/[&;]/), function(){var key = decodeuricomponent(this.split('=')[0] || "");var val = decodeuricomponent(this.split('=')[1] || "");if (!key) return;if ($numbers) {if (/^[+-]?[0-9]+\.[0-9]*$/.test(val))val = parsefloat(val);else if (/^[+-]?[0-9]+$/.test(val))val = parseint(val, 10);}val = (!val && val !== 0) ? true : val;if (val !== false && val !== true && typeof val != 'number')val = val;self.set(key, val);});});}return self;};queryobject.prototype = {queryobject: true,has: function(key, type) {var value = this.get(key);return is(value, type);},get: function(key) {if (!is(key)) return this.keys;var parsed = parse(key), base = parsed[0], tokens = parsed[1];var target = this.keys[base];while (target != null && tokens.length != 0) {target = target[tokens.shift()];}return typeof target == 'number' ? target : target || "";},get: function(key) {var target = this.get(key);if (is(target, object))return jquery.extend(true, {}, target);else if (is(target, array))return target.slice(0);return target;},set: function(key, val) {var value = !is(val) ? null : val;var parsed = parse(key), base = parsed[0], tokens = parsed[1];var target = this.keys[base];this.keys[base] = set(target, tokens.slice(0), value);return this;},set: function(key, val) {return this.copy().set(key, val);},remove: function(key) {return this.set(key, null).compact();},remove: function(key) {return this.copy().remove(key);},empty: function() {var self = this;jquery.each(self.keys, function(key, value) {delete self.keys[key];});return self;},load: function(url) {var hash = url.replace(/^.*?[#](.+?)(?:\?.+)?$/, "$1");var search = url.replace(/^.*?[?](.+?)(?:#.+)?$/, "$1");return new queryobject(url.length == search.length ? '' : search, url.length == hash.length ? '' : hash);},empty: function() {return this.copy().empty();},copy: function() {return new queryobject(this);},compact: function() {function build(orig) {var obj = typeof orig == "object" ? is(orig, array) ? [] : {} : orig;if (typeof orig == 'object') {function add(o, key, value) {if (is(o, array))o.push(value);elseo[key] = value;}jquery.each(orig, function(key, value) {if (!is(value)) return true;add(obj, key, build(value));});}return obj;}this.keys = build(this.keys);return this;},compact: function() {return this.copy().compact();},tostring: function() {var i = 0, querystring = [], chunks = [], self = this;var encode = function(str) {str = str + "";if ($spaces) str = str.replace(/ /g, "+");return encodeuricomponent(str);};var addfields = function(arr, key, value) {if (!is(value) || value === false) return;var o = [encode(key)];if (value !== true) {o.push("=");o.push(encode(value));}arr.push(o.join(""));};var build = function(obj, base) {var newkey = function(key) {return !base || base == "" ? [key].join("") : [base, "[", key, "]"].join("");};jquery.each(obj, function(key, value) {if (typeof value == 'object') build(value, newkey(key));elseaddfields(chunks, newkey(key), value);});};build(this.keys);if (chunks.length > 0) querystring.push($hash);querystring.push(chunks.join($separator));return querystring.join("");}};return new queryobject(location.search, location.hash);};}(jquery.query || {});
/* java script */
function isdigit(s) {
var patrn = /^-?[0-9]{1,20}$/;
if (!patrn.exec(s))
return false;
return true;
}
function isdecimal(txt) {
if (isdigit(txt))
return true;
var regexp = /^[\d\%]{1,20}[.]{0,1}[\d\%]{1,10}$/;
return regexp.test(txt);
}
function isdate(paradatestr) {
var pat_hd = /\d{4}-(([1-9]{1})|(0[1-9]{1})|(1[0-2]{1}))-(([1-9]{1})|(0[1-9]{1})|([1-2]{1}[0-9]{1})|(3[0-1]{1}))$/;
try {
if (!pat_hd.test(paradatestr)) {return false; }
var arr_hd = paradatestr.split("-");
var datetmp;
datetmp = new date(arr_hd[0], parsefloat(arr_hd[1]) - 1, parsefloat(arr_hd[2]));
if (datetmp.getfullyear() != parsefloat(arr_hd[0]) || datetmp.getmonth() != parsefloat(arr_hd[1]) - 1 || datetmp.getdate() != parsefloat(arr_hd[2])) {
return false;
}
}
catch (ex) {
if (ex.description) {
return false;
}
else {
return false;
}
}
return true;
}
function isemail(s)
{
var regm = /^[a-za-z0-9_-]+@[a-za-z0-9_-]+(\.[a-za-z0-9_-]+)+$/;
if (!s.match(regm) && s!="")
return false;
return true;
}
function isurl(str_url) {
var strregex = "[a-za-z]+://[^\s]*";
var re = new regexp(strregex);
//re.test()
if (re.test(str_url)) {
return (true);
} else {
return (false);
}
}
function ismobilenum(s) {
var re = /^1\d{10}$/;
if (re.test(s)) {
return true;
} else {
return false;
}
}
function formatmoney(s, n) {
old_n = n;
n = n > 0 && n <= 6 ? n : 2;
s = parsefloat((s + "").replace(/[^\d\.-]/g, "")).tofixed(n) + "";
var l = s.split(".")[0].split("").reverse(),
r = s.split(".")[1];
t = "";
for (i = 0; i < l.length; i++) {
t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
}
if (old_n <= 0) {
return t.split("").reverse().join("");
}
else {
return t.split("").reverse().join("") + "." + r;
}
}
function getage(birth){
if(!isdate(birth))
return "";
var adate=new date();
var thisyear=adate.getfullyear();
birth=birth.substring(0,4);
age=(thisyear-birth);
return age;
}
function round(v, e) {
var t = 1;
for (; e > 0; t *= 10, e--);
for (; e < 0; t /= 10, e);
return math.round(v * t) / t;
}
function getbytesize(size) {
if (!isdigit(size))
return "";
var strsize = string(size) + " b";
if (size > 1024) {
strsize = round((size / 1024), 2).tostring() + " k";
}
if (size > 1024 * 1024) {
strsize = round((size / (1024 * 1024)), 2).tostring() + " m";
}
return strsize;
}
function getbytelen(val) {
var len = 0;
val = val.split("");
for (var i = 0; i < val.length; i++) {
if (val[i].match(/[^\x00-\xff]/ig) != null) //全角
len += 2;
else
len += 1;
}
return len;
}
function getrootpath(){
var strfullpath=window.document.location.href;
var strpath=window.document.location.pathname;
var pos=strfullpath.indexof(strpath);
var prepath=strfullpath.substring(0,pos);
var postpath=strpath.substring(0,strpath.substr(1).indexof('/')+1);
if (strfullpath.indexof("localhost")<0)
postpath = "";
//alert(prepath+postpath);
return prepath+postpath+"/";
}
function hasclass(element, classname) {
var reg = new regexp('(\\s|^)' + classname + '(\\s|$)');
return element.classname.match(reg);
}
function addclass(element, classname) {
if (!this.hasclass(element, classname)) {
element.classname += " " + classname;
}
}
function removeclass(element, classname) {
if (hasclass(element, classname)) {
var reg = new regexp('(\\s|^)' + classname + '(\\s|$)');
element.classname = element.classname.replace(reg, ' ');
}
}
function mouseover(jobj) {
jobj.attr("color", jobj.css("color"));
jobj.css("textdecoration", "underline").css("color", "red");
}
function mouseout(jobj) {
jobj.css("textdecoration", "none").css("color", jobj.attr("color"));
}
function bt1mouseover(jobj) {
jobj.css("background-position", "0px -26px");
}
function bt1mouseout(jobj) {
jobj.css("background-position", "0px 0px");
}
function bt2mouseover(jobj) {
jobj.css("background-position", "0px -30px");
}
function bt2mouseout(jobj) {
jobj.css("background-position", "0px 0px");
}
function col1itemmouseover(jobj) {
if (jobj.attr("isselect") == "1") return;
jobj.attr("class", "col1item select");
}
function col1itemmouseout(jobj) {
if (jobj.attr("isselect") == "1") return;
jobj.attr("class", "col1item");
}
function guardpages() {
//屏蔽右键菜单
document.oncontextmenu = function (event) {
if (window.event) {
event = window.event;
} try {
var the = event.srcelement;
if (!((the.tagname == "input" && the.type.tolowercase() == "text") || the.tagname == "textarea")) {
return false;
}
return true;
} catch (e) {
return false;
}
}
//屏蔽粘贴
document.onpaste = function (event) {
if (window.event) {
event = window.event;
} try {
var the = event.srcelement;
if (!((the.tagname == "input" && the.type.tolowercase() == "text") || the.tagname == "textarea")) {
return false;
}
return true;
} catch (e) {
return false;
}
}
//屏蔽复制
document.oncopy = function (event) {
if (window.event) {
event = window.event;
} try {
var the = event.srcelement;
if (!((the.tagname == "input" && the.type.tolowercase() == "text") || the.tagname == "textarea")) {
return false;
}
return true;
} catch (e) {
return false;
}
}
//屏蔽剪切
document.oncut = function (event) {
if (window.event) {
event = window.event;
} try {
var the = event.srcelement;
if (!((the.tagname == "input" && the.type.tolowercase() == "text") || the.tagname == "textarea")) {
return false;
}
return true;
} catch (e) {
return false;
}
}
//屏蔽选中
document.onselectstart = function (event) {
if (window.event) {
event = window.event;
} try {
var the = event.srcelement;
if (!((the.tagname == "input" && the.type.tolowercase() == "text") || the.tagname == "textarea")) {
return false;
}
return true;
} catch (e) {
return false;
}
}
}