1/* 2Powered by ly200.com http://www.ly200.com 3广å·èé ç½ç»ç§ææéå ¬å¸ 020-83226791 4*/ 5 6var global_obj={ 7 timer:'', 8 check_form:function(notnull_obj, format_obj, type, is_new){ 9 var flag=false, 10 is_new=(typeof(arguments[3])=='undefined')?0:1; 11 if(notnull_obj){ 12 notnull_obj.each(function(){ 13 var $lang = $(this).parents('.tab_txt').attr('lang'); //åå°è¯è¨ç 14 if(!$(this).find('input').length && $.trim($(this).val())==''){ 15 if($lang){ //åå°è¯è¨ç 16 $(this).parents('.rows').find('.tab_box_btn[data-lang='+$lang+']').addClass('empty'); 17 } 18 if($(this).attr('parent_null')){ //æç¤ºå¨ç¶çº§ 19 $(this).parents('[parent_null]').css('border', '1px solid red').addClass('null'); 20 }else{ 21 $(this).css('border', '1px solid red').addClass('null'); 22 } 23 flag==false && ($(this).focus()); 24 flag=true; 25 }else{ 26 $(this).parents('.rows').find('.tab_box_btn[data-lang='+$lang+']').removeClass('empty'); 27 if($(this).attr('parent_null')){ //æç¤ºå¨ç¶çº§ 28 $(this).parents('[parent_null]').removeAttr('style').removeClass('null'); 29 }else{ 30 $(this).removeAttr('style').removeClass('null'); 31 } 32 } 33 }); 34 //åå°è¯è¨ç 35 $('.rows').find('.tab_box_row .tips').hide(); 36 $('.rows').find('.tab_box_row .tab_box_btn').each(function(){ 37 if($(this).hasClass('empty')){ 38 $(this).parents('.tab_box_row').find('.tips').show(); 39 } 40 }); 41 if(flag){return flag;}; 42 } 43 if(format_obj){ 44 var reg={ 45 'MobilePhone':/^1[34578]\d{9}$/, 46 'Telephone':/^(0\d{2,3})(-)?(\d{7,8})(-)?(\d{3,})?$/, 47 'Fax':/^(0\d{2,3})(-)?(\d{7,8})(-)?(\d{3,})?$/, 48 'Email':/^\w+[a-zA-Z0-9-.+_]+@[a-zA-Z0-9-.+_]+\.\w*$/, 49 'Length':/^.*/ 50 }; 51 var tips={ 52 'MobilePhone':lang_obj.format.mobilephone, 53 'Telephone':lang_obj.format.telephone, 54 'Fax':lang_obj.format.fax, 55 'Email':lang_obj.format.email, 56 'Length':lang_obj.format.length 57 }; 58 if(type==1){ 59 format_obj.each(function(){ 60 var o=$(this); 61 if($.trim(o.val())){ 62 if(reg[o.attr('format')].test($.trim(o.val()))===false){ 63 o.css('border', '1px solid red').addClass('null'); 64 o.focus(); 65 flag=true; 66 } 67 } 68 }); 69 }else{ 70 format_obj.each(function(){ 71 var o=$(this); 72 var s=o.attr('format').split('|'); 73 if(!$.trim(o.val())){ 74 flag=false; 75 }else if((s[0]=='Length' && $.trim(o.val()).length!=parseInt(s[1])) || (s[0]!='Length' && reg[s[0]].test($.trim(o.val()))===false)){ 76 if(is_new==1){ 77 global_obj.new_win_alert(tips[s[0]].replace('%num%', s[1])); 78 }else{ 79 global_obj.win_alert(tips[s[0]].replace('%num%', s[1]),'','sorry'); 80 } 81 o.css('border', '1px solid red').addClass('null'); 82 o.focus(); 83 flag=true; 84 return false; 85 } 86 }); 87 } 88 } 89 return flag; 90 }, 91 92 win_alert:function(tips, callback, type, is_pop){ 93 var type=(typeof(arguments[2])=='undefined')?'alert':arguments[2], 94 is_pop=(typeof(arguments[3])=='undefined')?0:1, 95 html; 96 $('#div_mask, .win_alert').remove();//ä¼å æ¸ ç©ºå¤ä½çå¼¹åºæ¡ 97 global_obj.div_mask(); 98 html='<div class="win_alert">'; 99 html+='<div class="win_close"><button class="close">X</button></div>'; 100 if(type=='password'){ 101 html+='<div class="win_pwd clean"><div class="pwd_name fl">'+lang_obj.signIn.password+':</div><div class="fl pwd_r"><input name="Password" value="" type="password" autocomplete="off" class="pwd_text"><div class="error_tips"></div></div></div>'; 102 }else if(type=='sorry'){ 103 html+='<div class="win_top_tips">'+lang_obj.global.sorry+'</div>'; 104 html+='<div class="win_tips">'+tips+'</div>'; 105 }else{ 106 html+='<div class="win_tips">'+tips+'</div>'; 107 } 108 html+='<div class="win_btns"><button class="btn btn_sure">'+lang_obj.global.confirm+'</button>'; 109 if(type=='confirm' || type=='password') html+='<button class="btn btn_cancel">'+lang_obj.global.cancel+'</button>'; 110 html+='</div>'; 111 html+='</div>'; 112 $('body').prepend(html); 113 $('.win_alert').css({left:$(window).width()/2-$('.win_alert').outerWidth()/2,top:'30%'}); 114 if(type=='confirm'){ 115 $('.win_alert').delegate('.close, .btn_cancel', 'click', function(){ 116 $('.win_alert').remove(); 117 is_pop==0 && global_obj.div_mask(1); 118 }).delegate('.btn_sure', 'click', function(){ 119 $.isFunction(callback) && callback(); 120 $('.win_alert .close').click(); 121 }); 122 /*$(document).keyup(function(event){ //EscãSpaceåæ¶æç¤ºï¼ç©ºæ ¼ãEnterç¡®å®æç¤º 123 if(event.keyCode==27 || event.keyCode==8){ 124 $('.win_alert .close').click(); 125 }else if(event.keyCode==32 || event.keyCode==13){ 126 $.isFunction(callback) && callback(); 127 $('.win_alert .close').click(); 128 } 129 });*/ 130 }else if(type=='password'){ 131 $('.win_alert').on('click', '.close, .btn_cancel', function(){ 132 $('.win_alert').remove(); 133 global_obj.div_mask(1); 134 }).on('click', '.btn_sure', function(){ 135 $.isFunction(callback) && callback(); 136 //$('.win_alert .close').click(); 137 }); 138 }else{ 139 $('.win_alert').delegate('.close, .btn_sure', 'click', function(){ 140 $.isFunction(callback) && callback(); 141 $('.win_alert').remove(); 142 is_pop==0 && global_obj.div_mask(1); 143 }); 144 /*$(document).keyup(function(event){ //EscãEnterãSpaceãç©ºæ ¼åæ¶æç¤º 145 if(event.keyCode==13 || event.keyCode==8 || event.keyCode==27 || event.keyCode==32) { 146 $('.win_alert .close').click(); 147 } 148 });*/ 149 } 150 return false;
151 }, 152 153 new_win_alert:function(tips, callback, type, is_pop, status, btn){ //status => await(å¹å·) fail(红å) 154 var type=(typeof(arguments[2])=='undefined')?'alert':arguments[2], 155 is_pop=(typeof(arguments[3])=='undefined')?0:1, 156 status=(typeof(arguments[4])=='undefined')?'await':arguments[4], 157 btn=(typeof(arguments[5])=='undefined')?lang_obj.global.confirm:arguments[5], 158 html; 159 $('#div_mask, .new_win_alert').remove();//ä¼å æ¸ ç©ºå¤ä½çå¼¹åºæ¡ 160 global_obj.div_mask(); 161 html='<div class="new_win_alert">'; 162 html+='<div class="win_close"><button class="close"></button></div>'; 163 html+='<div class="win_tips"><i class="icon_success_status '+status+'"></i>'+tips+'</div>'; 164 html+='<div class="win_btns">'; 165 if(type=='confirm') html+='<button class="btn btn_cancel">'+lang_obj.global.cancel+'</button>'; 166 html+='<button class="btn btn_sure">'+btn+'</button>'; 167 html+='<div class="clear"></div>'; 168 html+='</div>'; 169 html+='</div>'; 170 $('body').prepend(html); 171 $('.new_win_alert').css({left:$(window).width()/2-$('.new_win_alert').outerWidth()/2,top:'30%'}); 172 if(type=='confirm'){ 173 $('.new_win_alert').delegate('.close, .btn_cancel', 'click', function(){ 174 $('.new_win_alert').remove(); 175 is_pop==0 && global_obj.div_mask(1); 176 }).delegate('.btn_sure', 'click', function(){ 177 $.isFunction(callback) && callback(); 178 $('.new_win_alert .close').click(); 179 }); 180 /*$(document).keyup(function(event){ //EscãSpaceåæ¶æç¤ºï¼ç©ºæ ¼ãEnterç¡®å®æç¤º 181 if(event.keyCode==27 || event.keyCode==8){ 182 $('.new_win_alert .close').click(); 183 }else if(event.keyCode==32 || event.keyCode==13){ 184 $.isFunction(callback) && callback(); 185 $('.new_win_alert .close').click(); 186 } 187 });*/ 188 }else{ 189 $('.new_win_alert').delegate('.close, .btn_sure', 'click', function(){ 190 $.isFunction(callback) && callback(); 191 $('.new_win_alert').remove(); 192 is_pop==0 && global_obj.div_mask(1); 193 }); 194 /*$(document).keyup(function(event){ //EscãEnterãSpaceãç©ºæ ¼åæ¶æç¤º 195 if(event.keyCode==13 || event.keyCode==8 || event.keyCode==27 || event.keyCode==32) { 196 $('.win_alert .close').click(); 197 } 198 });*/ 199 } 200 return false; 201 }, 202 203 win_alert_auto_close:function(tips, status, time, pos_top, no_remove_mask){ //status => await(å¹å·) fail(红å) 204 var status=(typeof(arguments[1])=='undefined')?'await':arguments[1], 205 time=(typeof(arguments[2])=='undefined' || !arguments[2])?'2000':arguments[2], 206 pos_top=(typeof(arguments[3])=='undefined' || !arguments[3])?'40%':arguments[3], 207 no_remove_mask=(typeof(arguments[4])=='undefined')?1:arguments[4], 208 html=""; 209 if(no_remove_mask) $('#div_mask, .new_win_alert').remove();//ä¼å æ¸ ç©ºå¤ä½çå¼¹åºæ¡ 210 if(status!='loading' || (status=='loading' && time==-1)){ 211 //é¤äºloading Or åºå®æ¾ç¤ºloading 212 html+='<div class="new_win_alert win_alert_auto_close'+(status=='loading'?' win_alert_loading':'')+'">'; 213 html+= '<div class="win_tips"><i class="icon_success_status '+status+'"></i>'+tips+'</div>'; 214 html+='</div>'; 215 216 $('body').prepend(html); 217 $('.new_win_alert').css({left:$(window).width()/2-$('.new_win_alert').outerWidth()/2, top:pos_top}); 218 } 219 clearTimeout(global_obj.timer); 220 if(status!='loading' || (status=='loading' && time>=0)){ 221 //é¤äºloading Or 计æ¶èªå¨å ³éloading 222 global_obj.timer=setTimeout(function(){ 223 $('.new_win_alert').remove(); 224 }, time); 225 } 226 return false; 227 }, 228 229 div_mask:function(remove){ 230 if(remove==1){ 231 $('#div_mask').remove(); 232 }else{ 233 if(!$('#div_mask').size()){ 234 $('body').prepend('<div id="div_mask"></div>'); 235 $('#div_mask').css({width:'100%', height:$(document).height(), overflow:'hidden', position:'fixed', top:0, left:0, background:'#000', opacity:0.6, 'z-index':10000}); 236 } 237 } 238 }, 239 240 data_posting:function(display, tips){ 241 if(display){ 242 $('body').prepend('<div id="data_posting"><img src="../images/ico/data_posting.gif" width="16" height="16" align="absmiddle" />  '+tips+'</div>'); 243 $('#data_posting').css({ 244 width:'188px', 245 height:'24px', 246 'line-height':'24px', 247 padding:'0 8px', 248 overflow:'hidden', 249 border:'1px solid #bbb', 250 background:'#ddd', 251 position:'fixed', 252 top:'40%', 253 left:'48%', 254 'z-index':10001 255 }); 256 }else{ 257 setTimeout('$("#data_posting").remove();', 500); 258 } 259 }, 260 261 urlencode:function(str) { 262 str = (str + '').toString(); 263 return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+'); 264 }, 265 266 in_array:function(needle, arr){ 267 for(var i=0; i<arr.length && arr[i]!=needle; i++); 268 return !(i==arr.length); 269 }, 270 271 is_array:function(data){ 272 if(Object.prototype.toString.call(data) == '[object Array]'){ 273 return true; 274 }else{ 275 return false;
276 } 277 }, 278 279 setCookie:function(name, value, expiredays){ 280 var exdate=new Date(); 281 exdate.setDate(exdate.getDate()+expiredays); 282 alert(name+"="+escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString())); 283 document.cookie=name+"="+escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString()); 284 }, 285 286 getCookie:function(name){ 287 if(document.cookie.length>0){ 288 start=document.cookie.indexOf(name+"="); 289 if(start!=-1){ 290 start=start+(name.length+1); 291 end=document.cookie.indexOf(";", start); 292 if(end==-1) end=document.cookie.length; 293 return unescape(document.cookie.substring(start, end)); 294 } 295 } 296 return ""; 297 }, 298 299 delCookie:function(name, expiredays){ 300 var exdate=new Date(); 301 exdate.setDate(exdate.getDate()-1); 302 var value=global_obj.getCookie(name) 303 if(value){ 304 document.cookie=name+"="+escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString()); 305 } 306 } 307} 308 309//Object => string 310$.toJSON = typeof JSON == "object" && JSON.stringify ? JSON.stringify: function(e) { 311 if (e === null) return "null"; 312 var t, n, r, i, s = $.type(e); 313 if (s === "undefined") return undefined; 314 if (s === "number" || s === "boolean") return String(e); 315 if (s === "string") return $.quoteString(e); 316 if (typeof e.toJSON == "function") return $.toJSON(e.toJSON()); 317 if (s === "date") { 318 var o = e.getUTCMonth() + 1, 319 u = e.getUTCDate(), 320 a = e.getUTCFullYear(), 321 f = e.getUTCHours(), 322 l = e.getUTCMinutes(), 323 c = e.getUTCSeconds(), 324 h = e.getUTCMilliseconds(); 325 o < 10 && (o = "0" + o); 326 u < 10 && (u = "0" + u); 327 f < 10 && (f = "0" + f); 328 l < 10 && (l = "0" + l); 329 c < 10 && (c = "0" + c); 330 h < 100 && (h = "0" + h); 331 h < 10 && (h = "0" + h); 332 return '"' + a + "-" + o + "-" + u + "T" + f + ":" + l + ":" + c + "." + h + 'Z"' 333 } 334 t = []; 335 if ($.isArray(e)) { 336 for (n = 0; n < e.length; n++) t.push($.toJSON(e[n]) || "null"); 337 return "[" + t.join(",") + "]" 338 } 339 if (typeof e == "object") { 340 for (n in e) if (hasOwn.call(e, n)) { 341 s = typeof n; 342 if (s === "number") r = '"' + n + '"'; 343 else { 344 if (s !== "string") continue; 345 r = $.quoteString(n) 346 } 347 s = typeof e[n]; 348 if (s !== "function" && s !== "undefined") { 349 i = $.toJSON(e[n]); 350 t.push(r + ":" + i) 351 } 352 } 353 return "{" + t.join(",") + "}" 354 } 355}; 356 357//string => Object 358$.evalJSON = typeof JSON == "object" && JSON.parse ? JSON.parse: function(str) { 359 return eval("(" + str + ")") 360}; 361document.documentElement.addEventListener('touchstart', function (event) { 362 if (event.touches.length > 1) { 363 event.preventDefault(); 364 } 365}, false);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.