function imgAuto(img,maxW,maxH){var oriImg=document.createElement("img");oriImg.onload=function(){if(oriImg.width==0||oriImg.height==0)return;var oriW$H=oriImg.width/oriImg.height;if(oriImg.height>maxH){img.height=maxH;img.width=maxH*oriW$H;};if(img.width>maxW){img.width=maxW;img.height=maxW/oriW$H;};if(maxH){if(img.height>0)img.style.marginTop=(maxH-img.height)/2+"px";};if(maxW){if(img.width>0)img.style.marginLeft=(maxW-img.width)/2+"px";}};oriImg.src=img.src;};function errorImage(obj,url){if(url==null||url==""){obj.src="/images/noimage.jpg";}else{obj.onerror=function(){obj.src="/images/noimage.jpg";};obj.src=url;}};function parseParams(src){var paramMap={};if(src==null||src=="")return paramMap;var params=src.split("&");for(var i=0;i<params.length;++i){var tmp=params[i].split("=");if(!paramMap[tmp[0]]){paramMap[tmp[0]]=[];};if(tmp.length==2)paramMap[tmp[0]].push(tmp[1]);};return paramMap;};function paramsMapToURL(paramMap){var v=[];for(var name in paramMap){if(paramMap[name].length>0){for(var i=0;i<paramMap[name].length;++i){v.push(name+"="+paramMap[name][i]);}}else{v.push(name);}};return v.join("&");};function limitStringInByte(str,len){if(!str||len<1){return "";};var v="";for(var i=0;i<str.length;++i){v+=str.charAt(i);--len;if(str.charCodeAt(i)>128){--len;};if(len<=0){break;}};return v;};function upimage(){var adjustImg=function(dst,ori){if(ori.width==0||ori.height==0)return;var oriW$H=ori.width/ori.height;var maxH=dst.height,maxW=dst.width;dst.removeAttribute("width");dst.removeAttribute("height");var changed=false;if(ori.height>maxH){changed=true;dst.height=maxH;dst.width=maxH*oriW$H;if(dst.width>maxW){dst.width=maxW;dst.height=maxW/oriW$H;}}else if(ori.width>maxW){changed=true;dst.width=maxW;dst.height=maxW/oriW$H;if(dst.height>maxH){dst.height=maxH;dst.width=maxH*oriW$H;}};if(dst.height>0){dst.style.marginTop=(maxH-(changed?dst:ori).height)/2+"px";}};var tmpImgSrc=window.ContextPath+"/images/sc_31.jpg";jQuery("img[orisrc]").each(function(){var img=this;var errsrc=img.getAttribute("errsrc");img.src=errsrc||tmpImgSrc;var oriSrc=img.getAttribute("orisrc");var serverSrc=oriSrc;var tryImg=document.createElement("img");tryImg.onload=function(){adjustImg(img,tryImg);img.src=serverSrc;};tryImg.onerror=function(){var oriImg=document.createElement("img");oriImg.onload=function(){adjustImg(img,oriImg);img.src=oriSrc;};oriImg.src=oriSrc;};tryImg.src=serverSrc;});};function _getURI(){var href=location.href;var domain=window.document.domain;var s=href.replace("http://"+domain+"/","");if(s.indexOf("?")>=0){s=s.substring(0,s.indexOf("?"));};if(s.indexOf("&")>=0){s=s.substring(0,s.indexOf("&"));};return s;};function getBrowerEncoding(){if(navigator.userAgent.indexOf('Opera')>=0||navigator.userAgent.indexOf('Firefox')>=0){return "gbk";}else{return "utf-8";}};function _getUrlValue(qs){var s=location.href;s=s.replace("?","?&").split("&");var re="";for(i=0;i<s.length;i++){if(s[i].indexOf(qs+"=")==0){re=s[i].replace(qs+"=","");break;}};return re;}


