1// JavaScript Document 2var G_ = []; 3var wsf = {}; 4/** 5 ** ÓÃÀ´µÃµ½¾«È·µÄ¼Ó¡¢¼õ¡¢³Ë¡¢³ý½á¹û 6 ** ˵Ã÷£ºjavascriptµÄËÄÔòÔËËã½á¹û»áÓÐÎó²î£¬Õâ¸öº¯Êý·µ»Ø½ÏΪ¾«È·µÄ¼Ó·¨½á¹û¡£ 7 ** µ÷Ó㺼ӣºnCount.add(arg1,arg2), 8 * ¼õ£ºnCount.sub(arg1,arg2), 9 * ³Ë£ºnCount.mul(arg1,arg2), 10 * ³ý£ºnCount.div(arg1,arg2), 11 ** ·µ»ØÖµ£ºarg1ºÍarg2¼ÆËãºóµÄ¾«È·½á¹û 12 **/ 13 14var nCount = { 15 add : function(arg1,arg2){ 16 var r1, r2, m, c; 17 try { 18 r1 = arg1.toString().split(".")[1].length; 19 } 20 catch (e) { 21 r1 = 0; 22 } 23 try { 24 r2 = arg2.toString().split(".")[1].length; 25 } 26 catch (e) { 27 r2 = 0; 28 } 29 c = Math.abs(r1 - r2); 30 m = Math.pow(10, Math.max(r1, r2)); 31 if (c > 0) { 32 var cm = Math.pow(10, c); 33 if (r1 > r2) { 34 arg1 = Number(arg1.toString().replace(".", "")); 35 arg2 = Number(arg2.toString().replace(".", "")) * cm; 36 } else { 37 arg1 = Number(arg1.toString().replace(".", "")) * cm; 38 arg2 = Number(arg2.toString().replace(".", "")); 39 } 40 } else { 41 arg1 = Number(arg1.toString().replace(".", "")); 42 arg2 = Number(arg2.toString().replace(".", "")); 43 } 44 return (arg1 + arg2) / m; 45 }, 46 sub : function(arg1, arg2){ 47 var r1, r2, m, n; 48 try { 49 r1 = arg1.toString().split(".")[1].length; 50 } 51 catch (e) { 52 r1 = 0; 53 } 54 try { 55 r2 = arg2.toString().split(".")[1].length; 56 } 57 catch (e) { 58 r2 = 0; 59 } 60 m = Math.pow(10, Math.max(r1, r2)); //last modify by deeka //¶¯Ì¬¿ØÖƾ«¶È³¤¶È 61 n = (r1 >= r2) ? r1 : r2; 62 return ((arg1 * m - arg2 * m) / m).toFixed(n); 63 }, 64 mul : function(arg1, arg2){ 65 var m = 0, s1 = arg1.toString(), s2 = arg2.toString(); 66 try { 67 m += s1.split(".")[1].length; 68 } 69 catch (e) { 70 } 71 try { 72 m += s2.split(".")[1].length; 73 } 74 catch (e) { 75 } 76 return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m); 77 }, 78 div : function(arg1, arg2){ 79 var t1 = 0, t2 = 0, r1, r2; 80 try { 81 t1 = arg1.toString().split(".")[1].length; 82 } 83 catch (e) { 84 } 85 try { 86 t2 = arg2.toString().split(".")[1].length; 87 } 88 catch (e) { 89 } 90 with (Math) { 91 r1 = Number(arg1.toString().replace(".", "")); 92 r2 = Number(arg2.toString().replace(".", "")); 93 return (r1 / r2) * pow(10, t2 - t1); 94 } 95 } 96}; 97//»ñÈ¡Ö÷Óò 98var Domain=document.domain; 99Domain=trim(Domain); 100Domain=Domain.toLowerCase(); 101var tmp_arr=Domain.match(/[\w][\w-]*\.(?:com\.cn|net\.cn|org\.cn|com\.au|imipo\.shop|com|cn|co|net|org|gov|cc|biz|info|hn|xyz|hk|icu|us|mobi|art|wang|me|so|top|win|vip|ltd|red|ru|ac\.cn|xn--kput3i|xin|xn--3ds443g|shop|site|club|fun|online|link|gov\.cn|name|pro|work|tv|kim|group|tech|store|cx|ren|ink|pub|live|wiki|design|xn--fiq228c5hs|xn--6qq986b3xl|xn--fiqs8s|xn--ses554g|xn--hxt814e|xn--55qx5d|xn--io0a7i|xn--3bst00m)(\/|$)/); 102Domain=tmp_arr[0]; 103 104var tmp_url = location.href; 105if(tmp_url.indexOf("baike_add")==-1 && tmp_url.indexOf("bbs_add_book")==-1 && tmp_url.indexOf("bbs_thread")==-1 && tmp_url.indexOf("baike_edit")==-1 && tmp_url.indexOf("bbs_edit_book")==-1 && tmp_url.indexOf("/baike_")==-1 && tmp_url.indexOf("/thread_")==-1 && tmp_url.indexOf("/forum_")==-1 && tmp_url.indexOf("/dom/form_iframe.php")==-1 && tmp_url.indexOf("/zd_")==-1 && tmp_url.indexOf("/dom/zhidao")==-1){ 106 document.domain =Domain; 107} 108 109$(function() { 110 //ÎÄÕµãÔÞ¹«Óà 111 wsf.userLike = function(recordId, type, objectId, style, operate, user_name, part, html) { 112 //ûÓеǼͨ¹ýcookieÑéÖ¤ÊÇ·ñµãÔÞ 113 var zz_userid = readCookie('zz_userid'); 114 if (!zz_userid && operate == 'like') { 115 var userLikeRecord = readCookie('user_like_record'); 116 var tmpStr = type + '*' + recordId; 117 //ÒÑÔÞ¹ý 118 if (userLikeRecord.indexOf(tmpStr) != -1) { 119 alert_frame($weisiteLa.YiZanGuo); 120 return false; 121 } 122 123 //ÿÈÕÏÞÖÆ100´Î 124 var tmpArr = userLikeRecord.split('#'); 125 if (tmpArr.length >= 100) { 126 alert_frame($weisiteLa.MeiRiZuiDuoDianZan); 127 return false;
128 } 129 } 130 $.ajax({ 131 type: 'POST', 132 dataType: 'json', 133 url: '/Public/UserOperate.php', 134 data: { 135 username: user_name, 136 rid: recordId, 137 opt: operate, 138 type: type, 139 part: part, 140 t: Date.parse(new Date()) 141 }, 142 success: function(data) { 143 if (data.errorcode > 0) { 144 alert_frame(data.errormsg); 145 } else { 146 var obj = $("#" + objectId); 147 if(html){ 148 obj.html(html.replace('{n}', data.num)); 149 }else{ 150 if (operate == 'browse') { 151 obj.html($weisiteLa.Read+'£º'+data.num); 152 } else { 153 obj.html(data.errormsg); 154 } 155 } 156 157 var styleArr = style.split('#'); 158 159 if (operate == 'like' || data.liked) 160 { 161 obj.data('opt', "unLike"); 162 obj.removeClass(styleArr[0]); 163 obj.addClass(styleArr[1]); 164 if(operate == 'like') alert_frame($weisiteLa.DianZanChengGong); 165 } 166 else if (operate == 'unLike') 167 { 168 obj.data('opt', "like"); 169 obj.removeClass(styleArr[1]); 170 obj.addClass(styleArr[0]); 171 alert_frame($weisiteLa.QuXiaoChengGong); 172 } 173 } 174 } 175 }); 176 }; 177}); 178 179//email ÅÐ¶Ï 180function checkEmail(cEmail) 181{ 182 183 var patrn = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; 184 if (!patrn.test(cEmail)){ 185 return false; 186 }else{ 187 return true; 188 } 189} 190 191//Çå³ý¿Õ¸ñ 192function trim(str){ 193 return rtrim(ltrim(str)); 194} 195function ltrim(s){ 196 return s.replace(/(^\s*)/g, ""); 197} 198 //È¥ÓÒ¿Õ¸ñ; 199function rtrim(s){ 200 return s.replace(/(\s*$)/g, ""); 201} 202 203//µç»° 204function phonecheck(s){ 205 var str=s; 206 //var reg=/(^[0-9]{3,4}\-[0-9]{7,8}$)|(^[0-9]{3,4}\-[0-9]{7,8}\-[0-9]{3,4}$)|(^[0-9]{7,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}1[0-9]{1}[0-9]{9}$)/; 207 var reg=/(^(\d{2,4}[-_£¨D]?)?\d{3,8}([-_£¨D]?\d{3,8})?([-_£¨D]?\d{1,7})?$)|(^0?1[35]\d{9}$)/; 208 //alert(reg.test(str)); 209 if (reg.test(str)==false){ 210 return false; 211 }else{ 212 return true; 213 } 214} 215//×Ö·û³¤¶È 216function strLen(key){ 217 var l=escape(key),len 218 len=l.length-(l.length-l.replace(/\%u/g,"u").length)*4 219 l=l.replace(/\%u/g,"uu") 220 len=len-(l.length-l.replace(/\%/g,"").length)*2 221 return len; 222} 223//ʱ¼ä´Á 224function UTCTimeDemo(){ 225 var now = new Date().getTime(); 226 var datestr=escape(now*1000+Math.round(Math.random()*1000)); 227 return datestr; 228} 229function isChinese(str){ 230 var badChar ="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 231 badChar += "abcdefghijklmnopqrstuvwxyz"; 232 badChar += "0123456789"; 233 badChar += "_"; 234 if(""==str) 235 { 236 return false; 237 } 238 for(var i=0;i<str.length;i++) 239 { 240 var c = str.charAt(i);//×Ö·û´®strÖеÄ×Ö·û 241 if(badChar.indexOf(c) == -1) 242 { 243 return true; 244 } 245 } 246 return false; 247} 248 249//ÊÕ²ØÐÅÏ¢´¦Àí 250function copyToClipBoard(){ 251 var clipBoardContent=""; 252 clipBoardContent+=window.location.href; 253 if (window.clipboardData){ 254 if(window.clipboardData.setData("Text",clipBoardContent)){ 255 alert($weisiteLa.FuZhiChengGong); 256 } 257 }else{ 258 var flashcopier = 'flashcopier'; 259 if(!document.getElementById(flashcopier)) { 260 var divholder = document.createElement('div'); 261 divholder.id = flashcopier; 262 document.body.appendChild(divholder); 263 } 264 document.getElementById(flashcopier).innerHTML = ''; 265 clipBoardContent = clipBoardContent.replace(/\"/g,'\''); 266 var divinfo = '<embed src="/_clipboard.swf" FlashVars="clipboard='+clipBoardContent+'" width="0" height="0" type="application/x-shockwave-flash"></embed>'; 267 document.getElementById(flashcopier).innerHTML = divinfo; 268 alert($weisiteLa.FuZhiChengGong); 269 } 270} 271 272function killErrors() 273{ 274 return true; 275} 276window.onerror = killErrors; 277 278function login_out(){ 279 writeCookie('zz_userid',''); 280 window.location.reload(); 281} 282 283//×ù»úºÅÂë 284function isTel(s){ 285 var str=s; 286 var reg=/^[+]{0,1}(\d){1,4}[ ]{0,1}([-]{0,1}((\d)|[ ]){1,12})+$/; 287 //alert(reg.test(str)); 288 if (reg.test(str)==false){ 289 return false;
290 }else{ 291 return true; 292 } 293} 294//ÊÖ»ú 295function isMobil(s) 296{ 297 var patrn = /^[0-9]{11}$/; 298 if(patrn.exec(s)) { 299 return true; 300 }else{ 301 return false; 302 } 303} 304 305//ÓÊÕþ±àÂë 306function postcodecheck(s){ 307 var re= /^[0-9][0-9]{5}$/ 308 if(re.test(s)){ 309 return true; 310 }else 311 { 312 return false; 313 } 314} 315 316//É̳ǹؼü×Ö 317function check_mall_key(tag){ 318 var key_word=$('#keyWord').val(); 319 key_word=trim(key_word); 320 if(tag==2 && key_word==''){ 321 $('#keyWord').val($weisiteLa.SouCuoChanPin); 322 } 323 if(tag==1 && key_word==$weisiteLa.SouCuoChanPin){ 324 $('#keyWord').val(''); 325 } 326} 327 328//É̳ÇËÑË÷ 329function check_mall_search(){ 330 $("#mall_search").submit(function(){ 331 var key_word=$('#keyWord').val(); 332 key_word=trim(key_word); 333 if(key_word=='' || key_word==$weisiteLa.SouCuoChanPin){ 334 alert($weisiteLa.QingShuRuChaZhaoShangPin); 335 $('#keyWord').focus(); 336 return false; 337 } 338 //$('#mall_search').submit(); 339}); 340} 341 342 343//ÏÔʾÏûÏ¢ 344function set_msg_new(width,height,title,content,true_fn,false_fn,no_close){ 345 346 if(!width)width=370; 347 if(!height)height=200; 348 var tmp_arr = set_bg(width); 349 var top_height = tmp_arr[0]; 350 var left_width = tmp_arr[1]; 351 var close_style=no_close?'style="display:none"':''; 352 353 var false_html = ''; 354 var css_style = ''; 355 if (false_fn) { 356 false_html = '<input type="button" class="msg_button" value="È¡ Ïû" onclick="'+false_fn+'"/>'; 357 } else { 358 css_style = ' style="text-align: center; margin-left: 0px;" '; 359 } 360 361 var float_div = '<div class="msg_main" id="float" style="left:'+left_width+'px;top:'+top_height+'px;width:'+width+'px;height:'+height+'px;"><div class="msg_tit"><strong>'+title+'</strong><span class="msg_close" '+close_style+'><a href="javascript:remove_div(\'float\')"><img src="http://img.ev123.com/pic/vip_msg/18.gif" border="0" /></a></span></div><div class="msg_contents"><span class="msg_info">'+content+'</span></div><div class="msg_buttons" '+ css_style +'><input type="button" class="msg_button" value="È· ¶¨" onclick="'+true_fn+'" />'+ false_html +'</div><div class="msg_foot"><a href="#"></a></div></div>'; 362 $('body').append(float_div); 363} 364 365 366//Çå³ý¸¡¶¯ 367function remove_div(div_id){ 368 $('#bg_div').remove(); 369 $('#float').remove(); 370 $('#'+div_id+'').remove(); 371} 372 373//ÉèÖñ³¾° 374function set_bg(tmp_width,tmp_height){ 375 376 setTimeout(set_bg2,200); 377 if(!tmp_height){ 378 tmp_height=200; 379 } 380 381 //ÏÔʾ³öÒѾÌí¼ÓÍêÒÔºóµÄÊý¾Ý 382 var offset_height = document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight; 383 var offset_width = document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth; 384 var offset_top = document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop; 385 var top_height = offset_top+(offset_height - tmp_height)/2; 386 var left_width = (offset_width - tmp_width)/2; 387 388 var tmp_arr = new Array(top_height,left_width); 389 return tmp_arr; 390} 391 392function set_bg2(){ 393 //½«±³¾°±ä»Ò 394 var height=$(document).height(); 395 var height2=document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight; 396 height=(height>height2)?height:height2; 397 var bg_div = '<div id="bg_div" style= "position:absolute;left:0px;top:0px;filter:alpha(opacity=30);z-index:40;width:'+$(document).width()+'px;height:'+height+'px;background:#000;opacity:0.3" align="center"><iframe style="position:absolute; visibility:inherit; top:0px; left:0px; width:'+$(document).width()+'px; height:'+height+'px; z-index:-1;filter=\'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\';" frameborder="0"></iframe></div>'; 398 $('body').append(bg_div); 399} 400//²úÆ·×îÖÕÒ³²úÆ·¹æ¸ñÑ¡ÔñÀÏ¡£ 401function select_param(param_id,obj){ 402 $('#pro_param_'+param_id+' span').addClass('nor'); 403 $('#pro_param_'+param_id+' span').removeClass('act'); 404 $(obj).addClass('act'); 405 var tmp_val=$(obj).html(); 406 $('#pro_param_'+param_id+' input').val(tmp_val); 407} 408 409/* 410//* arithmetic = add ¹ºÂòÊýÁ¿¼Ó1 411//* arithmetic = reduce ¹ºÂòÊýÁ¿¼õ1 412*/ 413function add_reduce_num3(arithmetic){ 414 if ($(".reduce").attr('data-noclick') == 1) { 415 return false; 416 } 417 var currencyType = $("#currency").val(); 418 var Is_suppliers =$('#Is_suppliers').val(); 419 var shop_num = $('#pro_num').val(); 420 var Real_stock =$('#Real_stock').val(); 421 var Minimum_ord =$('#Minimum_ord').val(); 422 var prounit = $("#shopUnit").html(); 423 var tmp_num; 424 var tmp_num2; 425 var jifen_name = $("#jifen_name").val(); 426 var is_jifen_limit = $("#is_jifen_limit").val(); 427 var jifen_must_num = $("#jifen_must_num").val(); 428 //var price =$('#shop_price').html(); 429 //var shop_price = Number(price.substring(1)); 430 var shop_price =$("#Real_price").val(); 431 prounit = ''; 432 433 Is_suppliers >0 ? tmp_num=parseInt(Real_stock) : tmp_num=99999; 434 Minimum_ord >0 ? tmp_num2=parseInt(Minimum_ord) : tmp_num2=1; 435 436 if(tmp_num<tmp_num2){ 437 $("#Go_Wu_Back").show(); 438 $("#Go_Wu_Back2").show(); 439 alert($weisiteLa.gongHuoBuZu); 440 return false;
441 } 442 443 if(tmp_num==0){ 444 alert($weisiteLa.zanWuGongHuo); 445 $('#pro_num').val(0); 446 return false; 447 } 448 if($("#restrict_num").length > 0){ 449 var restrict_num = parseInt($('#restrict_num').val()); //»ñÈ¡ÏÞ¹ºÊýÁ¿ 450 if(restrict_num < tmp_num){ 451 tmp_num = restrict_num; 452 } 453 } 454 455 if(arithmetic == 'reduce'){ 456 if(shop_num > tmp_num2 && shop_num <= tmp_num){ 457 reality_num = Number(shop_num) - 1; 458 }else{ 459 alert($weisiteLa.GouMaiShuLiangBuNengXiaoYu+tmp_num2+$weisiteLa.HuoZheDaYu+tmp_num); 460 return false; 461 } 462 }else if(arithmetic == 'add'){ 463 if(shop_num >= tmp_num2 && shop_num < tmp_num){ 464 reality_num = Number(shop_num) + 1; 465 }else{ 466 467 alert($weisiteLa.GouMaiShuLiangBuNengXiaoYu+tmp_num2+$weisiteLa.HuoZheDaYu+tmp_num); 468 return false; 469 } 470 } 471 var must_html = ''; 472 if (is_jifen_limit == 2 && jifen_must_num > 0) { 473 must_html = '<em id="all_must_jifen"> +'+jifen_must_num*reality_num+jifen_name+'</em>'; 474 } 475 $('#pro_num').val(reality_num); 476 var allMoney = nCount.mul(Number(shop_price), Number(reality_num)); 477 var obj = $("input:checkbox[name='check_ids[]']:checked"); 478 var n=0; 479 $.each(obj,function(i,item){ 480 var num = parseInt($(item).parent().find(".newPrice em").html().slice(1)); 481 n+=num; 482 }); 483 n+=allMoney; 484 $("#commend_price").html(currencyType+n); 485 $('#pro_total').html('<b>'+$weisiteLa.zongJi+' </b><span class="newPrice"><em>'+ currencyType + allMoney +'</em>'+prounit+must_html+'</span>'); 486} 487 488 489function keyboard_num(){ 490 if($("#pro_num").attr('data-noclick')==1 || !id){ return false; } 491 /* ÉÌÆ·ÊýÁ¿ÅжÏ*/ 492 var reality_num = $('#pro_num').val(); 493 var is_number_var = /^[0-9]+.?[0-9]*$/; 494 var is_number_zheng = /^[1-9]+[0-9]*]*$/; 495 var Minimum_ord =$('#Minimum_ord').val(); 496 var Real_stock =$('#Real_stock').val(); 497 var Is_suppliers =$('#Is_suppliers').val(); 498 var currencyType = $("#currency").val(); 499 var tmp_num2; 500 var tmp_num; 501 var jifen_name = $("#jifen_name").val(); 502 var is_jifen_limit = $("#is_jifen_limit").val(); 503 var jifen_must_num = $("#jifen_must_num").val(); 504 //var price =$('#shop_price').html(); 505 //var shop_price = Number(price.substring(1)); 506 var shop_price =$("#Real_price").val(); 507 Is_suppliers >0 ? tmp_num=parseInt(Real_stock) : tmp_num=99999; 508 Minimum_ord >0 ? tmp_num2=parseInt(Minimum_ord) : tmp_num2=1; 509 if($("#restrict_num").length > 0){ 510 var restrict_num = parseInt($('#restrict_num').val()); //»ñÈ¡ÏÞ¹ºÊýÁ¿ 511 if(restrict_num < tmp_num){ 512 tmp_num = restrict_num; 513 } 514 } 515 var must_html = ''; 516 517 if(!is_number_var.test(reality_num) || !is_number_zheng.test(reality_num) || reality_num > tmp_num || reality_num<tmp_num2){ 518 alert($weisiteLa.GouMaiShuLiangBiXuDaYu+tmp_num2+$weisiteLa.XiaoYu+tmp_num+$weisiteLa.DeZhengShu); 519 if (is_jifen_limit == 2 && jifen_must_num > 0) { 520 must_html = '<em id="all_must_jifen"> +'+jifen_must_num*tmp_num2+jifen_name+'</em>'; 521 } 522 $('#pro_num').val(tmp_num2); 523 $('#pro_total').html('<b>'+$weisiteLa.zongJi+' </b><span class="newPrice"><em>'+ currencyType + shop_price + '</em>'+must_html+'</span>'); 524 }else{ 525 if (is_jifen_limit == 2 && jifen_must_num > 0) { 526 must_html = '<em id="all_must_jifen"> +'+jifen_must_num*reality_num+jifen_name+'</em>'; 527 } 528 $('#pro_num').val(reality_num); 529 $('#pro_total').html('<b>'+$weisiteLa.zongJi+' </b><span class="newPrice"><em>'+ currencyType + nCount.mul(Number(shop_price), Number(reality_num)) + '</em>'+must_html+'</span>'); 530 } 531} 532 533 534function backTop(){ 535 //document.documentElement.scrollTop=0; 536 $("html,body").animate({scrollTop:0},1000); ; 537} 538 539function check_doc_down(file_id,pass_tag){ 540 if (!pass_tag) { 541 window.location = '/dom/down_doc_pass.php?username='+user_name+'&file_id='+file_id+'&isnopass=1'; 542 } else { 543 var float_div_s='<form enctype="multipart/form-data" method="post" target="_blank" action="/dom/down_doc_pass.php" id="down_form" class="download-key-alert"><input type="hidden" value="'+user_name+'" name="username" id="user_name"> <input type="hidden" value="'+pass_tag+'" name="pass_tag" id="pass_tag"> <input type="hidden" value="'+file_id+'" name="file_id" id="file_id"><ul><li class="li-item"><strong>¿ÚÁ</strong> <input type="password" name="pass_word" id="pass_word" value=""></li><li class="btn-item"><input type="button" value="Ìá½»" name="button22" onclick="check_doc_pass()"><input type="button" value="È¡Ïû" onclick="remove_div()"></li></ul></form>'; 544 $.popup({ 545 type : 4, 546 cName : "evPopupOpacity", 547 head : {yes:1, text:''}, 548 con : { 549 html : float_div_s 550 } 551 }); 552 } 553} 554 555function getCookie (NameOfCookie) { 556 if (document.cookie.length > 0) { 557 begin = document.cookie.indexOf(NameOfCookie+"="); 558 if (begin != -1) { 559 begin += NameOfCookie.length+1;//cookieÖµµÄ³õʼλÖà 560 end = document.cookie.indexOf(";", begin);//½áÊøÎ»Öà 561 if (end == -1) end = document.cookie.length;//ûÓÐ;ÔòendΪ×Ö·û´®½áÊøÎ»Öà 562 return unescape(document.cookie.substring(begin, end)); 563 } 564 } 565 return null; 566} 567 568function check_doc_price_pass () { 569 $('#down_form').submit(); 570} 571 572function check_doc_pass(){ 573 var pass_word=$("#pass_word").val(); 574 if(pass_word==""){ 575 alert("ÇëÌîд¿ÚÁ"); 576 return false;
577 }else{ 578 $('#down_form').submit(); 579 remove_div(); 580 } 581} 582//Óû§µÇ¼´¦Àí 583$(function(){ 584 var zz_userid=readCookie('zz_userid'); 585 586 if(!zz_userid || !user_name){ 587 }else{ 588 var time =UTCTimeDemo(); 589 $.post("/ajax_get_user_info.php", {type:"1",u:time,username:user_name,zz_userid:zz_userid}, 590 function(data){ $(".top-login").html(data); 591 }); 592 } 593}) 594 595// ½«ÊµÌåת»»Îª×Ö·û 596function decodeHtmlEntity(str) { 597 return str.replace(/&#(\d+);/g, function(match, dec) { 598 return String.fromCharCode(dec); 599 }); 600}; 601 602//snÉú³É 603function pro_sn (guige_param) { 604 if (!guige_param) { 605 return false; 606 } 607 608 var tmp_sn = ''; 609 var tmp_sn_param = ''; 610 for (var i=0; i < guige_param.length; i++) { 611 $.each($("#pro_param_"+guige_param[i]+" a"), function (m, item) { 612 if ($(this).parent().parent().parent().hasClass('classify-cur')) { 613 tmp_sn += guige_param[i] + ':' + parseInt($(this).attr('data-id')) + '|'; 614 } 615 }); 616 } 617 tmp_sn = tmp_sn.substring(0, tmp_sn.length-1); 618 tmp_sn_param = Base64.encode(tmp_sn); 619 tmp_sn_param = tmp_sn_param.replace(/\+/g, '-').replace(/\//g, '_'); 620 return tmp_sn_param; 621} 622 623// ¶¯Ì¬¼Û¸ñ²éѯ 624function param_combination_price() { 625 var fail = 0; 626 627 var Real_stock = parseInt($('#Real_stock').val()); // ¹©»õÊýÁ¿ 628 var default_price = parseFloat($("#default_price").val()); // ¼Û¸ñ 629 var shop_num = parseInt($('#pro_num').val()); // ÊýÁ¿ 630 var currencyType = $("#currency").val(); 631 var zero = $('#zero').val(); 632 var jifen_name = $("#jifen_name").val(); 633 var is_jifen_limit = $("#is_jifen_limit").val(); 634 635 636 var id = parseInt($("#id").val()); 637 if (id < 1 || isNaN(id)) { 638 return false; 639 } 640 641 $(".reduce").attr("data-noclick", 1); 642 // $("#pro_num").attr("disabled", "disabled"); 643 $("#innerNowBuy, #innerAddCat").addClass("but-desabled").attr("data-noclick", 1); 644 645 var sParamVal = ''; 646 sParamVal = pro_sn(guige_param); 647 if (fail == 1 || !sParamVal) { 648 return false; 649 } 650 $.post( 651 '/Ajax/GuiGe.php?username='+ user_name, 652 {type:18, sn:sParamVal, id:id,isUserInfo:1}, 653 function (data) { 654 if (!data || data == '') { 655 $(".reduce").attr("data-noclick", 1); 656 $("#pro_num").attr("disabled", "disabled"); 657 $("#pro_total").html(""); 658 if ($("#innerNowBuy").length > 0 || $("#innerAddCat").length > 0) { 659 $("#innerNowBuy,#innerAddCat").addClass("but-desabled").attr("data-noclick", 1); 660 } 661 $("#shop_price").html('<s class="noPrice">'+zero+'</s>'); 662 $("#Real_price").val(0); 663 $("#pro_stock").html(0); 664 if ($("#limitNum").length > 0) { 665 $("#limitNumBox").hide(); 666 $("#limitNum").html(0); 667 } 668 $("#Real_stock").val(0); 669 $("#weight").hide(); 670 $("#Real_weight").val(0); 671 $("#jifenNum").html(0); 672 $("#jifen").hide(); 673 $("#shopUnit").hide(); 674 $("#must_jifen").hide(); 675 $("#max_mony").hide().siblings('.show-coll-pro').addClass('show-coll-pro-nobuy') 676 return false; 677 } 678 679 var param_id = parseInt(data.guigeId); 680 var weight = parseFloat(data.weight); 681 var num = parseInt(data.buyStock); 682 var shopStock = parseInt(data.shopStock); 683 var price = parseFloat(data.price); 684 var restrict_num= parseInt(data.restrict_num); 685 var jifen_must_num = parseInt(data.jifen_must_num); 686 var userPro = data.userPro; 687 var presales = data.presales; 688 689 $("#jifen_must_num").val(jifen_must_num); 690 var show_parice = ''; 691 (function(){ 692 var pPreview = $("#pPreview"), 693 bigPics = pPreview.find('.show-big-pic .pic'), 694 bigPicW = bigPics.width(), 695 bigPicH = bigPics.height(), 696 bigPicsImg = bigPics.find("img"); 697 if (bigPicsImg.length > 0 && data.imgPath) { 698 var sImgUrl = data.imgPath, 699 oImg = new Image(); 700 sImgUrl = sImgUrl.indexOf('?') != '-1' ? sImgUrl.substr(0, sImgUrl.indexOf('?')) : sImgUrl; 701 oImg.src = sImgUrl; 702 bigPicsImg.attr('src','/images/VNew/loading-wait-bg.gif').attr('data-imgsrc', sImgUrl); 703 oImg.onload = function () { 704 bigPicsImg.attr({ 705 "src": oImg.src 706 }); 707 }; 708 oImg.src = sImgUrl + '?x-oss-process=image/resize,m_lfit,limit_1,w_' + parseInt(bigPicW) + ',h_' + parseInt(bigPicH); 709 } 710 })(); 711 712 if ($("#limitNum").length > 0) { 713 var limitNum = parseInt(data.limitBuyNum); 714 if (limitNum) { 715 $("#limitNum").html(limitNum); 716 $("#limitNumBox").show(); 717 } else { 718 $("#limitNumBox").hide(); 719 } 720 } 721 722 var actPrice = price; 723 if (userPro && userPro.length != 0) { 724 var tbStr = '',className = '',tmp_rebatePrice=0; 725 var rebate_arr = userPro['rebate_arr']; 726 var cur_rebate = userPro['cur_rebate']; 727 var rebate_type = userPro['rebate_type']; 728 actPrice = cur_rebate['rebatePrice']; 729 $.each(rebate_arr,function(index,item){ 730 className = (item['user_level'] == cur_rebate['user_level']) ? '
730class="cur"' : ''; 731 if (rebate_type ==1) { 732 tmp_rebate_price = item['rebate_price']; 733 tmp_show = 1; 734 }else{ 735 tmp_rebate_price = parseFloat(item['rebate']) /10; 736 tmp_rebate_price = (tmp_rebate_price * data.price).toFixed(2); 737 if (item['rebate'] > 0.00 && item['rebate'] <10.00){ 738 tmp_show = 1; 739 }else{ 740 tmp_show = 0; 741 } 742 } 743 744 if (tmp_show == 1){ 745 tbStr +='<tr><td'+className+'>'+item['grade_name']+'</td><td'+className+'>'+ currencyType +tmp_rebate_price+'</td></tr>'; 746 } 747 }) 748 var tmp_str = ''; 749 if (rebate_type == 1){ 750 tmp_str = ''; 751 }else{ 752 tmp_str = cur_rebate['rebateNum']+$weisiteLa.Zhe; 753 } 754 755 var curRebateInfo = currencyType+cur_rebate['rebatePrice']+'<font>'+cur_rebate['level_name']+$weisiteLa.ZhuanXiang+' '+tmp_str+'</font>'; 756 $('#userPro tbody').html(tbStr); 757 $('.new_em').html(curRebateInfo); 758 } 759 760 if (price <= 0) { 761 show_parice = '<s class="noPrice">'+zero+'</s>'; 762 $("#jifen").hide(); 763 $("#shopUnit").hide(); 764 } else { 765 show_parice = currencyType + price; 766 $("#shopUnit").show(); 767 768 if(G_.sendjifen>=0){ 769 if(G_.sendjifen>0){ 770 $("#jifenNum").html(G_.sendjifen); 771 $("#jifen").show(); 772 } 773 }else{ 774 if (G_.jifen) { 775 var jifen = 0; 776 if (price >= G_.jifen) { 777 jifen = parseInt(actPrice / G_.jifen); 778 $("#jifenNum").html(jifen); 779 $("#jifen").show(); 780 } else { 781 $("#jifen").hide(); 782 } 783 } 784 } 785 } 786 787 if (presales && presales.length != 0){ 788 $('.oldPrice').html(currencyType+presales.price); 789 $('#currentPresell').html(currencyType+presales.price); 790 791 var presales_price_list = presales.price_list; 792 $.each(presales_price_list,function(index,item){ 793 $("#current_"+index).html(currencyType+item.price); 794 }) 795 } 796 $("#restrict_num").val(restrict_num); 797 $("#restrict_show_num").html(restrict_num); 798 $("#shop_price").html(show_parice); 799 $("#pro_stock").html(shopStock); 800 $("#Real_stock").val(num); 801 $("#Real_price").val(actPrice); 802 if(weight){ 803 $("#weight").show(); 804 $("#pro_weight").html(weight+$weisiteLa.Ke); 805 }else{ 806 $("#weight").hide(); 807 } 808 $("#Real_weight").val(weight); 809 $(".param_id").val(param_id); 810 811 if (num == 0) { 812 $(".reduce").attr("data-noclick", 1); 813 $("#pro_num").attr("disabled", "disabled"); 814 $("#pro_total").html(""); 815 if ($("#innerNowBuy").length > 0 || $("#innerAddCat").length > 0) { 816 $("#innerNowBuy, #innerAddCat").addClass("but-desabled").attr("data-noclick", 1); 817 } 818 $("#max_mony").hide().siblings('.show-coll-pro').addClass('show-coll-pro-nobuy'); 819 if (parseInt(data.isParentPro) !== 1) { 820 alert($weisiteLa.ZunJingDeGuiShangPinGaoXin); 821 } 822 return false; 823 } else if (price <= 0 && data.buy_for_zero == 0) { 824 $(".reduce").attr("data-noclick", 1); 825 $("#pro_num").attr("disabled", "disabled"); 826 $("#pro_total").html(""); 827 if ($("#innerNowBuy").length > 0 || $("#innerAddCat").length > 0) { 828 $("#innerNowBuy, #innerAddCat").addClass("but-desabled").attr("data-noclick", 1); 829 } 830 $("#max_mony").hide().siblings('.show-coll-pro').addClass('show-coll-pro-nobuy') 831 var Minimum_ord = parseInt($('#Minimum_ord').val()); 832 if(Minimum_ord > num){ 833 alert($weisiteLa.gongHuoBuZu); 834 return false;
835 } 836 } else { 837 var Minimum_ord = parseInt($('#Minimum_ord').val()); 838 if(Minimum_ord > num){ 839 $(".reduce").attr("data-noclick", 1); 840 $("#pro_num").attr("disabled", "disabled"); 841 $("#pro_total").html(""); 842 if ($("#innerNowBuy").length > 0 || $("#innerAddCat").length > 0) { 843 $("#innerNowBuy, #innerAddCat").addClass("but-desabled").attr("data-noclick", 1); 844 } 845 $("#max_mony").hide().siblings('.show-coll-pro').addClass('show-coll-pro-nobuy') 846 alert($weisiteLa.gongHuoBuZu); 847 return false; 848 } else { 849 if (parseInt(data.isBuy)) { 850 $(".reduce").removeAttr("data-noclick"); 851 } else { 852 $(".reduce").attr("data-noclick", 1); 853 } 854 var total_price = actPrice*shop_num; 855 var must_html = ''; 856 if (is_jifen_limit == 2 && jifen_must_num > 0) { 857 $("#must_jifen").html(' +'+jifen_must_num*shop_num+jifen_name).show(); 858 must_html = '<em id="all_must_jifen"> +'+jifen_must_num*shop_num+jifen_name+'</em>'; 859 } 860 $("#pro_total").html('<b>'+$weisiteLa.zongJi+' </b><span class="newPrice"><em>'+ currencyType + total_price + '</em>'+must_html+'</span>'); 861 //»ñȡѡÖÐÍÆ¼ö²úÆ·µÄ¼Û¸ñ 862 $("input:checkbox[name='check_ids[]']:checked").each(function(){ 863 var pid = $(this).val(); 864 var check_price = parseFloat($('#shop_price_'+pid).html().slice(1)); 865 total_price = nCount.add(total_price ,check_price); 866 }); 867 $("#commend_price").html(currencyType + total_price); 868 if ($("#innerNowBuy").length > 0 || $("#innerAddCat").length > 0) { 869 $("#innerNowBuy, #innerAddCat").removeClass("but-desabled").attr("data-noclick", 0); 870 } 871 $("#max_mony").show(); 872 } 873 } 874 }, 875 'json' 876 ); 877 $(".reduce").attr("data-noclick", 1); 878 // $("#pro_num").attr("disabled", "disabled"); 879 $("#pro_total").html(""); 880 881 if ($("#innerNowBuy").length > 0 || $("#innerAddCat").length > 0) { 882 $("#innerNowBuy,#innerAddCat").addClass("but-desabled").attr("data-noclick", 1); 883 } 884} 885 886/*****************************¹ØÓڰ󶨻¬ÂÖ¹ö¶¯Ê±¼äµÄ·½·¨º¯Êý*****************************/ 887(function (factory) { 888 if ( typeof define === 'function' && define.amd ) { 889 // AMD. Register as an anonymous module. 890 define(['jquery'], factory); 891 } else if (typeof exports === 'object') { 892 // Node/CommonJS style for Browserify 893 module.exports = factory; 894 } else { 895 // Browser globals 896 factory(jQuery); 897 } 898} 899(function ($) { 900 901 var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'], 902 toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ? 903 ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'], 904 slice = Array.prototype.slice, 905 nullLowestDeltaTimeout, lowestDelta; 906 907 if ( $.event.fixHooks ) { 908 for ( var i = toFix.length; i; ) { 909 $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks; 910 } 911 } 912 913 var special = $.event.special.mousewheel = { 914 version: '3.1.9', 915 916 setup: function() { 917 if ( this.addEventListener ) { 918 for ( var i = toBind.length; i; ) { 919 this.addEventListener( toBind[--i], handler, false ); 920 } 921 } else { 922 this.onmousewheel = handler; 923 } 924 // Store the line height and page height for this particular element 925 $.data(this, 'mousewheel-line-height', special.getLineHeight(this)); 926 $.data(this, 'mousewheel-page-height', special.getPageHeight(this)); 927 }, 928 929 teardown: function() { 930 if ( this.removeEventListener ) { 931 for ( var i = toBind.length; i; ) { 932 this.removeEventListener( toBind[--i], handler, false ); 933 } 934 } else { 935 this.onmousewheel = null; 936 } 937 }, 938 939 getLineHeight: function(elem) { 940 return parseInt($(elem)['offsetParent' in $.fn ? 'offsetParent' : 'parent']().css('fontSize'), 10); 941 }, 942 943 getPageHeight: function(elem) { 944 return $(elem).height(); 945 }, 946 947 settings: { 948 adjustOldDeltas: true 949 } 950 }; 951 952 $.fn.extend({ 953 mousewheel: function(fn) { 954 return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel'); 955 }, 956 957 unmousewheel: function(fn) { 958 return this.unbind('mousewheel', fn); 959 } 960 }); 961 962 963 function handler(event) { 964 var orgEvent = event || window.event, 965 args = slice.call(arguments, 1), 966 delta = 0, 967 deltaX = 0, 968 deltaY = 0, 969 absDelta = 0; 970 event = $.event.fix(orgEvent); 971 event.type = 'mousewheel'; 972 973 // Old school scrollwheel delta 974 if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; } 975 if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; } 976 if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; } 977 if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; } 978 979 // Firefox < 17 horizontal scrolling related to DOMMouseScroll event 980 if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { 981 deltaX = deltaY * -1; 982 deltaY = 0; 983 } 984 985 // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy 986 delta = deltaY === 0 ? deltaX : deltaY; 987 988 // New school wheel delta (wheel event) 989 if ( 'deltaY' in orgEvent ) { 990 deltaY = orgEvent.deltaY * -1; 991 delta = deltaY; 992 } 993 if ( 'deltaX' in orgEvent ) { 994 deltaX = orgEvent.deltaX; 995 if ( deltaY === 0 ) { delta = deltaX * -1; } 996 } 997 998 // No change actually happened, no reason to go any further 999 if ( deltaY === 0 && deltaX === 0 ) { return; } 1000 1001 // Need to convert lines and pages to pixels if we aren't already in pixels 1002 // There are three delta modes: 1003 // * deltaMode 0 is by pixels, nothing to do 1004 // * deltaMode 1 is by lines 1005 // * deltaMode 2 is by pages 1006 if ( orgEvent.deltaMode === 1 ) { 1007 var lineHeight = $.data(this, 'mousewheel-line-height'); 1008 delta *= lineHeight; 1009 deltaY *= lineHeight; 1010 deltaX *= lineHeight; 1011 } else if ( orgEvent.deltaMode === 2 ) { 1012 var pageHeight = $.data(this, 'mousewheel-page-height'); 1013 delta *= pageHeight; 1014 deltaY *= pageHeight; 1015 deltaX *= pageHeight; 1016 } 1017 1018 // Store lowest absolute delta to normalize the delta values 1019 absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) ); 1020 1021 if ( !lowestDelta || absDelta < lowestDelta ) { 1022 lowestDelta = absDelta; 1023 1024 // Adjust older deltas if necessary 1025 if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { 1026 lowestDelta /= 40; 1027 } 1028 } 1029 1030 // Adjust older deltas if necessary 1031 if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { 1032 // Divide all the things by 40! 1033 delta /= 40; 1034 deltaX /= 40; 1035 deltaY /= 40; 1036 } 1037 1038 // Get a whole, normalized value for the deltas 1039 delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta); 1040 deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta); 1041 deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta); 1042 1043 // Add information to the event object 1044 event.deltaX = deltaX; 1045 event.deltaY = deltaY; 1046 event.deltaFactor = lowestDelta; 1047 // Go ahead and set deltaMode to 0 since we converted to pixels 1048 // Although this is a little odd since we overwrite the deltaX/Y 1049 // properties with normalized deltas. 1050 event.deltaMode = 0; 1051 1052 // Add event and delta to the front of the arguments 1053 args.unshift(event, delta, deltaX, deltaY); 1054 1055 // Clearout lowestDelta after sometime to better 1056 // handle multiple device types that give different 1057 // a different lowestDelta 1058 // Ex: trackpad = 3 and mouse wheel = 120
1059 if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); } 1060 nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200); 1061 1062 return ($.event.dispatch || $.event.handle).apply(this, args); 1063 } 1064 1065 function nullLowestDelta() { 1066 lowestDelta = null; 1067 } 1068 1069 function shouldAdjustOldDeltas(orgEvent, absDelta) { 1070 // If this is an older event and the delta is divisable by 120, 1071 // then we are assuming that the browser is treating this as an 1072 // older mouse wheel event and that we should divide the deltas 1073 // by 40 to try and get a more usable deltaFactor. 1074 // Side note, this actually impacts the reported scroll distance 1075 // in older browsers and can cause scrolling to be slower than native. 1076 // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false. 1077 return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0; 1078 } 1079})); 1080 1081/** 1082 * Éú³Ésn±êʶ 1083 * @param {[type]} val [description] 1084 * @param {[type]} ids [description] 1085 * @return {[type]} [description] 1086 * 1087 * 2016/3/313 aliang add 1088 */ 1089function encoderSn(val, ids) 1090{ 1091 if (!val || !ids) { 1092 return false; 1093 } 1094 1095 var sn = val +'|'+ ids; 1096 sn = Base64.encode(sn); 1097 return sn.replace(/\+/g, '-').replace(/\//g, '_'); 1098} 1099 1100/*****************************¹ØÓÚ×Ô¶¨Òå¹ö¶¯ÌõµÄº¯Êý·½·¨**************************/ 1101(function($){ 1102 $.fn.extend({ 1103 cScroll : function(_j){ 1104 return this.each(function(){ 1105 var j = { 1106 w : 12, 1107 tbB : true, 1108 fun : function(){} 1109 }; 1110 j = $.extend(j,_j); 1111 1112 var that = this, 1113 _this = $(that), 1114 Stime, 1115 curT = 0, 1116 bw = j.tbB ? j.w : 0, 1117 maxT = 0, 1118 whellPx = 0, 1119 Sp = 0, 1120 barMH = 0, 1121 barH = 0, 1122 curP = 1, 1123 mouseD = true, 1124 thatH = _this.height(), 1125 thatCH = _this.children().height(), 1126 oj = {}; 1127 if(thatH < thatCH){ //ÅжÏÄÚÈݵĸ߶ÈÊÇ·ñ´óÓÚÍâ±ßµÄ¸ß¶È 1128 addScroll(); 1129 }else{ 1130 if(_this.children(".c-scrollbar").length==1){ 1131 //_this.children(".c-scrollbar").remove(); 1132 addScroll(); 1133 } 1134 } 1135 function addScroll(){ //Ìí¼Ó¹ö¶¯Ìõ 1136 var borderW1 =j.w/2-1; 1137 var borderW2 = j.w-4; 1138 _this.addClass("c-scroll").css({overflow:"hidden",position:"relative",padding:"0px"}); 1139 if(_this.children(".c-scrollbar").length==0){//´æÔÚÐÔ¼ì²â 1140 _this.wrapInner("<div class='c-scrollcon' style='top:0px;zoom:1;position:relative;z-index:1'></div>"); 1141 _this.append('<div class="c-scrollbar" style="z-index:2; width:'+j.w+'px;"><div class="barbut-t"><em style="border-width:0px '+borderW1+'px '+borderW2+'px;"></em></div><div class="bar-m"><div class="bar-m-bg"></div><div class="bar"></div></div><div class="barbut-b"><em style="border-width:'+borderW2+'px '+borderW1+'px 0px;"></em></div><div class="c-pagenumber"><b class="num">1</b><small></small></div></div>'); 1142 } 1143 oj.scrollcon = _this.children(".c-scrollcon"), 1144 oj.scrollbar = _this.children(".c-scrollbar"), 1145 oj.barButT = oj.scrollbar.children(".barbut-t"), 1146 oj.barM = oj.scrollbar.children(".bar-m"), 1147 oj.barM_bg = oj.barM.children(".bar-m-bg"), 1148 oj.bar = oj.barM.children(".bar"), 1149 oj.barButB = oj.scrollbar.children(".barbut-b"); 1150 oj.barPageNum = oj.scrollbar.children('.c-pagenumber'); 1151 barCount(); 1152 _this.on({ 1153 mouseenter : function(){ 1154 _this.data("chover",1); 1155 oj.scrollbar.addClass("c-scrollbar-h"); 1156 }, 1157 mouseleave : function(){ 1158 _this.data("chover",0); 1159 !mouseD || oj.scrollbar.removeClass('c-scrollbar-h'); 1160 }, 1161 mousewheel : function(event, delta, deltaX, deltaY){ 1162 if(delta > 0){curT -= whellPx;}else{curT += whellPx;}; 1163 setT(); 1164 if(delta < 0){ 1165 if(curT < maxT){ 1166 return false; 1167 } 1168 }else{ 1169 if(curT > 0){ 1170 return false; 1171 } 1172 } 1173 } 1174 }); 1175 oj.scrollbar.on({ 1176 mouseenter : function(){ 1177 $(this).data("chover",1); 1178 $(this).addClass("c-scrollbar-me"); 1179 }, 1180 mouseleave : function(){ 1181 $(this).data("chover",0); 1182 !mouseD || $(this).removeClass('c-scrollbar-me'); 1183 } 1184 }); 1185 oj.bar.on({ 1186 mouseenter : function(){ 1187 $(this).data("chover",1); 1188 !mouseD || $(this).addClass("bar-me"); 1189 }, 1190 mouseleave : function(){ 1191 $(this).data("chover",0); 1192 !mouseD || $(this).removeClass('bar-me'); 1193 }, 1194 mousedown : function(e){ 1195 mouseD = false;
1196 $(this).addClass("bar-md"); 1197 var pageY = e.pageY ,t = parseInt($(this).css("top")); 1198 1199 $(document).mousemove(function(e2){ 1200 curT =t+ e2.pageY - pageY;//pageYä¯ÀÀÆ÷¿ÉÊÓÇøÓòÊó±êλÖã¬screenYÆÁÄ»¿ÉÊÓÇøÓòÊó±êλÖà 1201 setT(); 1202 return false; 1203 }); 1204 $(document).mouseup(function(){ 1205 mouseD = true; 1206 oj.bar.removeClass('bar-md'); 1207 if(_this.data("chover") == 0){ 1208 _this.trigger('mouseleave'); 1209 } 1210 if(oj.scrollbar.data("chover") == 0){ 1211 oj.scrollbar.trigger('mouseleave'); 1212 } 1213 if(oj.bar.data("chover") == 0){ 1214 oj.bar.trigger('mouseleave'); 1215 } 1216 $(document).unbind(); 1217 }); 1218 return false; 1219 } 1220 }); 1221 oj.barM_bg.on({ 1222 mousedown : function(e){ 1223 $(this).addClass("bar-m-bg-md"); 1224 //var cpx = e.pageY - oj.scrollbar.offset().top - barH/2 - bw; 1225 1226 curT = e.pageY - oj.scrollbar.offset().top - barH/2 - bw; 1227 asetT(); 1228 return false; 1229 1230 }, 1231 mouseup : function(){ 1232 $(this).removeClass('bar-m-bg-md'); 1233 } 1234 }); 1235 oj.barButT.on({ 1236 mouseenter : function(){ 1237 $(this).addClass("barbut-t-me"); 1238 }, 1239 mouseleave : function(){ 1240 $(this).removeClass('barbut-t-me'); 1241 }, 1242 mousedown : function(){ 1243 $(this).addClass("barbut-t-md"); 1244 timeSetT('u'); 1245 $(document).mouseup(function(){ 1246 oj.barButT.removeClass("barbut-t-md"); 1247 $(document).unbind(); 1248 clearTimeout(Stime); 1249 Sp=0; 1250 }); 1251 } 1252 }); 1253 oj.barButB.on({ 1254 mouseenter : function(){ 1255 $(this).addClass("barbut-b-me"); 1256 }, 1257 mouseleave : function(){ 1258 $(this).removeClass('barbut-b-me'); 1259 }, 1260 mousedown : function(){ 1261 $(this).addClass("barbut-b-md"); 1262 timeSetT('d'); 1263 $(document).mouseup(function(){ 1264 oj.barButT.removeClass("barbut-b-md"); 1265 $(document).unbind(); 1266 clearTimeout(Stime); 1267 Sp=0; 1268 }); 1269 }, 1270 mouseup : function(){ 1271 $(this).removeClass('barbut-b-md'); 1272 } 1273 }); 1274 } 1275 function timeSetT(d){ 1276 //var self=this; 1277 if(d == "u"){curT -= whellPx;}else{curT += whellPx;}; 1278 setT(); 1279 Sp += 2; 1280 var t = 500 - Sp*50; 1281 if(t<=0){t=0}; 1282 Stime = setTimeout(function(){timeSetT(d);},t); 1283 } 1284 function barCount(){ 1285 j.fun.call(that); 1286 var cH = oj.scrollcon.height(); 1287 oj.scrollbar.height(thatH); 1288 if(j.tbB){ 1289 barMH = thatH - j.w * 2; 1290 }else{ 1291 barMH = thatH; 1292 oj.barButB.css("display","none"); 1293 oj.barButT.css("display","none"); 1294 } 1295 barH = (thatH / thatCH) * barMH; 1296 barH = barH < 20 ? 20 : barH; 1297 maxT = barMH - barH; 1298 whellPx = barH / 4; 1299 oj.barM.height(barMH); 1300 oj.barM_bg.height(barMH); 1301 oj.bar.height(barH); 1302 } 1303 function setT(){ 1304 j.fun.call(that); 1305 if(curT > maxT){curT = maxT;} 1306 if(curT < 0){curT = 0;} 1307 oj.bar.css({top:curT}); 1308 var scT = (curT / maxT) * (thatCH - thatH + (thatH / 10)); 1309 oj.scrollcon.css({top:-scT}); 1310 } 1311 function asetT(){ 1312 j.fun.call(that); 1313 if(curT > maxT){curT = maxT;} 1314 if(curT < 0){curT = 0;} 1315 oj.bar.css({top:curT}); 1316 var scT = -(curT / maxT) * (thatCH - thatH + (thatH / 40)); 1317 oj.scrollcon.animate({top:scT},1000); 1318 } 1319 }); 1320 } 1321 }) 1322})(jQuery);
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.