//去左空格; function ltrim(s){ return s.replace(/^\s*/, ""); } //去右空格; function rtrim(s){ return s.replace(/\s*$/, ""); } //去左右空格; function trim(s) { return rtrim(ltrim(s)); } function isBlank(ele) //不能为空 { if(trim(ele.value)=="") { alert(ele.estr); ele.focus(); return false; } } function isNum(ele) //必须是数字 { if(trim(ele.value)=="" || true==isNaN(ele.value)) { alert(ele.estr); ele.focus(); return false; } } function chePwd(ele,pwd) //必须是数字 { if(trim(ele.value)!=pwd) { alert(ele.estr); ele.focus(); return false; } } function isEmail(ele) //邮箱 { var filter=/^\s*([A-Za-z0-9_-]+(\.\w+)*@(\w+\.)+\w{2,3})\s*$/; if (!filter.test(ele.value)) { alert(ele.estr); ele.focus(); return false; } } function isTime(ele) //时间 { var filter=/^(d+)-(d{1,2})-(d{1,2}) (d{1,2}):(d{1,2}):(d{1,2})$/; if (!filter.test(ele.value)) { alert(ele.estr); ele.focus(); return false; } } //检测Form提交 function cheFor(object) { var i,pwd; a=object.elements; for (i=0;i0 && image.height>0){ if(image.width/image.height>= w/h){ if(image.width>w){ ImgD.width=w; ImgD.height=(image.height*w)/image.width; } else{ ImgD.width=image.width; ImgD.height=image.height; } //ImgD.alt= "点击查看"+image.width+"x"+image.height+"原始图片..."; } else{ if(image.height>h){ ImgD.height=h; ImgD.width=(image.width*h)/image.height; } else{ ImgD.width=image.width; ImgD.height=image.height; } //ImgD.alt= "点击查看"+image.width+"x"+image.height+"原始图片..."; } } } function insertUpload(msg) { msg=msg[0]; var tpics=document.getElementById("tpics"); if(tpics.value!="") tpics.value=tpics.value+"|"+msg.url; else tpics.value=msg.url; } function get_radio_value() { var radio_array=document.getElementsByName("Id"); var i; strR=""; for (i = 0; i < radio_array . length; ++ i) if (radio_array[i].checked) { if(strR=="") strR=radio_array[i].value else strR=strR+","+radio_array[i].value } return strR; } function movePro(f_pageno,f_ClassId) { blnDel = true cheName="ID"; for (var i=0;i0 && image.height>0){ if(image.width/image.height>= iwidth/iheight){ if(image.width>iwidth){ ImgD.width=iwidth; ImgD.height=(image.height*iwidth)/image.width; }else{ ImgD.width=image.width; ImgD.height=image.height; } }else{ if(image.height>iheight){ ImgD.height=iheight; ImgD.width=(image.width*iheight)/image.height; }else{ ImgD.width=image.width; ImgD.height=image.height; } } } }