123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- // JavaScript Document
- //Cookie
- function SetCookie(name,value)//两个参数,一个是cookie的名子,一个是值
- {
- var Days = 0; //此 cookie 将被保存 30 天
- var exp = new Date(); //new Date("December 31, 9998");
- exp.setTime(exp.getTime() + Days*24*60*60*1000);
- document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString() + ";"
- }
- function getCookie(name)//取cookies函数
- {
- var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
- if(arr != null)
- return unescape(arr[2]);
- else
- return 1;
- }
- //correctPNG
- function correctPNG()
- {
- for(var i=0; i<document.images.length; i++)
- {
- var img = document.images[i];
- var imgName = img.src.toUpperCase();
- if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
- {
- var imgID = (img.id) ? "id='" + img.id + "' " : "";
- var imgClass = (img.className) ? "class='" + img.className + "' " : "";
- var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
- var imgStyle = "display:inline-block;" + img.style.cssText;
- if (img.align == "left") imgStyle = "float:left;" + imgStyle;
- if (img.align == "right") imgStyle = "float:right;" + imgStyle;
- if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
- var strNewHTML = "<span " + imgID + imgClass + imgTitle
- + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
- + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
- + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
- img.outerHTML = strNewHTML;
- i = i-1;
- }
- }
- }
- function alphaBackgrounds(){
- var rslt = navigator.appVersion.match(/MSIE (d+.d+)/, '');
- var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
- for (i=0; i<document.all.length; i++){
- var bg = document.all[i].currentStyle.backgroundImage;
- if (bg){
- if (bg.match(/.*\.png.*/i) != null){
- var mypng = bg.substring(5,bg.length-2);
- document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='scale')";
- document.all[i].style.backgroundImage = "url('')";
- }
- }
- }
- }
- if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
- window.attachEvent("onload", correctPNG);
- window.attachEvent("onload", alphaBackgrounds);
- }
- function CheckItem(CB){
- var tagname=(arguments.length>1)?arguments[1]:'TR';
- if(document.myform.chkAll.checked){
- document.myform.chkAll.checked = document.myform.chkAll.checked&0;
- }
- if (CB.checked){hL(CB,tagname)};else{dL(CB,tagname)};
- var TB=TO=0;
- for (var i=0;i<myform.elements.length;i++) {
- var e=myform.elements[i];
- if ((e.name != 'chkAll') && (e.type=='checkbox')) {
- TB++;
- if (e.checked) TO++;
- }
- }
- myform.chkAll.checked=(TO==TB)?true:false;
- }
- function CheckAll(form){
- var tagname=(arguments.length>1)?arguments[1]:'TR';
- for (var i=0;i<form.elements.length;i++){
- var e = form.elements[i];
- if (e.name != 'chkAll' && e.disabled == false && e.type == 'checkbox') {
- e.checked = form.chkAll.checked;
- if (e.checked){hL(e,tagname)};else{dL(e,tagname)};
- }
- }
- }
- function hL(E,tagname){
- while (E.tagName!=tagname) {E=E.parentElement;}
- }
- function dL(E,tagname){
- while (E.tagName!=tagname) {E=E.parentElement;}
- }
- function Del(){
- if(document.myform.Action.value=='ConfirmDel'){
- if(confirm('确定要删除选中的区域吗?删除后将不能恢复!'))
- return true;
- else
- return false;
- }
- }
|