/*
* 使用window.onload时,建议使用window.attachEvent("onload",function(){});方式,这样可执行多个onload
* 定义XMLHttpRequest组件:function getrequest()
* 带提示的AJAX: function getLayerInfo(seturl,setid,returnStr)
* 写入ID的AJAX: function getNoTipsInfor(seturl,setid)
* 写入FORM的AJAX: function getFormInfo(seturl,setid)
* 只执行URL的AJAX: function getVoid(seturl)
*
* keyUp检测数字:function onkeyupNum(ths)
* keyUp检测INPUT正确否:onkeyupComm(ths,stype): ths是input对象,stype是类型
整数:num
正数:numne
浮点数:dec
正浮点数:decne
英文字母:en
中文:cn
字母或数字或下划线:ennumx
Email格式:email
http格式:http
中国邮政编码格式:postcode
IP地址格式:ip
中国居民身份证格式:certnum
* 只允许录入数字:function checkFloat(formname,element)
* 检查FORM值是否等于EqualStr:function checkEqual(formname,element,EqualStr)
* 检查两个FORM值是否相等: function checkEqualForm(formname,element1,element2)
* 检查字数长度是否超过规定长度:function checkLen(formname,element,len)
* 取字符串(字节)长度:function getLen(sString)
* 全选或取消复选框:function CheckEdAll(checkName,clickName)
* 检查有多少个复选框已选上 : function checkAllCheck(checkName)
* //获取多选值 function getCheck(checkName)
*
* 检测str是否存在(成立),并将信息抛出;简单方法,只适用单个条件的查询
checkSimpleExist(tablename,fields,str,thsid,trueInfo,falseInfo)
其中:tablename为表名,fields为要查询的关键字字段名,str为关键字
trueInfo是存在时返回提示信息,falseInfo是不存在时返回提示信息
thsid是(input等)对象
技巧:DWR里面的where条件的这样写的:fields+"='"+Core.getNULLtoDF(str,"")+"'"
所以根据上面的条件可以想办法实现多条件判断:
比如:str可以写成 1' and aa='2等方式进行多个字段条件判断
例:<s:textfield name="styleen" onkeyup="checkSimpleExist('style_table','styleen',this.value,this,'* 类型代码已存在','');"></s:textfield>
*
* 按正值表达式检测Form,成立:true,不成立:false: function checkElementComm(formname,element,stype)
整数:num
正数:numne
浮点数:dec
正浮点数:decne
英文字母:en
中文:cn
字母或数字或下划线:ennumx
Email格式:email
http格式:http
中国邮政编码格式:postcode
IP地址格式:ip
中国居民身份证格式:certnum
* 按手动输入正值表达式检测Form: function checkComm(rule,formname,element)
* 按正值表达式检测Form(身份证号): function checkIDCard(formname,element)
*
* 控件的位置TOP:function getTop(tt)
* 控件的位置LEFT:function getLeft(tt)
*
* 调用时间日期控件:具体查看/jsFunction/calendar.js
<s:textfield onClick="setCalendar(this,'DHMS');" name="indexForm"/>
(1)setCalendar(this,"DHMS");(1)日期:D,(2)日期+时DH,(3)D日期+时+分:HM,(4)日期+时+分+秒:DHMS
(2)设置日期 时:钟:秒中的分隔符 setSplit(strDateSplit,strDateTimeSplit,strTimeSplit);
(3)设置开始和结束年份 setYearPeriod(intDateBeg,intDateEnd)
* 获取单选值: function getRadio(frm)
* 加入多选的下拉框: function addSltMulti(formname,frmLst,frmSlt)
* 加入单选的下拉框: function addSlt(formname,frmLst,frmSlt)
* 删除所有下拉框值: function delSlt(formname,frmSlt)
* 删除选择的多选: function delSlted(formname,frmSlt)
* 选中多选的上移: function upSlt(formname,frmSlt)
* 选中多选的下移: function downSlt(formname,frmSlt)
* 选中所有已选内容: function sltSlt(formname,frmSlt)
* 上传图片,并写入文本框中:function getUpPicForm(formname,inputname)
* 带编辑器的提交操作:editor.setsubmit("form","input");在判断或提交前执行
编辑器Frame名:editor
表单名:form
文本区名:input
** 带编辑器的重置操作:function EditorReset(editorname,formname,inputname)
* 鼠标悬停显示:function zoomInMouseMove(Str)//鼠标悬停显示
function zoomInMouseOut()//关闭
* 弹出层窗口:function openDiv(ths,X,thsurl,titleName)//弹出层窗口
function hidewin(ths,chk,X,titleName)//最小化:ths=hide 关闭窗口:ths=close
getwin(ty,X,ths,titleName)//动画 //最小化:ths=hide 关闭窗口:ths=close 打开:ths=show
* 表格的控制,配合CSS样式:ReSizeOn,可在父层表格中加入,整体控制最好放在:<body class="content ReSizeOn">
function setcellsSize(tab,cellindex,ww){//设置某列的大小
function setrowsSize(tab,rowindex,hh){//设置某行的大小
设置另一表所有列的大小:resizecelltable="bbb" 在被拉动的单元格中加入
设置另一表所有行的大小: resizerowtable="bbb" 在被拉动的单元格中加入
表格在前面隐藏的列数:fronthidecellcount="2"
*表格的排序function sortTable()
*/
//定义XMLHttpRequest组件
function getrequest(){
var request = false;
try {
request = new XMLHttpRequest();
} catch (trymicrosoft) {
try {
request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (othermicrosoft) {
try {
request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
request = false;
}
}
}
if(!request) alert("你正在使用的浏览器不支持XMLHttpRequest组件,将查看不到部分信息!建议使用IE5以上浏览器。");
return request;
}
// 带提示的AJAX
function getLayerInfo(seturl,setid,returnStr) {
var request=getrequest();
request.open("post", seturl, true);
request.onreadystatechange =function() {
if (request.readyState == 4) {
if (request.status == 200) {
document.getElementById(setid).innerHTML=request.responseText.replace(//n/g, "");
}else{
document.getElementById(setid).innerHTML=returnStr+"出错!";
}
}else{
document.getElementById(setid).style.visibility="visible";
document.getElementById(setid).innerHTML=returnStr+"正在处理中...";
}
}
request.send(null);
}
// 写入ID的AJAX
function getNoTipsInfor(seturl,setid) {
var request=getrequest();
request.open("post", seturl, true);
request.onreadystatechange =function() {
if (request.readyState == 4) {
if (request.status == 200) {
document.getElementById(setid).innerHTML=request.responseText.replace(//n/g, "");
}
}
}
request.send(null);
}
// 写入FORM的AJAX
function getFormInfo(seturl,setid) {
var request=getrequest();
request.open("post", seturl, true);
request.onreadystatechange =function() {
if (request.readyState == 4) {
if (request.status == 200) {
setid.value=request.responseText.replace(//n/g, "");
}else{
setid.value="";
}
}
}
request.send(null);
}
// 只执行URL的AJAX
function getVoid(seturl) {
var request=getrequest();
request.open("post", seturl, true);
request.onreadystatechange =function() {
}
request.send(null);
}
//keyUp检测数字
function onkeyupNum(ths){
/* var value="";
var re=/^(([0-9]/d*/./d{0,20})|(0/./d{0,20})|([0-9]/d*))$/;
for(var i=0;i<ths.value.length;i++){
if (re.test(ths.value.charAt(i))){
value+=""+ths.value.charAt(i);
}
}
ths.value=value;
*/
onkeyupComm(ths,"numne");
}
/*onkeyupComm(ths,stype):keyUp检测INPUT正确否;ths是input对象,stype是类型
整数:num
正数:numne
浮点数:dec
正浮点数:decne
英文字母:en
中文:cn
字母或数字或下划线:ennumx
Email格式:email
http格式:http
中国邮政编码格式:postcode
IP地址格式:ip
中国居民身份证格式:certnum
*/
function onkeyupComm(ths,stype){
var value="小数";
var rule=/^(-?/d+)(/./d+)?$/;
if(ths.value!=""){
if (stype=="num"){
rule=/^-?/d+$/;
value="整数";
ths.style.imeMode="disabled";
}else if (stype=="numne"){
rule=/^/d+$/;
value="正数";
ths.style.imeMode="disabled";
}else if (stype=="dec"){
rule=/^(-?/d+)(/./d+)?$/;
value="小数";
ths.style.imeMode="disabled";
}else if (stype=="decne"){
rule=/^/d+(/./d+)?$/;
value="正小数";
ths.style.imeMode="disabled";
}else if (stype=="en"){
rule=/^[A-Za-z]+$/;
value="英文字母";
ths.style.imeMode="disabled";
}else if (stype=="cn"){
rule=/^[/u0391-/uFFE5]+$/;
value="中文";
}else if (stype=="ennumx"){
rule=/^[0-9a-zA-Z/_]+$/;
value="字母或数字或下划线";
ths.style.imeMode="disabled";
}else if (stype=="email"){
rule=/^/w+([-+.]/w+)*@/w+([-.]/w+)*/./w+([-.]/w+)*$/;
value="Email";
}else if (stype=="http"){
rule=/^http:////[A-Za-z0-9]+/.[A-Za-z0-9]+[//=/?%/-&_~`@[/]/':+!]*([^<>/"/"])*$/;
value="网址";
}else if (stype=="postcode"){
rule=/^/d{6}$/;
value="中国邮政编码";
ths.style.imeMode="disabled";
}else if (stype=="ip"){
rule=/^/d+./d+./d+./d+$/;
value="IP地址";
ths.style.imeMode="disabled";
}else if (stype=="certnum"){
// 身份证正则表达式(15位)
if(ths.value.length==15){
rule=/^[1-9]/d{7}((0/d)|(1[0-2]))(([0|1|2]/d)|3[0-1])/d{3}$/;
}else{
// 身份证正则表达式(18位)
rule=/^[1-9]/d{5}[1-9]/d{3}((0/d)|(1[0-2]))(([0|1|2]/d)|3[0-1])((/d{4})|/d{3}[A-Z])$/;
}
value="中国居民身份证";
ths.style.imeMode="disabled";
}
var re = new RegExp(rule);
if (ths.value.search(re) == -1)
{
ths.style.backgroundColor="#FFE8E8";
pltsTipLayer.style.left=getLeft(ths);
pltsTipLayer.style.top=getTop(ths);
pltsTipLayer.style.width=ths.clientWidth;
pltsTipLayer.style.height=ths.clientHeight;
LoadStr.innerHTML="<font color='red'>出错:只允许输入"+value+"!</font>";
pltsTipLayer.style.display="";
}else{
ths.style.backgroundColor="";
zoomInMouseOut();
}
}else{
ths.style.backgroundColor="";
zoomInMouseOut();
}
}
// 只允许录入数字
function checkFloat(formname,element)
{
// try{
// window.document.forms[formname].elements[element].focus();
// }catch(e){
// }
var s=window.document.forms[formname].elements[element].value;
var re=/^(([0-9]/d*/./d{0,20})|(0/./d{0,20})|([0-9]/d*))$/;
if (re.test(s)) return true;
else{
return false;
}
}
// 检查FORM值是否等于EqualStr
function checkEqual(formname,element,EqualStr)
{
// try{
// window.document.forms[formname].elements[element].focus();
// }catch(e){
// }
if (window.document.forms[formname].elements[element].value == EqualStr) {
return true;
}else{
return false;
}
}
// 检查两个FORM值是否相等
function checkEqualForm(formname,element1,element2)
{
// try{
// window.document.forms[formname].elements[element2].focus();
// }catch(e){
// }
if (window.document.forms[formname].elements[element1].value == window.document.forms[formname].elements[element2].value) {
return true ;
}else{
return false;
}
}
// 检查字数长度是否超过规定长度
function checkLen(formname,element,len)
{
// try{
// window.document.forms[formname].elements[element].focus();
// }catch(e){
// }
if (window.document.forms[formname].elements[element].value != null && window.document.forms[formname].elements[element].value.length>len ) {
return false ;
}else{
return true;
}
}
/* 取字符串(字节)长度 */
function getLen(sString)
{
var sStr,iCount,i,strTemp ;
iCount = 0 ;
sStr = sString.split("");
for (i = 0 ; i < sStr.length ; i ++)
{
strTemp = escape(sStr[i]);
if (strTemp.indexOf("%u",0) == -1)
{
iCount = iCount + 1 ;
}
else
{
iCount = iCount + 2 ;
}
}
return iCount ;
}
// 全选或取消复选框
function CheckEdAll(checkName,clickName)
{
var e=document.getElementsByName(checkName);
for (var i=0;i<e.length;i++)
{
e[i].checked=document.getElementsByName(clickName)[0].checked;
}
}
// 检查有多少个复选框已选上
function checkAllCheck(checkName)
{
var j=0;
var ids="";
var cc=document.getElementsByName(checkName);
for (var i=0;i<cc.length;i++)
{
if(cc[i].checked==true){
j++;
}
}
return j;
}
//获取多选值
function getCheck(checkName)
{
var ids="";
var cc=document.getElementsByName(checkName);
for (var i=0;i<cc.length;i++)
{
if(cc[i].checked==true){
if(ids!="") ids+=",";
ids+=cc[i].value;
}
}
return ids;
}
//注:新的功能不是方法;检测str是否存在(成立),并将信息写入showId中,其中chki为showTips.checkExist中case,str是判断值
function checkExist(chki,str,thsid,trueInfo,falseInfo){
showTips.checkExist(chki,str,function(bl){
pltsTipLayer.style.left=getLeft(thsid);
pltsTipLayer.style.top=getTop(thsid);
pltsTipLayer.style.width=thsid.clientWidth;
pltsTipLayer.style.height=thsid.clientHeight;
if(bl){
if(trueInfo==""){
thsid.style.backgroundColor="";
zoomInMouseOut();
}else{
thsid.style.backgroundColor="#FFE8E8";
LoadStr.innerHTML="<font color='red'>"+trueInfo+"</font>";
pltsTipLayer.style.display="";
}
}else{
if(falseInfo==""){
thsid.style.backgroundColor="";
zoomInMouseOut();
}else{
thsid.style.backgroundColor="";
LoadStr.innerHTML="<font color='#808080'>"+falseInfo+"</font>";
pltsTipLayer.style.display="";
}
}
});
}
/**
* checkSimpleExist(tablename,fields,str,thsid,trueInfo,falseInfo)
* 检测str是否存在(成立),并将信息抛出;简单方法,只适用单个条件的查询
* 其中:tablename为表名,fields为要查询的关键字字段名,str为关键字
* trueInfo是存在时返回提示信息,falseInfo是不存在时返回提示信息
* thsid 是(input)对象
* 技巧:DWR里面的where条件的这样写的:fields+"='"+Core.getNULLtoDF(str,"")+"'"
* 所以根据上面的条件可以想办法实现多条件判断:
* 比如:str可以写成 1' and aa='2等方式进行多个字段条件判断
*/
function checkSimpleExist(tablename,fields,str,thsid,trueInfo,falseInfo){
showTips.checkSimpleExist(tablename,fields,str,function(bl){
pltsTipLayer.style.left=getLeft(thsid);
pltsTipLayer.style.top=getTop(thsid);
pltsTipLayer.style.width=thsid.clientWidth;
pltsTipLayer.style.height=thsid.clientHeight;
if(bl){
if(trueInfo==""){
thsid.style.backgroundColor="";
zoomInMouseOut();
}else{
thsid.style.backgroundColor="#FFE8E8";
LoadStr.innerHTML="<font color='red'>"+trueInfo+"</font>";
pltsTipLayer.style.display="";
}
}else{
if(falseInfo==""){
thsid.style.backgroundColor="";
zoomInMouseOut();
}else{
thsid.style.backgroundColor="";
LoadStr.innerHTML="<font color='#808080'>"+falseInfo+"</font>";
pltsTipLayer.style.display="";
}
}
});
}
/*
* 按正值表达式检测Form,成立:true,不成立:false 整数:num 正数:numne 浮点数:dec 正浮点数:decne 英文字母:en
* 中文:cn 字母或数字或下划线:ennumx Email格式:email http格式:http 中国邮政编码格式:postcode IP地址格式:ip
* 中国居民身份证格式:certnum
*/
function checkElementComm(formname,element,stype)
{
// try{
// window.document.forms[formname].elements[element].focus();
// }catch(e){
// }
var rule;
if (stype=="num"){
rule=/^-?/d+$/;
return checkComm(rule,formname,element);
}else if (stype=="numne"){
rule=/^/d+$/;
return checkComm(rule,formname,element);
}else if (stype=="dec"){
rule=/^(-?/d+)(/./d+)?$/;
return checkComm(rule,formname,element);
}else if (stype=="decne"){
rule=/^/d+(/./d+)?$/;
return checkComm(rule,formname,element);
}else if (stype=="en"){
rule=/^[A-Za-z]+$/;
return checkComm(rule,formname,element);
}else if (stype=="cn"){
rule=/^[/u0391-/uFFE5]+$/;
return checkComm(rule,formname,element);
}else if (stype=="ennumx"){
rule=/^[0-9a-zA-Z/_]+$/;
return checkComm(rule,formname,element);
}else if (stype=="email"){
rule=/^/w+([-+.]/w+)*@/w+([-.]/w+)*/./w+([-.]/w+)*$/;
return checkComm(rule,formname,element);
}else if (stype=="http"){
rule=/^http:////[A-Za-z0-9]+/.[A-Za-z0-9]+[//=/?%/-&_~`@[/]/':+!]*([^<>/"/"])*$/;
return checkComm(rule,formname,element);
}else if (stype=="postcode"){
rule=/^/d{6}$/;
return checkComm(rule,formname,element);
}else if (stype=="ip"){
rule=/^/d+./d+./d+./d+$/;
return checkComm(rule,formname,element);
}else if (stype=="certnum"){
return checkIDCard(formname,element);
}
return false;
}
// 按手动输入正值表达式检测Form,成立:true,不成立:false
function checkComm(rule,formname,element)
{
var s=window.document.forms[formname].elements[element];
try{
var re = new RegExp(rule);
if (s.value.search(re) != -1)
{
return true;
}
else
{
return false;
}
}catch(e){
return false;
}
}
// 按正值表达式检测Form(身份证号),成立:true,不成立:false
function checkIDCard(formname,element)
{
var s=window.document.forms[formname].elements[element];
var isIDCard1 = new Object();
var isIDCard2 = new Object();
// 身份证正则表达式(15位)
isIDCard1=/^[1-9]/d{7}((0/d)|(1[0-2]))(([0|1|2]/d)|3[0-1])/d{3}$/;
// 身份证正则表达式(18位)
isIDCard2=/^[1-9]/d{5}[1-9]/d{3}((0/d)|(1[0-2]))(([0|1|2]/d)|3[0-1])((/d{4})|/d{3}[A-Z])$/;
// 验证身份证,如果正确
if (isIDCard1.test(s.value)||isIDCard2.test(s.value))
{
return true;
}else{
return false;
}
}
// 控制的位置TOP
function getTop(tt){
var ttop = tt.offsetTop; // TT控件的定位点高
var thei = tt.clientHeight; // TT控件本身的高
var tleft = tt.offsetLeft; // TT控件的定位点宽
var ttyp = tt.type; // TT控件的类型
while (tt = tt.offsetParent){ttop+=tt.offsetTop; tleft+=tt.offsetLeft;}
return ttop+thei+5;
}
// 控制的位置LEFT
function getLeft(tt){
var ttop = tt.offsetTop; // TT控件的定位点高
var thei = tt.clientHeight; // TT控件本身的高
var tleft = tt.offsetLeft; // TT控件的定位点宽
var ttyp = tt.type; // TT控件的类型
while (tt = tt.offsetParent){ttop+=tt.offsetTop; tleft+=tt.offsetLeft;}
return tleft;
}
// 获取单选值
function getRadio(frm){
var str;
var aa = document.getElementsByName(frm);
for(var i=0; i<aa.length; i++){
if(aa[i].checked) str=aa[i].value;
}
return str;
}
// 加入多选的下拉框
function addSltMulti(formname,frmLst,frmSlt){
var fL=window.document.forms[formname].elements[frmLst];
var fS=window.document.forms[formname].elements[frmSlt];
var t=0;
var j=1;
arrT=new Array(fL.length);
arrV=new Array(fL.length);
for(var i=1;i<fL.length;i++){
if(fL.options[i].selected==true){
t=0;
for(var ii=1;ii<fS.length;ii++){
if(fS.options[ii].value==fL.options[i].value) {
t++;
break;
}
}
if(t==0){
fS.length++;
fS.options[fS.length-1].text=fL.options[i].text;
fS.options[fS.length-1].value=fL.options[i].value;
}
}else{
arrT[j]=fL.options[i].text;
arrV[j]=fL.options[i].value;
j++;
}
}
if(j!=fL.length){
fL.length=1;
for(var i=1;i<j;i++){
fL.length++;
fL.options[i].text=arrT[i];
fL.options[i].value=arrV[i];
}
}
}
//移除已选中的选中下拉框(多选)
function removeSltMulti(formname,frmSlt,frmLst){
addSltMulti(formname,frmSlt,frmLst);
}
// 加入单选的下拉框
function addSlt(formname,frmLst,frmSlt){
var fL=window.document.forms[formname].elements[frmLst];
var fS=window.document.forms[formname].elements[frmSlt];
for(var i=1;i<fL.length;i++){
if(fL.options[i].selected==true){
fS.length=2;
fS.options[1].text=fL.options[i].text;
fS.options[1].value=fL.options[i].value;
}
}
}
// 删除所有下拉框值
function delSlt(formname,frmSlt){
var fS=window.document.forms[formname].elements[frmSlt];
for(var i=1;i<fS.length;i++){
if(fS.options[i].selected==true){
fS.length=1;
// fS.remove(fS.selectedIndex);
}
}
}
///移除已选中所有下拉框值
function removeSlt(formname,frmSlt,frmLst){
delSlt(formname,frmSlt);
}
// 删除选择的多选
function delSlted(formname,frmSlt){
var i, j, k, max
k = 1
var from=window.document.forms[formname].elements[frmSlt];
max = from.length
arrText = new Array(max)
arrValue = new Array(max)
for (i=1; i < max; i++) {
if (from.options[i].selected) {
} else {
arrText[k] = from.options[i].text
arrValue[k] = from.options[i].value
k++
}
}
from.length=k;
for (i=1; i < k; i++) {
from.options[i].text = arrText[i]
from.options[i].value = arrValue[i]
}
}
// 选中多选的上移
function upSlt(formname,frmSlt){
var oF = window.document.forms[formname].elements[frmSlt];
try{
if (oF.selectedIndex>1){
for(var i=1;i<oF.length;i++){
if(oF.options[i].selected==true){
oF.options.insertBefore(oF.options[i],oF.options[i-1]);
}
}
}
}
catch(e){}
}
// 选中多选的下移
function downSlt(formname,frmSlt){
var oF = window.document.forms[formname].elements[frmSlt];
try{
if (oF.selectedIndex>0){
for(var i=oF.length-1;i>0;i--){
if(oF.options[i].selected==true){
oF.options.insertBefore(oF.options[i+1],oF.options[i]);
}
}
}
}
catch(e){}
}
// 选中所有已选内容
function sltSlt(formname,frmSlt){
var fS=window.document.forms[formname].elements[frmSlt];
var j=0;
fS.options[0].selected=false;
for(var i=1;i<fS.length;i++){
j++;
fS.options[i].selected=true;
// str=str+fS.options[i].value+",";
}
return j;
}
function getUpPicForm(formname,inputname)
{//上传图片,并写入文本框中
var arr = showModalDialog("/zcInfo/Editor/InsertOnePic.htm", "", "dialogWidth:550px; dialogHeight:300px;help: no; scroll: no; status: no");
if (arr != null){
if(window.document.forms[formname].elements[inputname]!=undefined){
window.document.forms[formname].elements[inputname].value=arr;
}
}
}
function EditorReset(editorname,formname,inputname)
{//带编辑器的重置
var frm=window.document.forms[formname].elements[inputname];
var editorF=window.frames[editorname];
frm.form.reset();
editorF.HtmlEditor.document.open();
editorF.HtmlEditor.document.write(frm.value);
editorF.HtmlEditor.document.close();
editorF.sourceEditor.value=frm.value;
}
/* 新建弹出层窗口,弹可多个 */
var zindex=100;
var To=0;
function openMax(ths,X,thsurl,titleName){//新建弹出最大化窗口
/*
* ths:窗口个数
* X:大小
* thsurl:打开路径
* titleName:窗口名称
*/
if(cartoon==4){//本处新功能,弹出系统(IE)窗口
var win=window.open(thsurl,"Menu"+ths,"width=1,height=1,top=0,left=0,location=no,resizable=yes,scrollbars=yes,status=no");
win.moveTo(0,0);
win.resizeTo(screen.availWidth,screen.availHeight);
win.focus();
return false;
}
if(document.getElementById("Menu"+ths)==undefined){
Menulisttemp.innerHTML=getDIV(ths,X,titleName);
Menulist.appendChild(document.getElementById("Menu"+ths));
Menulisttemp.innerHTML="";
document.getElementById("Frame"+ths).src=thsurl;
}
showMaxOrMin(ths,X);
zindex++;
document.getElementById("Menu"+ths).style.zIndex=zindex;
document.getElementById("Menu"+ths).style.visibility="visible";
if(document.getElementById("bottomMenu"+ths)!=undefined){
bottomMenu.removeChild(document.getElementById("bottomMenu"+ths));//关掉可能存在的底标图标
}
return false;
return false;
}
function openDiv(ths,X,thsurl,titleName){//新建弹出层窗口
/*
* ths:窗口个数
* X:大小
* thsurl:打开路径
* titleName:窗口名称
*/
if(cartoon==4){//本处新功能,弹出系统(IE)窗口
var H=(X*3/4>document.body.clientHeight-50)?(document.body.clientHeight-50):(X*3/4);
var L=((document.body.clientWidth-X)/2)+(To%5)*10;
var T=100+(To%5)*10;
var win=window.open(thsurl,"Menu"+ths,"width="+X+",height="+H+",top="+T+",left="+L+",location=no,resizable=yes,scrollbars=yes,status=no");
win.focus();
return false;
}
if(document.getElementById("Menu"+ths)==undefined){
Menulisttemp.innerHTML=getDIV(ths,X,titleName);
Menulist.appendChild(document.getElementById("Menu"+ths));
Menulisttemp.innerHTML="";
document.getElementById("Frame"+ths).src=thsurl;
}
document.getElementById("Menu"+ths).style.top=50+(To%5)*10;
document.getElementById("Menu"+ths).style.left=((document.body.clientWidth-X)/2-50)+(To%5)*10;
To++;
if (To>1000001) To=0;
getwin('show',X,ths,titleName);
zindex++;
document.getElementById("Menu"+ths).style.zIndex=zindex;
if(document.getElementById("bottomMenu"+ths)!=undefined){
bottomMenu.removeChild(document.getElementById("bottomMenu"+ths));//关掉可能存在的底标图标
}
}
var cartoon=2;//动画效果,默认为:2
function getwin(ty,X,ths,titleName){//动画窗口
if (ty=="hide"){
if(cartoon==1) setTimeout("hidewin('"+ths+"',0,"+X+",'"+titleName+"')",1);//大小动画
if(cartoon==2) setTimeout("hidewin2('"+ths+"',0,"+X+",'"+titleName+"')",1);//渐变动画
if(cartoon==3) hidewin3(ths,0,X,titleName);//无动画
}
if (ty=="close"){
if(cartoon==1) setTimeout("hidewin('"+ths+"',1,"+X+",'"+titleName+"')",1);//大小动画
if(cartoon==2) setTimeout("hidewin2('"+ths+"',1,"+X+",'"+titleName+"')",1);//渐变动画
if(cartoon==3) hidewin3(ths,1,X,titleName);//无动画
}
if (ty=="show"){
if(cartoon==1) setTimeout("showwin("+X+",'"+ths+"')",1); //大小动画
if(cartoon==2) setTimeout("showwin2("+X+",'"+ths+"')",1); //渐变动画
if(cartoon==3) showwin3(X,ths);//无动画
//让打开的页面可执行,特殊情况:在弹开窗口时出现部分页面只读,问题不明
//document.getElementById("Frame"+ths).document.body.focus();
}
return false;
}
function openUpateUrlDiv(ths,X,thsurl,titleName){//每次更新页面的方法
if(document.getElementById("Menu"+ths)!=undefined){
document.getElementById("Frame"+ths).src=thsurl;//每次更新页面
}
openDiv(ths,X,thsurl,titleName);
}
function showwin(X,ths){//显示窗口,缩放动画
var menuobj=document.getElementById("Menu"+ths);
menuobj.style.visibility="visible";
if (parseInt(menuobj.style.width.replace("px",""))<=X-50){
menuobj.style.width=parseInt(menuobj.style.width.replace("px",""))+100;
if(parseInt(menuobj.style.height.replace("px",""))<document.body.clientHeight-100){
menuobj.style.height=parseInt(menuobj.style.height.replace("px",""))+60;
}
setTimeout("showwin("+X+",'"+ths+"')",1);
}else{
//微调窗口大小到指定宽度;
menuobj.style.width=X;
//按4:3的比例设定高度,除非高度大于窗口高度-LOGO
menuobj.style.height=((X*3/4>document.body.clientHeight-100)?(document.body.clientHeight-100):(X*3/4));
}
return false;
}
function hidewin(ths,chk,X,titleName){//关闭窗口,缩放动画
var menuobj=document.getElementById("Menu"+ths);
if(chk==1){
try{
if("about:blank"!=document.frames["Frame"+ths].location.href)
document.frames["Frame"+ths].location.href="about:blank";
}catch(e){return;}
}
if (parseInt(menuobj.style.width.replace("px",""))>150){
menuobj.style.width=parseInt(menuobj.style.width.replace("px",""))-75;
menuobj.style.height=(parseInt(menuobj.style.height.replace("px",""))>=50) ? (parseInt(menuobj.style.height.replace("px",""))-50) : 0;
setTimeout("hidewin('"+ths+"',"+chk+","+X+",'"+titleName+"')",1);
}else{
if(chk==1){
Menulist.removeChild(menuobj);
if(document.getElementById("bottomMenu"+ths)!=undefined){
bottomMenu.removeChild(document.getElementById("bottomMenu"+ths));//关掉可能存在的底标图标
}
}else{
moveToBottom(ths,X,titleName);
}
}
return false;
}
var filteralphaopacitystep=20;//渐显渐隐刻度
function showwin2(X,ths){//显示窗口,渐显渐隐动画
var menuobj=document.getElementById("Menu"+ths);
if(X<10) X=20;
if (parseInt(menuobj.style.width.replace("px",""))<10){
menuobj.style.visibility="visible";
menuobj.filters.alpha.opacity=0;
menuobj.style.width=X;
//按4:3的比例设定高度,除非高度大于窗口高度-LOGO
menuobj.style.height=((X*3/4>document.body.clientHeight-100)?(document.body.clientHeight-100):(X*3/4));
}
if(menuobj.filters.alpha.opacity<100){
menuobj.filters.alpha.opacity=menuobj.filters.alpha.opacity+filteralphaopacitystep;
setTimeout("showwin2("+X+",'"+ths+"')",1);
}
return false;
}
function hidewin2(ths,chk,X,titleName){//关闭窗口,渐显渐隐动画
var menuobj=document.getElementById("Menu"+ths);
if(chk==1){
try{
if("about:blank"!=document.frames["Frame"+ths].location.href)
document.frames["Frame"+ths].location.href="about:blank";
}catch(e){return;}
}
if (menuobj.filters.alpha.opacity>filteralphaopacitystep){
menuobj.filters.alpha.opacity=menuobj.filters.alpha.opacity-filteralphaopacitystep;
setTimeout("hidewin2('"+ths+"',"+chk+","+X+",'"+titleName+"')",1);
}else{
if(chk==1){
Menulist.removeChild(menuobj);
if(document.getElementById("bottomMenu"+ths)!=undefined){
bottomMenu.removeChild(document.getElementById("bottomMenu"+ths));//关掉可能存在的底标图标
}
}else{
menuobj.style.width=0;
menuobj.style.height=0;
moveToBottom(ths,X,titleName);
}
}
return false;
}
function showwin3(X,ths){//无动画显示窗口
var menuobj=document.getElementById("Menu"+ths);
menuobj.style.visibility="visible";
menuobj.style.width=X;
//按4:3的比例设定高度,除非高度大于窗口高度-LOGO
menuobj.style.height=((X*3/4>document.body.clientHeight-100)?(document.body.clientHeight-100):(X*3/4));
return false;
}
function hidewin3(ths,chk,X,titleName){//无动画关闭窗口
var menuobj=document.getElementById("Menu"+ths);
if(chk==1){
try{
document.frames["Frame"+ths].location.href="about:blank";
}catch(e){return;}
Menulist.removeChild(menuobj);
if(document.getElementById("bottomMenu"+ths)!=undefined){
bottomMenu.removeChild(document.getElementById("bottomMenu"+ths));//关掉可能存在的底标图标
}
}else{
menuobj.style.visibility="hidden";
try{
if(document.getElementById("bottomMenu"+ths)==undefined){
Menulisttemp.innerHTML=getBottomDiv(ths,X,titleName);
bottomMenu.appendChild(document.getElementById("bottomMenu"+ths));
Menulisttemp.innerHTML="";
}
}catch(e){
}
}
return false;
}
var showmaxorminTime=0;
function showdbMaxOrMin(ths,X){//双击最大化/恢复窗口,(暂不能实现)
var menuobj=document.getElementById("Menu"+ths);
var showmmt=(new Date()).getTime();
if(showmmt-showmaxorminTime<400){
showMaxOrMin(ths,X)
}
showmaxorminTime=showmmt;
}
function showMaxOrMin(ths,X){//最大化/恢复窗口
var menuobj=document.getElementById("Menu"+ths);
if (menuobj.style.width!="100%"){
menuobj.style.left=0;
menuobj.style.width="100%";
}else{
menuobj.style.left=((document.body.clientWidth-X)/2-50)+(To%5)*10;
menuobj.style.width=X;
}
if (menuobj.style.height!="100%"){
menuobj.style.top=0;
menuobj.style.height="100%";
}else{
menuobj.style.top=50+(To%5)*10;
menuobj.style.height=((X*3/4>document.body.clientHeight-100)?(document.body.clientHeight-100):(X*3/4));
}
}
function moveToBottom(ths,X,titleName){//移动窗口到底部
var menuobj=document.getElementById("Menu"+ths);
if (parseInt(menuobj.style.top.replace("px",""))<document.body.clientHeight-30){
menuobj.style.top=parseInt(menuobj.style.top.replace("px",""))+30;
menuobj.style.left=(parseInt(menuobj.style.left.replace("px",""))<document.body.clientWidth/2) ? (parseInt(menuobj.style.left.replace("px",""))+20) : (parseInt(menuobj.style.left.replace("px",""))-20);
setTimeout("moveToBottom('"+ths+"',"+X+",'"+titleName+"')",1);
}else{
menuobj.style.visibility="hidden";
try{
if(document.getElementById("bottomMenu"+ths)==undefined){
Menulisttemp.innerHTML=getBottomDiv(ths,X,titleName);
bottomMenu.appendChild(document.getElementById("bottomMenu"+ths));
Menulisttemp.innerHTML="";
}
}catch(e){
}
}
}
function getBottomDiv(ths,X,titleName){//底部图标
var str='<div style="float:left;cursor:hand" id="bottomMenu'+ths+'" onclick="openDiv(/''+ths+'/','+X+',/'/',/'/');zoomInMouseOut();" onmousemove="zoomInMouseMove(/''+titleName+'/');this.style.color=/'#808080/';" onmouseout="zoomInMouseOut();this.style.color=/'/';"><div style="float:left;margin-top:5;"><img src="/zcInfo/images/opwin_2_3.gif"></div><div style="float:left;margin-top:8;">'+(titleName.length>4?titleName.substring(0,3)+'...':titleName)+' </div></div>';
return str;
}
document.write('<span id="Menulist"></span><span id="Menulisttemp"></span><div style="FILTER: alpha(opacity=0);position: absolute; width:100%; height: 100%; z-index: 1; left:0px; top:0px; background-color:#000000; display:none" id="blankDiv" onclick="o=0;" onmousemove="moveDiv(c);"></div>');
var o=0;
var c=0;//临时层ID
var x=0;
var y=0;
function chickDiv(ths,oo){//点击层
o=oo;
c=ths;
zindex++;
document.getElementById("Menu"+ths).style.zIndex=zindex;
zindex++;
blankDiv.style.zIndex=zindex;
blankDiv.style.display="";
}
function moveDiv(ths){//移动层
var evn = window.event;
if(evn.button==1&&o==1){
if (x==0) x=evn.clientX-parseInt(document.getElementById("Menu"+ths).style.left.replace("px",""));
if (y==0) y=evn.clientY-parseInt(document.getElementById("Menu"+ths).style.top.replace("px",""));
document.getElementById("Menu"+ths).style.left=evn.clientX-x;
document.getElementById("Menu"+ths).style.top=evn.clientY-y;
}else if(evn.button==1&&o==2){
document.getElementById("Menu"+ths).style.width=(evn.clientX-parseInt(document.getElementById("Menu"+ths).style.left.replace("px",""))<150) ? 150:evn.clientX-parseInt(document.getElementById("Menu"+ths).style.left.replace("px",""));
document.getElementById("Menu"+ths).style.height=(evn.clientY-parseInt(document.getElementById("Menu"+ths).style.top.replace("px",""))<10) ? 10:evn.clientY-parseInt(document.getElementById("Menu"+ths).style.top.replace("px",""));
blankDiv.style.width=document.body.scrollWidth;
blankDiv.style.height=document.body.scrollHeight;
}else{
blankDiv.style.display="none";
x=0;
y=0;
}
}
function getDIV(ths,X,titleName){//建立层窗体
var str='<div style="filter:progid:DXImageTransform.Microsoft.Shadow(Color=#aaaaaa,Direction=120,strength=8) alpha(opacity=100);position: absolute; width: 1; height: 1; z-index: 1; visibility:hidden" id="Menu'+ths+'" >'+
'<table border="0" cellpadding="0" style="FILTER: alpha(opacity=98);border-collapse: collapse" width="100%" id="table5" height="100%">'+
'<tr>'+
'<td height="26">'+
'<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table6" height="100%">'+
' <tr>'+
' <td width="4">'+
' <img border="0" src="/zcInfo/images/opwin_1.gif" width="6" height="26" ></td>'+
' <td bgcolor="#a7c0dc" onmousedown="chickDiv(/''+ths+'/',1);"'+
' ><div style="overflow:hidden;height:20;float:left;"><font color="#000000" size="2" face="微软雅黑" nowrap> '+titleName+' </font></div></td>'+
' <td width="12" bgcolor="#a7c0dc">'+
' <img border="0" src="/zcInfo/images/opwin_2.gif" id="hide'+ths+'" onclick="getwin(/'hide/','+X+',/''+ths+'/',/''+titleName+'/');" style="cursor:hand" title="最小化窗口"></td>'+
' <td width="11" bgcolor="#a7c0dc">'+
' <img border="0" src="/zcInfo/images/opwin_2_3.gif" id="max'+ths+'" onclick="showMaxOrMin(/''+ths+'/','+X+');" style="cursor:hand" title="最大化/恢复窗口"></td>'+
' <td width="11" bgcolor="#a7c0dc">'+
' <img border="0" src="/zcInfo/images/opwin_3.gif" id="close'+ths+'" onclick="getwin(/'close/','+X+',/''+ths+'/',/''+titleName+'/');" style="cursor:hand" title="关闭窗口"></td>'+
' <td width="6" onmousedown="chickDiv(/''+ths+'/',1)">'+
' <p align="right">'+
' <img border="0" src="/zcInfo/images/opwin_4.gif" width="6" height="26"></td>'+
' </tr>'+
' </table>'+
' </td>'+
' </tr>'+
' <tr>'+
' <td background="/zcInfo/images/opwin_5.gif" height="0" style="background-repeat : repeat-x;" bgcolor="#f3f6fa">'+
' <table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table8" height="100%" >'+
' <tr>'+
' <td style="border-left: 1px solid #a7c0dc; border-right: 1px solid #a7c0dc; border-top-width: 1px; border-bottom-width: 1px" valign="top" >'+
' <iframe id="Frame'+ths+'" width="100%" height="100%" border="0" frameborder="0" allowTransparency="true" scrolling="auto"></iframe></td>'+
' </tr>'+
' </table>'+
' </td>'+
' </tr>'+
' <tr>'+
' <td height="13" valign="top">'+
' <table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table7">'+
' <tr>'+
' <td width="6" valign="top"><img border="0" src="/zcInfo/images/opwin_6.gif" width="6" height="13"></td>'+
' <td bgcolor="#a7c0dc" valign="top" background="/zcInfo/images/opwin_7.gif" onmousedown="chickDiv(/''+ths+'/',1)">'+
' <img border="0" src="/zcInfo/images/opwin_7.gif" width="4" height="13"></td>'+
' <td width="13" valign="top"><p align="right"><img border="0" src="/zcInfo/images/opwin_8.gif" width="13" height="13" style="cursor:se-resize" onmousedown="chickDiv(/''+ths+'/',2)"></td>'+
' </tr>'+
' </table>'+
' </td>'+
' </tr>'+
'</table>'+
'</div>';
return str;
}
/*弹出窗体结束*/
/*鼠标悬停显示*/
var pltsoffsetX =10;
var pltsoffsetY =10;
document.write('<div id=pltsTipLayer style="display:none;position: absolute; z-index:100001;filter:progid:DXImageTransform.Microsoft.Shadow(Color=#808080,Direction=120,strength=3);width:1"><table border="0" cellpadding="5" bgcolor="#F4F7F9" cellspacing="5" style="FILTER: alpha(opacity=100);width:100%"><tr><td id="LoadStr" nowrap style="color: #800000"> </td></tr></table></div>');
function zoomInMouseMove(Str)
{//显示
var MouseX=event.x;
var MouseY=event.y;
LoadStr.innerHTML=Str;
var popHeight=pltsTipLayer.clientHeight;
var popWidth=pltsTipLayer.clientWidth;
if(MouseY+pltsoffsetY+popHeight>document.body.clientHeight)
{
popTopAdjust=-popHeight-pltsoffsetY*1.5;
}
else
{
popTopAdjust=0;
}
if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth)
{
popLeftAdjust=-popWidth-pltsoffsetX*2;
}
else
{
popLeftAdjust=0;
}
pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust;
pltsTipLayer.style.display="";
}
function zoomInMouseOut(){//关闭
pltsTipLayer.style.display="none";
}
/*鼠标悬停显示结束*/
function moveOtherDiv(ths){//移动其它层
var evn = window.event;
document.getElementById(ths).style.width=(evn.clientX-parseInt(document.getElementById(ths).style.left.replace("px",""))<150) ? 150:evn.clientX-parseInt(document.getElementById(ths).style.left.replace("px",""));
document.getElementById(ths).style.height=(evn.clientY-parseInt(document.getElementById(ths).style.top.replace("px",""))<10) ? 10:evn.clientY-parseInt(document.getElementById(ths).style.top.replace("px",""));
}
/* ******************表格的控制****************** */
var theobject = null;
function resizeObject() {
this.tab=null;
this.el = null;
this.resizerowtable=undefined;
this.resizecelltable=undefined;
this.dir = "";
this.grabx = null;
this.graby = null;
this.width = null;
this.height = null;
this.left = null;
this.top = null;
this.fronthidecellcount=0;
}
function getDirection(el) {
var xPos, yPos, offset, dir;
dir = "";
xPos = window.event.offsetX;
yPos = window.event.offsetY;
offset = 8; //The distance from the edge in pixels
if (yPos <offset) dir += "n";
else if (yPos > el.offsetHeight-offset) dir += "s";
if (xPos <offset) dir += "w";
else if (xPos > el.offsetWidth-offset) dir += "e";
return dir;
}
function doDown() {
var el = getReal(event.srcElement, "tagName", "TD");
if (el == null||el.className.indexOf("resizeMe")==-1) {
theobject = null;
return;
}
dir = getDirection(el);
if (dir == "") return;
theobject = new resizeObject();
theobject.el = el;
theobject.tab=getReal(event.srcElement, "tagName", "TABLE");
if(theobject.tab.fronthidecellcount!=undefined) theobject.fronthidecellcount=theobject.tab.fronthidecellcount;
theobject.resizerowtable=el.resizerowtable;
theobject.resizecelltable=el.resizecelltable;
theobject.dir = dir;
theobject.grabx = window.event.clientX;
theobject.graby = window.event.clientY;
theobject.width = el.offsetWidth;
theobject.height = el.offsetHeight;
theobject.left = el.offsetLeft;
theobject.top = el.offsetTop;
window.event.returnValue = false;
window.event.cancelBubble = true;
}
function doUp() {
if (theobject != null) {
theobject = null;
}
}
function doMove() {
var el, xPos, yPos, str, xMin, yMin;
xMin = 8;
yMin = 8;
el = getReal(event.srcElement, "className", "resizeMe");
if (el.className.indexOf("resizeMe")>-1) {
str = getDirection(el);
if (str == "") str = "default";
else str += "-resize";
el.style.cursor = str;
}
if(theobject != null) {
try{
if (dir.indexOf("e") != -1||dir.indexOf("w") != -1) {
setcellsSize(theobject.tab,(theobject.el.cellIndex+parseInt(theobject.fronthidecellcount)),Math.max(xMin, theobject.width + window.event.clientX - theobject.grabx) + "px");
if(theobject.resizecelltable!=undefined) setAllcellsSize(document.getElementById(theobject.resizecelltable));
}
if (dir.indexOf("s") != -1||dir.indexOf("n") != -1) {
setrowsSize(theobject.tab,theobject.el.parentElement.rowIndex,Math.max(yMin, theobject.height + window.event.clientY - theobject.graby) + "px");
if(theobject.resizerowtable!=undefined) setAllrowsSize(document.getElementById(theobject.resizerowtable));
}
}catch(ex){}
window.event.returnValue = false;
window.event.cancelBubble = true;
}
}
function getReal(el, type, value) { //得到指定类型的对象
temp = el;
while ((temp != null) && (temp.tagName != "BODY")) {
if (eval("temp." + type) == value) {
el = temp;
return el;
}
temp = temp.parentElement;
}
return el;
}
function setcellsSize(tab,cellindex,ww){//设置某列的大小
for(var i=0;i<tab.rows.length;i++){
tab.rows(i).cells(cellindex).style.width=ww;
}
setTablecellsSize(tab);
chkmove=1;//拉动表格标识
}
function setrowsSize(tab,rowindex,hh){//设置某行的大小
for(var i=0;i<tab.rows(rowindex).cells.length;i++){
tab.rows(rowindex).cells(i).style.height=hh;
}
setTablerowsSize(tab);
chkmove=1;//拉动表格标识
}
function setTablecellsSize(tab){//重置表格宽度
var tableWidth=0;
for(var i=0;i<tab.rows(0).cells.length;i++){
if(tab.rows(0).cells(i).style.width!=""){
tableWidth+=parseInt((tab.rows(0).cells(i).style.width).replace("px",""));
}
}
tab.style.width=tableWidth;
}
function setTablerowsSize(tab){//重置表格高度
var tableHeight=0;
for(var i=0;i<tab.rows.length;i++){
if(tab.rows(i).cells(0).style.height!=""){
tableHeight+=parseInt((tab.rows(i).cells(0).style.height).replace("px",""));
}
}
tab.style.height=tableHeight;
}
function setAllcellsSize(toTab){//设置所有列的大小(可以是两个表)
try{
for(var i=0;i<toTab.rows.length;i++){
for(var j=0;j<toTab.rows(i).cells.length;j++){
toTab.rows(i).cells(j).style.width=theobject.tab.rows(0).cells(j).style.width;
}
}
setTablecellsSize(toTab);
}catch(e){
}
}
function setAllrowsSize(toTab){//设置所有行的大小(可以是两个表)
try{
for(var i=0;i<toTab.rows.length;i++){
for(var j=0;j<toTab.rows(i).cells.length;j++){
toTab.rows(i).cells(j).style.height=theobject.tab.rows(i).cells(0).style.height;
}
}
setTablerowsSize(toTab);
}catch(e){
}
}
/* ************表格的排序**************** */
var sortType = 0; //0降序 1升序
var chkmove=0;//是否拉动表格
function sortTable(tableid,hidecellcount) {//hidecellcount前面隐藏的列数
if (chkmove==0){
var el = getReal(event.srcElement, "tagName", "TD");
var tab=tableid.rows[0].parentElement;
var theRows=new Array();
var len=tab.rows.length;
var idx=el.cellIndex+hidecellcount;
for(var i=0;i<len;i++) {
theRows[i]=new Array(tab.rows[i].cells[idx].innerText,tab.rows[i].cloneNode(true));
}
for(var i=0;i<len;i++) {
tab.removeChild(tab.rows[0]);
}
if(sortType == 0){
theRows.sort(sortRowsDesc);
sortType = 1;
}else{
theRows.sort(sortRowsAsc);
sortType = 0;
}
for(var i=0;i<theRows.length;i++) {
tab.appendChild(theRows[i][1]);
// alert(tab.rows[i].cells[idx].innerText);
}
}else{
chkmove=0;
}
return ;
}
function sort2Table(tableid1,tableid2) {
if (chkmove==0){
var hc=0;
if(tableid1.fronthidecellcount!=undefined) hc=parseInt(tableid1.fronthidecellcount);
sortTable(tableid1,hc);
if(sortType == 0){
sortType = 1;
}else{
sortType = 0;
}
sortTable(tableid2,hc);
}else{
chkmove=0;
}
}
function sortRowsDesc(x,y) {
if(x[0]>y[0]) return -1;
else if(x[0]<y[0]) return 1;
else return 0;
}
function sortRowsAsc(x, y){
if(x[0]<y[0]) return -1;
else if(x[0]>y[0]) return 1;
else return 0;
}
正则表达式: