init_wev8.js 29.7 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008
top._initStatus = false;

function openFullWindow(url){
  var redirectUrl = url ;
  var width = screen.width ;
  var height = screen.height ;
  if (height == 768 ) height -= 75 ;
  if (height == 600 ) height -= 60 ;
  var szFeatures = "top=0," ; 
  szFeatures +="left=0," ;
  szFeatures +="width="+width+"," ;
  szFeatures +="height="+height+"," ; 
  szFeatures +="directories=no," ;
  szFeatures +="status=yes," ;
  szFeatures +="menubar=no," ;
  if (height <= 600 ) szFeatures +="scrollbars=yes," ;
  else szFeatures +="scrollbars=no," ;
  szFeatures +="resizable=yes" ; //channelmode
  window.open(redirectUrl,"",szFeatures) ;
}

function openFullWindowBySelf(url){
	if(url.indexOf("&is_customized_link=true")>-1) {
		url = url.substring(0, url.indexOf("&is_customized_link=true"));
		window.location.href = url;
		return;
	}
	url += "&isopenbyself=1"; 
	window.location.href = url;
}

function openFullWindowHaveBar(url){
  var redirectUrl = url ;
  var width = screen.availWidth-10 ;
  var height = screen.availHeight-50 ;
  //if (height == 768 ) height -= 75 ;
  //if (height == 600 ) height -= 60 ;
   var szFeatures = "top=0," ;
  szFeatures +="left=0," ;
  szFeatures +="width="+width+"," ;
  szFeatures +="height="+height+"," ;
  szFeatures +="directories=no," ;
  szFeatures +="status=yes,toolbar=no,location=no," ;
  szFeatures +="menubar=no," ;
  szFeatures +="scrollbars=yes," ;
  szFeatures +="resizable=yes" ; //channelmode
  window.open(redirectUrl,"",szFeatures) ;
}

function openFullWindowHaveBarForWFList(url,requestid){
	try{
		document.getElementById("wflist_"+requestid+"span").innerHTML = "";
	}catch(e){}
	var redirectUrl = url ;
	var width = screen.availWidth-10 ;
	var height = screen.availHeight-50 ;
	//if (height == 768 ) height -= 75 ;
	//if (height == 600 ) height -= 60 ;
	var szFeatures = "top=0," ;
	szFeatures +="left=0," ;
	szFeatures +="width="+width+"," ;
	szFeatures +="height="+height+"," ;
	szFeatures +="directories=no," ;
	szFeatures +="status=yes,toolbar=no,location=no," ;
	szFeatures +="menubar=no," ;
	szFeatures +="scrollbars=yes," ;
	szFeatures +="resizable=yes" ; //channelmode
	window.open(redirectUrl,"",szFeatures) ;
}

//涓轰簡鍒犻櫎鏃剁敤
function openFullWindow1(url){
  var redirectUrl = url ;
  var width = screen.width ;
  var height = screen.height ;
  if (height == 768 ) height -= 75 ;
  if (height == 600 ) height -= 60 ;
  var szFeatures = "top="+height/2+"," ; 
  szFeatures +="left="+width/2+"," ; 
  szFeatures +="width=181," ;
  szFeatures +="height=129," ; 
  szFeatures +="directories=no," ;
  szFeatures +="status=yes," ;
  szFeatures +="menubar=no," ;
  if (height <= 600 ) szFeatures +="scrollbars=yes," ;
  else szFeatures +="scrollbars=no," ;
  szFeatures +="resizable=no" ; //channelmode
  window.open(redirectUrl,"",szFeatures) ;
}


function openFullWindowForXtable(url){
  var redirectUrl = url ;
  var width = screen.availWidth-10 ;
  var height = screen.availHeight-60 ;
  //if (height == 768 ) height -= 75 ;
  //if (height == 600 ) height -= 60 ;
  var szFeatures = "top=0," ; 
  szFeatures +="left=0," ;
  szFeatures +="width="+width+"," ;
  szFeatures +="height="+height+"," ; 
  szFeatures +="directories=no," ;
  szFeatures +="status=yes," ;
  szFeatures +="menubar=no," ;
  szFeatures +="scrollbars=yes," ;
  szFeatures +="resizable=yes" ; //channelmode
  window.open(redirectUrl,"",szFeatures) ;
}

/**鎵撳紑闀縰rl鐨勭獥鍙o紝鍥犱负url杩囬暱鏃讹紝浼氬鑷存祻瑙堝櫒鏃犳硶澶勭悊锛宎dd by fmj 2015-03-04 start*/
/**鎬濊矾鏄紝鍦ㄥ綋鍓嶇獥鍙f柊寤轰竴涓殣钘忕殑form锛屽皢鍘熸湰鐨剈rl鍒嗕负2閮ㄥ垎锛屽弬鏁版敼涓簆ost浼犲�硷紝url浣滀负form鐨刟ction鍦板潃*/
function openFullWindowForLong(url,_target){
	if(url && url.length > 2048){
		var list = [];
		var index = url.indexOf("?");
		if(index != -1){
			var paramString = url.substring(index + 1);
			url = url.substring(0,index);
			var paramarr = paramString.split("&");
			for(var i = 0; i < paramarr.length; i++){
				var singlearr = paramarr[i];
				var arr = singlearr.split("=");
				var key = arr[0];
				var value = "";
				if(arr.length > 1){
					value = arr[1];
				}
				var param = {};
				param.key = key;
				param.value = value;
				list.push(param);
			}
		}
		var formObj = document.getElementById("long_url_form");
		if(formObj){   //濡傛灉宸茬粡瀛樺湪form锛屽厛鍒犻櫎
			document.body.removeChild(formObj);
		}
		var _form = document.createElement("form");
		_form.id = "long_url_form";
		_form.action = url;
		_form.target = _target || "_blank";
		_form.method = "post";
		_form.style.display = "none";
		for(var i =0; i < list.length;i++){   //鏂板缓闅愯棌鐨勬枃鏈煙锛屽皢url涓殑鍙傛暟瀛樺叆闅愯棌鍩�
			var _map = list[i];
			var input = document.createElement("input");
			input.name = _map.key;
			input.type = "hidden";
			input.value = _map.value;
			_form.appendChild(input);
		}
		document.body.appendChild(_form);
		_form.submit();
	}else{
		openFullWindowForXtable(url);
	}
}
/**鎵撳紑闀縰rl鐨勭獥鍙o紝add by fmj 2015-03-04 start*/

function  readCookie(name){  
   var  cookieValue  =  "7";  
   var  search  =  name  +  "=";
   try{
	   if(document.cookie.length  >  0) {    
	       offset  =  document.cookie.indexOf(search);  
	       if  (offset  !=  -1)  
	       {    
	           offset  +=  search.length;  
	           end  =  document.cookie.indexOf(";",  offset);  
	           if  (end  ==  -1)  end  =  document.cookie.length;  
	           cookieValue  =  unescape(document.cookie.substring(offset,  end))  
	       }  
	   }  
   }catch(exception){
   }
   return  cookieValue;  
} 

function setMenuDisabled(){
	var o, _disabled;
	switch(arguments.length){
		case 0 :
			o = window.frames["rightMenuIframe"].event.srcElement;
			_disabled = true;
			break;
		case 1 :
			o = arguments[0];
			_disabled = true;
			break;
		case 2 :
			o = arguments[0];
			_disabled = arguments[1];
			break;
	}
	o.disabled = _disabled;
}

/**
 * 鏍规嵁鏍囪瘑锛坣ame鎴栬�卛d锛夎幏鍙栧厓绱狅紝涓昏鐢ㄤ簬瑙e喅绯荤粺涓緢澶氬厓绱犳病鏈塱d灞炴�э紝
 * 鍗村湪js涓娇鐢╠ocument.getElementById(name)鏉ヨ幏鍙栧厓绱犵殑闂銆�
 * @param identity name鎴栬�卛d
 * @return 鍏冪礌
 */
function $GetEle(identity, _document) {
	var rtnEle = null;
	if (_document == undefined || _document == null) _document = document;
	
	rtnEle = _document.getElementById(identity);
	if (rtnEle == undefined || rtnEle == null) {
		rtnEle = _document.getElementsByName(identity);
		if (rtnEle.length > 0) rtnEle = rtnEle[0];
		else rtnEle = null;
	}
	return rtnEle;
}

function $G(identity, _document) {
	return $GetEle(identity, _document);
}

function $GetEles(identity) {
	var rtnEle = null;
	
	rtnEle = document.getElementsByName(identity);
	
	if (rtnEle.length == 1) {
		return rtnEle[0]; 
	} else if (rtnEle.length == 0) {
		return document.getElementById(identity);
	}
	return rtnEle;
}

var wuiUtil = {
	/**
	 * isNotNull 鐩爣鍊间笉涓簄ull || undefined锛岃繑鍥瀟rue锛屽惁鍒欒繑鍥瀎alse
	 */
	isNotNull: function (target) {
		if (target == undefined || target == null) {
			return false;
		}
		return true;
	}, 
	/**
	 * isNullOrEmpty 鐩爣鍊间负null銆乽ndefined銆佺┖锛岃繑鍥瀟rue锛屽惁鍒欒繑鍥瀎alse
	 */
	isNullOrEmpty : function (target) {
		if (target == undefined || target == null || target == "") {
			return true;
		}
		return false;
	}, 
	/**
	 * isNotEmpty 鐩爣鍊间笉涓簄ull銆乽ndefined銆佺┖锛岃繑鍥瀟rue锛屽惁鍒欒繑鍥瀎alse
	 */
	isNotEmpty : function (target) {
		if (target == undefined || target == null || target == "") {
			return false;
		}
		return true;
	},
	getJsonValueByIndex: function (josinobj, index) {
		var _index = 0;
		try {
			for(var key in josinobj){
				if (index == _index) {
					return josinobj[key]; 			
				}
				_index++;
			}
		} catch (e) {alert("browser return value is error!");}
		return "";
	},
	getJsonValueByIndexNew: function (josinobj, index) {
		var _index = 0;
		try {
			var josinobj = eval("("+josinobj+")");
			if(typeof(josinobj) != undefined && typeof(josinobj) != 'undefined'&&null!=josinobj){
				var isjosin = josinobj.id;
				//alert("isjosin : "+isjosin);
				if(typeof(isjosin) != undefined && typeof(isjosin) != 'undefined'&&null!=isjosin)
				{
					for(var key in josinobj){
						if (index == _index) {
							return josinobj[key]; 			
						}
						_index++;
					}
				}
				else
				{
					jsids = new VBArray(josinobj).toArray();
					return jsids[index];
				}
			}
		} catch (e) {alert("browser return value is error!");}
		return "";
	}
};



//鏄惁鏄痗hrome37+
var systemshowModalDialog = window._systemshowModalDialog;
//dialog杩斿洖鍊�
var dialogReturnValue = void 0;
//showmodeldialog鏂规硶璋冪敤鑰�
var dialogcaller = void 0;
//娴佺▼瀛楁鑱斿姩
var datainputCaller = void 0;
//瀛楁鑱斿姩鏂规硶
var datainputFun = void 0;
//showmodeldialog鏂规硶璋冪敤鑰呭弬鏁�
var dialogcallerArguments = void 0;


var othcaller = void 0;

var childWindow = void 0;
/**
 * 椤甸潰鍏抽棴鏃惰皟鐢�
 */
var closeHandle = function (rtvval) {
	if (dialogcaller) {
		//閲嶅啓鏂规硶
		callerhandle(dialogcaller.toString(), datainputCaller);
	}
	var nfunarguments = new Array();
	nfunarguments.push(dialogReturnValue);
	
	//alert("test:"+ dialogcallerArguments.length);
	if (dialogcallerArguments) {
		for (var i=0; i<dialogcallerArguments.length; i++) {
			//alert(dialogcallerArguments[i]);
			//var argument = dialogcallerArguments[i];
			nfunarguments.push(dialogcallerArguments[i]);
		}
    }
	if (typeof(_callbackfunciton) == 'function') {
		_callbackfunciton.apply(null, nfunarguments);
	}
	
	if (!!datainputFun) {
		try {
			eval(datainputFun);
		} catch (e) {}
	}
	
	if (!!othcaller) {
		parentCallerHandle(dialogcaller.toString(), othcaller.toString(), dialogReturnValue);
	}
	
	//璋冪敤瀹屾瘯锛岄噸缃弬鏁帮紝淇濊瘉涓嬫璋冪敤鐨勬纭��
	resetDialog();
}

/**
 * 閲嶅啓璋冪敤鑰呮柟娉�
 */
var _callbackfunciton;
function callerhandle(callerstr, datainputCaller) {
	var funnameregex = /function +[^\(]*\(/;
	//var funnameregex = /function +.+\(/;
	var funnameendregex = /_callbackfunciton *= *function *\(_callbackobj, *\)/;
	
	callerstr = callerstr.replace(funnameregex, "_callbackfunciton = function (_callbackobj,");
	callerstr = callerstr.replace(funnameendregex, "_callbackfunciton = function (_callbackobj)");
	
	var _callerstrback = callerstr;
	//alert(callerstr);
	var callbackfun = "";
	//var regex = /=[ ]*window\.showModalDialog\(([^\(]+([\(][^\)]*\))*[^\)]+)*\)/g;
	var regex = /=[ ]*(window\.)?showModalDialog\([^\)]+\)/g;
	
	callerstr = callerstr.replace(regex, " = _callbackobj;//");
	
	//alert(callerstr);
	try {
		//涓嶉渶瑕佽祴鍊肩殑鎯呭喌(姣斿锛氭祦绋嬪鍏�)
		var regex3 = /[ ]*(window\.)?showModalDialog\([^\)]+\)/g;
		//var regex = /=[ ]*window\.showModalDialog\(([^\(]+([\(][^\)]*\))*[^\)]+)*\)/g;
		callerstr = callerstr.replace(regex3, "//");
		//alert(callerstr);
		eval(callerstr);
		if (!!datainputCaller) {
			var datainputCallerstr = datainputCaller.toString();
			
			var diregex = /datainput\(\'field[\d]+\'\);?/;
			
			var rs = diregex.exec(datainputCallerstr);
			if (!!rs && rs.length > 0) {
				datainputFun = rs[0];
			} else {
				//鏄庣粏瀛楁鐨勫瓧娈佃仈鍔�
				diregex = /datainputd\(\'field[\d]+_[\d]+\'\);?/;
				rs = diregex.exec(datainputCallerstr);
				if (!!rs && rs.length > 0) {
					datainputFun = rs[0];
				} 
			}
		}
	} catch (e) {
		try {
			var regexRs = regex.exec(_callerstrback);
			if (!!regexRs && regexRs.length > 0) {
				var rexindex = regex.lastIndex;
				
				var tempfunstr = _callerstrback.substr(rexindex);
				var temprightgindex = tempfunstr.indexOf(")");
				
				if (temprightgindex != -1 ) {
					tempfunstr = tempfunstr.substr(temprightgindex + 1);
				}
				
				var count = 0;
				
				var tempregex = /^[ ]*[\)]*[ ]*[+,]/;
				var temprs = tempregex.exec(tempfunstr);
				while (!!temprs && temprs.length > 0) {
					temprightgindex = tempfunstr.indexOf(")");
					if (temprightgindex == -1 ) {
						break;
					}
					tempfunstr = tempfunstr.substr(temprightgindex + 1);
					tempregex = /^[^\)]*[\)][\+,]/;
					temprs = tempregex.exec(tempfunstr);
					if (count++ == 20) {
						break;
					}
				}
				temprightgindex = tempfunstr.indexOf(")");
				if (temprightgindex != -1 ) {
					tempfunstr = tempfunstr.substr(temprightgindex + 1);
				}
				tempfunstr = tempfunstr.replace(/^[ ]*;/g, "");
				var tempfunbeforestr = _callerstrback.substring(0, rexindex);
				
				
				tempfunbeforestr = tempfunbeforestr.replace(regex, " = _callbackobj;//");
				_callerstrback = tempfunbeforestr + "\r\n" + tempfunstr;
			}
			//涓嶉渶瑕佽祴鍊肩殑鎯呭喌(姣斿锛氭祦绋嬪鍏�)
			var regex3 = /[ ]*(window\.)?showModalDialog\([^\)]+\)/g;
			//var regex = /=[ ]*window\.showModalDialog\(([^\(]+([\(][^\)]*\))*[^\)]+)*\)/g;
			_callerstrback = _callerstrback.replace(regex3, "//");
			eval(_callerstrback);
		} catch (e10) {
		}
	}
}

function parentCallerHandle(_callerstr, of, _dialogReturnValue) {
	try {
		if (!!!_dialogReturnValue || !!!of) return; 
		
		var _pcallerstr = of.toString();
		
		var callerfnname = getFuncName(_callerstr);
		var ofname = getFuncName(of);
		
		if (callerfnname == 'onSetRejectNode' && ofname == 'doReject') {
			var rjnoderegex = /onSetRejectNode\(\)/g;
			_pcallerstr = _pcallerstr.replace(rjnoderegex, "true");
			
			var funnameregex = /function +[^\(]*\(/;
			_pcallerstr = _pcallerstr.replace(funnameregex, "_parentcallbackfun = function (");
			eval(_pcallerstr);
			//鎵ц
			_parentcallbackfun();
		}
		
	} catch (e) {alert(e);}
}

/**
 * 閲嶇疆dialog鍙傛暟
 */
function resetDialog() {
	_callbackfunciton = void 0;
	dialogReturnValue = void 0;
	dialogcaller = void 0;
	datainputCaller = void 0;
	datainputFun = void 0;
	
	othcaller = void 0;
} 

function getFuncName(func){
    var funcName = String(func) ;
    return funcName.replace(/^function(\s|\n)+(.+)\((.|\n)+$/,'$2');
}
//-----------------------------------------
// 閫夋嫨妗嗙敤杞崲绋嬪簭 start
//-----------------------------------------
if (typeof(SYSTEM_SHOW_MODAL_DIALOG) == "undefined" && typeof(SYSTEM_SHOW_MODAL_DIALOG) != "fucntion") {
	var SYSTEM_SHOW_MODAL_DIALOG = null;
	if (!!!window._isNotFirstInit) {
		window._isNotFirstInit = true;
		//绯荤粺妯℃�佺獥鍙�
		SYSTEM_SHOW_MODAL_DIALOG = window.showModalDialog;
		//chrome37+
		if (!systemshowModalDialog && !!!SYSTEM_SHOW_MODAL_DIALOG) {
			systemshowModalDialog = true;
			window._systemshowModalDialog = true;
		}
	}
	
	if (window.showModalDialog == SYSTEM_SHOW_MODAL_DIALOG) {
		//閲嶅啓绯荤粺妯℃�佺獥鍙�
		window.showModalDialog = function () {
			var url	= arguments[0];
			var parent = arguments[1];
			var dialogParent = arguments[2];
			var dialogWidth = 560;
			if(url.indexOf("MutiResourceBrowser")>-1) dialogWidth = 674;

			if (!parent) {
				parent = "";
			}
			
			//ff涓嬬獥鍙d笉鍓т腑闂缁熶竴澶勭悊
			if (!systemshowModalDialog) {
				if (!dialogParent) {
					dialogParent = "dialogWidth:"+dialogWidth+"px;dialogHeight:600px;" + "dialogTop:" + (window.screen.availHeight - 30 - parseInt(600))/2 + "px" + ";dialogLeft:" + (window.screen.availWidth - 10 - parseInt(dialogWidth))/2 + "px" + ";";
				} else if (dialogParent != "" && dialogParent.indexOf("dialogTop") == -1) {
					dialogParent += ";dialogTop:" + (window.screen.availHeight - 30 - parseInt(dialogWidth))/2 + "px" + ";dialogLeft:" + (window.screen.availWidth - 10 - parseInt(dialogWidth))/2 + "px" + ";";
				}
			}
			//alert(systemshowModalDialog);
			//alert(window.showModalDialog.caller);
			//alert(systemshowModalDialog);
			//鍙湁chrome37+鎵嶅鐞�
			if (systemshowModalDialog) {
				//鎵撳紑褰撳墠绐楀彛鐨勫悓鏃讹紝鍏抽棴鍏朵粬寮瑰嚭绐楀彛锛屽苟閲嶇疆鍙傛暟
				if(childWindow){   
			         childWindow.close(); 
			         childWindow = undefined;
			         resetDialog();
			    }
				dialogcaller = window.showModalDialog.caller;
				//澶勭悊瀛楁鑱斿姩
				if (!!dialogcaller && !!dialogcaller.caller ) {
					if (dialogcaller.caller.toString().indexOf("datainput(") != -1) {
						datainputCaller = dialogcaller.caller;
					}
					if (dialogcaller.caller.toString().indexOf("datainputd(") != -1) {
						datainputCaller = dialogcaller.caller;
					}
					
					othcaller = dialogcaller.caller;
					//alert(getFuncName(dialogcaller));
					/*
					if (getFuncName(dialogcaller.caller.toString()).indexOf("datainput(") != -1) {
					
					}
					*/
				}
				
				//alert(dialogcaller.caller);
				if (dialogcaller) {
					dialogcallerArguments = dialogcaller.arguments;
				}
				//alert(dialogcaller.arguments);
				//var dialog = window.open(url);
				childWindow = window.open(url, "", "width="+dialogWidth+"px,height=600px,ecologysetting=no,resizable=no,scroll=no,status=no,top=" + (window.screen.availHeight - 30 - parseInt(600))/2 + ",left=" + (window.screen.availWidth - 10 - parseInt(dialogWidth))/2);   
//  				window.childWindow.focus();  
				//timeoutDialog(dialog);
				//setTimeout(function () );
				return ;
			}
			
			var returnValue2;
			//璋冪敤绯荤粺妯℃�佺獥鍙e脊鍑篺unction
			var rtnValue = SYSTEM_SHOW_MODAL_DIALOG(url, parent, dialogParent); 
			//ie涓嬪鏋滆皟鐢ㄧ殑鏄痡s锛岃�岃繑鍥炲�兼槸vb鍒欒浆鎹㈡垚json
			if (window.ActiveXObject) {
				//杩斿洖鍊兼槸vb
				if (rtnValue != undefined && rtnValue != null && typeof(rtnValue) == "unknown") {
					var func = window.showModalDialog.caller;
					//鍒ゆ柇璋冪敤妯℃�佺獥鍙h�呮槸鍚︽槸js
					if (typeof(func) == "function") {
						var tempArray = new VBArray(rtnValue).toArray();
						var tempJsonData = "{";
						if (tempArray != null) {
							for (var i=0; i<tempArray.length; i++) {
								if (i == 0) {
									tempJsonData += "id:\"" + tempArray[i] + "\"";
								} else if (i == 1) {
									tempJsonData += "name:\"" + tempArray[i] + "\"";
								} else {
									tempJsonData += "key" + i + ":\"" + tempArray[i] + "\"";
								}
								
								if (i < tempArray.length - 1) {
									tempJsonData += ", ";
								}
							}
						}
						tempJsonData += "}";
						
						returnValue2 =  eval('(' + tempJsonData + ')');
						return returnValue2;
					}
				} else if (typeof(rtnValue) == "object"){
					//alert(window.showModalDialog.caller.caller);
					var func = window.showModalDialog.caller;
					try {
						window.console.log("href:" + window.location.href);
						window.console.log("caller type:" + typeof(func));
						window.console.log("caller content:" + func);
					} catch (e) {}
					//鍒ゆ柇璋冪敤妯℃�佺獥鍙h�呮槸鍚︽槸vb
					if ((typeof(func) == "function" && func.toString().indexOf("function onclick()") != -1) || typeof(func) == "object") {
						return string2VbArray(json2String(rtnValue));
					} else {
						var	regex = new RegExp("jsid[ ]{0,}=[ ]{0,}new VBArray[\(]id[\)].toArray[\(][\)]", "g"); // 鍒涘缓姝e垯琛ㄨ揪寮忓璞°��  
						var r = func.toString().match(regex);
						if (r != null && r != undefined && r != "") {
						 	return string2VbArray(json2String(rtnValue));
					 	}
					}
				}
			}
			return rtnValue;
		};
	}
}


function json2String(josinobj) {
	if (josinobj == undefined || josinobj == null) {
		return "";
	}
	var ary = "";
	var _index = 0;
	try {
		for(var key in josinobj){
			if (_index++ > 0) {
				if (!!key && key.indexOf(",") == 0) {
					key = key.substr(1);
				}
				
				ary += "(~!@#$%^&*)";
			}
			var jsonval = josinobj[key] ;
			if (!!jsonval && jsonval.indexOf(",") == 0) {
				jsonval = jsonval.substr(1);
			}
			ary += jsonval;
		}
	} catch (e) {}
	return ary;
}

function e8showAjaxTips(context,soh,e8class){
	var tips = jQuery("#e8showAjaxTip");
	if(!e8class){
		e8class = "e8showAjaxTip";
	}
	if(tips.length==0){
		tips = jQuery("<div id='e8showAjaxTip' style='font-size:12px;' class='"+e8class+"'></div>");
		jQuery("body").append(tips);
	}
	tips.html(context);
	if(soh){
		tips.show();
		tips.css({
			"left":jQuery(window).width()/2-tips.width()+30,
			"top":jQuery(window).height()/2-20
		});
	}else{
		tips.hide();
	}
}

function e8PageLoading(){
	var tips = jQuery("#e8PageLoading");
	if(tips.length==0){
		tips = jQuery("<div id='e8PageLoading' class='e8PageLoading'></div>");
		jQuery("body").append(tips);
	}
	tips.html(context);
	tips.css({
		"left":jQuery(window).width()/2-50,
		"top":jQuery(window).height()/2-20
	});
}


function getLoadingDiv(){
	var languageid = readCookie("languageidweaver");
	var txt = SystemEnv.getHtmlNoteName(3417,languageid);
	/*if(languageid==8){
		txt = "Searching, please wait ...";
	}else if(languageid==9){
		txt = "姝e湪鏌ヨ锛岃珛绋嶅��...";
	}else{
		txt = "姝e湪鏌ヨ锛岃绋嶅��...";
	}*/
	return jQuery("<div style=\"display:none;\" id=\"e8_loading\" class=\"e8_loading\">"+txt+"</div>");
}

function getTreeSwitch(){
	var languageid = readCookie("languageidweaver");
	jQuery("<div style=\"display:none;\" id=\"e8TreeSwitch\" class=\"e8_expandOrCollapseDiv\"></div>")
}


jQuery(document).ready(function(){
	setInnerStyle("#deeptree",{overflow:"hidden"});
	var mainIframe = jQuery("#mainFrame",parent.document);
	if(mainIframe.length>0 && jQuery("#flowFrame").length>0){
		jQuery(document.body).css("overflow","hidden");
	}
    //闃叉娴忚妗嗗彉褰�
    jQuery(".AddDocFlowHidden").each(function(){
       if(this.type=="button" && jQuery(this).parent().attr("class").indexOf("e8_browserSpan") >= 0 ){
          jQuery(this).parent().css("display","block");
          jQuery(this).parent().css("width","21px");
       }
    });
});

function setInnerStyle(id,styles){
	jQuery(id).css(styles);
}


function isIE11(){
	if (jQuery.browser.mozilla && jQuery.browser.version == '11.0') {
		return true;
	}else{
		return false;
	}
}

//-----------------------------------------
//閫夋嫨妗嗙敤杞崲绋嬪簭 END
//-----------------------------------------


/**
*娓呯┖鎼滅储鏉′欢
*/
function resetCondtion(selector){
	resetCondition(selector);
}

function resetCondition(selector){
	if(!selector)selector="#advancedSearchDiv";
	//娓呯┖鏂囨湰妗�
	jQuery(selector).find("input[type='text']").val("");
	//娓呯┖娴忚鎸夐挳鍙婂搴旈殣钘忓煙
	jQuery(selector).find(".e8_os").find("span.e8_showNameClass").remove();
	jQuery(selector).find(".e8_os").find("input[type='hidden']").val("");
	//娓呯┖涓嬫媺妗�
	try{
		jQuery(selector).find("select").selectbox("reset");
	}catch(e){
		jQuery(selector).find("select").each(function(){
			var $target = jQuery(this);
			var _defaultValue = $target.attr("_defaultValue");
			if(!_defaultValue){
				var option = $target.find("option:first");
				_defaultValue = option.attr("value");
			}
			$target.val(_defaultValue).trigger("change");
		});
	}
	//娓呯┖鏃ユ湡
	jQuery(selector).find(".calendar").siblings("span").html("");
	jQuery(selector).find(".calendar").siblings("input[type='hidden']").val("");
	
	jQuery(selector).find(".Calendar").siblings("span").html("");
	jQuery(selector).find(".Calendar").siblings("input[type='hidden']").val("");
	
	jQuery(selector).find("input[type='checkbox']").each(function(){
		try{
			changeCheckboxStatus(this,false);
		}catch(e){
			this.checked = false;
		}
	});
}

function resizeDialog(_document){
	if(!_document)_document = document;
	
	var zDialog_div_bottom = jQuery(".zDialog_div_bottom:first");
	var zDialog_div_content = jQuery(".zDialog_div_content:first");
	var bottomheight = zDialog_div_bottom.height();
	var paddingBottom = zDialog_div_bottom.css("padding-bottom");
	var paddingTop = zDialog_div_bottom.css("padding-top");
	var headHeight = 0;
	var e8Box = zDialog_div_content.closest(".e8_box");
	if(e8Box.length>0){
		headHeight = e8Box.children(".e8_boxhead").height();
	}
	if(!!paddingBottom && paddingBottom.indexOf("px")>0){
		paddingBottom = paddingBottom.substring(0,paddingBottom.indexOf("px"));
	}
	if(!!paddingTop && paddingTop.indexOf("px")>0){
		paddingTop = paddingTop.substring(0,paddingTop.indexOf("px"));
	}
	if(isNaN(paddingBottom)){
		paddingBottom = 0;
	}else{
		paddingBottom = parseInt(paddingBottom);
	}
	if(isNaN(paddingTop)){
		paddingTop = 0;
	}else{
		paddingTop = parseInt(paddingTop);
	}
	window.setTimeout(function(){
		var bodyheight = jQuery(window).height();//_document.body.offsetHeight;
		if(document.documentMode!=5){
			zDialog_div_content.css("height",bodyheight-bottomheight-paddingTop-headHeight-7);
		}else{
			zDialog_div_content.css("height",bodyheight-bottomheight-paddingBottom-paddingTop-headHeight-7);
		}
	},10);
}

/**
 * 浣垮繀濉瓧娈佃幏鍙栫劍鐐�
 */
function formElementFocus(formelename) {
	try {
		if (formelename.name == 'remarkText10404') {
			//initRemark2();
			if(typeof autoscroll4remark === "function"){	//寮曞叆WorkflwoSignInput.jsp鎯呭喌
				initRemark(true);
				autoscroll4remark();
			}else{		//绛惧瓧鎰忚杈撳叆妗嗗湪妯℃澘鍐�
				try{
					var remarkscrolltop = jQuery("#remark").offset().top;
					jQuery(document.body).animate({scrollTop : remarkscrolltop + "px"}, 500);
				}catch(e){}
			}
			if (window._isremarkcomp != false) {
			    var _ue = UE.getEditor('remark')
				_ue.focus(true);
				if (!!window.UEDITOR_CONFIG && !isNaN(window.UEDITOR_CONFIG.remarkfontsize)) {
                    _ue.execCommand('fontsize', window.UEDITOR_CONFIG.remarkfontsize + "px");
                }
                
                if (!!window.UEDITOR_CONFIG && !!window.UEDITOR_CONFIG.remarkfontsize) {
                    _ue.execCommand('fontfamily', window.UEDITOR_CONFIG.remarkfontfamily );
                }
			}
			return;
		}

		if (formelename.type == 'textarea') {
			if (!jQuery(formelename).is(":visible") && jQuery(formelename).attr("temptype") == '2') {
				UE.getEditor(formelename.name).focus(true);
			} else {
				formelename.select();
			}
			return;
		}
		
		formelename.focus();
		if (formelename.type == 'hidden' && !!document.getElementById("out" + formelename.name + "div")) {
			jQuery(document.getElementById("out" + formelename.name + "div")).trigger("click");
			return;
		}
	} catch (e) {}
}

function checkueditorContent(formelename) {
	var _result = false;
	if (formelename.type == 'textarea') {
		if (!jQuery(formelename).is(":visible") && jQuery("#" + formelename.name).is("div")) {
			var _html = UE.getEditor(formelename.name).getContent()
			if (_html.indexOf("<img ") != -1) {
				_result = true;
			}
		} 
	}
	return _result; 
}

function __initQueryResultAreaHeight(searchAreaId,resultAreaId){
	window.setTimeout(function(){
		var searchAreaHeight = jQuery(searchAreaId).height();
		var contentHeight = jQuery("div.zDialog_div_content").height();
		var height = contentHeight - searchAreaHeight - 2;
		jQuery(resultAreaId).height(height).css("overflow","auto");
	},300);
}

/*鏄剧ず鍒楀畾鍒剁粍浠�--->/js/dragBox/parentShowcol.js*/

function showColDialog(){
   	dialog = new top.Dialog();
   	dialog.currentWindow = window;
   	dialog.okLabel = SystemEnv.getHtmlNoteName(3515,readCookie("languageidweaver"));
   	dialog.cancelLabel = SystemEnv.getHtmlNoteName(3516,readCookie("languageidweaver"));
   	dialog.Drag = true;
   	dialog.Title = SystemEnv.getHtmlNoteName(3517,readCookie("languageidweaver"));
   	dialog.Width = 600;
   	dialog.Height = 400;
    if(jQuery("#pageId",window.document).val()=="Hrm:resourceSearchResultByManager"){
   		dialog.URL = "/hrm/HrmTab.jsp?_fromURL=hrmShowCol";
   		dialog.Width = 800;
   		dialog.Height = 600;
   	}else{
   		dialog.URL = "/showCol.jsp";
   	}
	dialog.show();
}

var ieVersion = 6;//ie鐗堟湰

jQuery(document).ready(function(){
	// 璁剧疆jQuery Ajax鍏ㄥ眬鐨勫弬鏁�
	jQuery.ajaxSetup({  
        error: function(jqXHR, textStatus, errorThrown){  
            switch (jqXHR.status){
                case(499):
                	alert(SystemEnv.getHtmlNoteName(3544,readCookie("languageidweaver")));   
            }
        },   
        success: function(data){  
            if(data.__result__===false){
            	alert(data.__msg__);
            }
        }  
    });  

	jQuery(".addbtn").hover(function(){
		jQuery(this).addClass("addbtn2");
	},function(){
		jQuery(this).removeClass("addbtn2");
	});
	
	jQuery(".sapbtn").hover(function(){
		jQuery(this).addClass("sapbtn2");
	},function(){
		jQuery(this).removeClass("sapbtn2");
	});
	
	jQuery(".addbtnB").hover(function(){
		jQuery(this).addClass("addbtnB2");
	},function(){
		jQuery(this).removeClass("addbtnB2");
	});
	
	jQuery(".delbtn").hover(function(){
		jQuery(this).addClass("delbtn2");
	},function(){
		jQuery(this).removeClass("delbtn2");
	});
	
	jQuery(".downloadbtn").hover(function(){
		jQuery(this).addClass("downloadbtn2");
	},function(){
		jQuery(this).removeClass("downloadbtn2");
	});
	var isNewPlugisSelect = jQuery("#isNewPlugisSelect");
	if(isNewPlugisSelect.length>0&&isNewPlugisSelect.val()!="1"){
		// do nothing
	}else{
		try{
			beautySelect();
		}catch(e){}
	}
	try{
		jQuery("input[type=checkbox]").each(function(){
			if(jQuery(this).attr("tzCheckbox")=="true"){
				jQuery(this).tzCheckbox({labels:['','']});
			}
		});
	}catch(e){}
	
	jQuery(window).resize(function(){
		resizeDialog();
	});
	
		window.setTimeout(function(){
			try{
				if(!jQuery("#e8QuerySearchArea").data("hasBeenCal")){
					jQuery("div#e8QuerySearchArea").css("max-height","160px").perfectScrollbar({horizrailenabled:false,zindex:0});
			       	jQuery("div#e8QuerySearchArea").find(".e8_innerShowContent").resize(function(e){
			       		jQuery("div#e8QuerySearchArea").perfectScrollbar("update");
			       	});
			 	}
			 }catch(e){}
		},300);
	
	
});



jQuery(document).ready(function(){
 
	jQuery(".wea-hrm-new-employee-set").click(function(){
		var  hrmid  = jQuery(this).attr("id");
		window.location.href='/hrm/employee/EmployeeManage.jsp?hrmid='+hrmid ; 
	});
	
});