// UTF-8 common.js ☭
function arrunique(arr){var i=arr.length-1;for(var a={};i>-1;i--){if(typeof(a[arr[i]])=="undefined")a[arr[i]]=1}arr.length=0;for(var i in a){arr[arr.length]=i}return arr};String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,'')};function isArray(o){return Object.prototype.toString.call(o)==='[object Array]'}function dlg_add_init(opt){var sts={d_id:'',autoOpen:false,bgiframe:true,dialogClass:'',minHeight:180,minWidth:200,position:'center',width:280,modal:true};$.extend(sts,opt);$('#'+sts.d_id).dialog(sts)}function close_dlg(src){$(src).dialog('close')}function my_jsonajax(opt){var sts={url:'',data:{},type:'POST',dataType:'json',processData:true,async:true,cache:false,global:true,ifModified:false,beforeSend:null,succ:function(r,e){return true},complete:null,err:function(r,e){return true},succAlert:false,failAlert:true,reload:false,input_id:null,reset_id:null,loading_img:'loading_img',dlg_id:null,dlgFun:function(r){if(sts.dlg_id){$('#'+sts.dlg_id).dialog('close')}}};$.extend(sts,opt);$.ajax({type:sts.type,url:sts.url,cache:sts.cache,data:sts.data,async:sts.async,global:sts.global,ifModified:sts.ifModified,dataType:sts.dataType,beforeSend:function(){if(typeof sts.beforeSend=='function'){sts.beforeSend()}if(sts.loading_img){$('#'+sts.loading_img).show()}},success:function(r,e){if(sts.loading_img){$('#'+sts.loading_img).hide()}if(r.state>5){sts.succ(r,e);if(true==sts.succAlert&&r.msg){alert(r.msg)}if(sts.dlg_id){sts.dlgFun(r)}if(true==sts.reload){location.reload()}else if(sts.reset_id){$('#'+sts.reset_id).click()}}else{sts.err(r,e);if(sts.reset_id){$('#'+sts.reset_id).click()}if(true==sts.failAlert&&r.msg){alert(r.msg)}if(sts.input_id){$('#'+sts.input_id).focus().select()}}},complete:function(r,e){if(typeof sts.complete=='function'){sts.complete(r,e)}r=null},error:function(xhr,e){if(sts.loading_img){$('#'+sts.loading_img).hide()}var str=!e?'':e;alert('Ajax传输错误: '+str)}})}function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString()}else{var expires=""}document.cookie=name+"="+value+expires+"; path=/"}function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');var len=ca.length;for(var i=0;i<len;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1,c.length)}if(c.indexOf(nameEQ)==0){return c.substring(nameEQ.length,c.length)}}return null}function eraseCookie(name){createCookie(name,"",-1)}function input_formatter(src){$('#'+src+' td:nth-child(2)').find('input:first').each(function(){this.value=this.value.trim()})}function hashpwd(p,s){if(!s){return hex_sha1(p+'!@#$%^&*'+p)}else{return hex_hmac_sha1(s,p)}}function goTo(url){var a=document.createElement("a");if(!a.click){window.location=url;return}a.setAttribute("href",url);a.style.display="none";document.body.appendChild(a);a.click()}(function($){$.fn.syncload=function(url,params,callback){if(typeof url!=="string"){return url}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null}else if(typeof params==="object"){params=jQuery.param(params);type="POST"}}var self=this;jQuery.ajax({async:false,url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText).find(selector):res.responseText)}if(callback){self.each(callback,[res.responseText,status,res])}}});return this}})(jQuery);function do_rsaencrypt(p){var rsa=new RSAKey();var m='B4F914283B4E87329D26BD88805EBB96833E4D4EC9D006003564C1BC5242E762BD54BDA39E4415378DACFED437C1BBA23123864F137B2A731D5D707FE1CDAC477506010A00705216F2005B0D7E46431A5D5031E79CE515FF8FF07EAB70BB35E55787A88C42C5A8494B19EF1EE5FC5C909AC6D6E22F2D9E1AEBFCB6C80AB4623B';rsa.setPublic(m,'10001');return hex2b64(rsa.encrypt(p))}function fEvent(sType,oInput){switch(sType){case"focus":oInput.isfocus=true;oInput.style.borderColor='#A7A9A0';case"mouseover":oInput.style.borderColor='#99E300';break;case"click":oInput.style.backgroundColor='#FFFFDB';break;case"blur":oInput.isfocus=false;oInput.style.borderColor='#ccc';oInput.style.backgroundColor='#ffffff';case"mouseout":if(!oInput.isfocus){oInput.style.borderColor='#ccc'}break}};

