PageSourceSearch

https://www.babicorp.com/js/check_tw.js?v=202504281700

js babicorp.com collected 2026-10-08 04:35:38 UTC 27,164 bytes, 1,255 lines download raw bytes

1var jsLang='tw';
2
3function GetBrowser(){//判斷瀏覽器
4	var sAgent = navigator.userAgent.toLowerCase();
5	//alert(sAgent);
6	this.isIE = (sAgent.indexOf("msie")!=-1); //IE6.0-7
7	this.isFF = (sAgent.indexOf("firefox")!=-1);//firefox
8	this.isSa = (sAgent.indexOf("safari")!=-1);//safari
9	this.isOp = (sAgent.indexOf("opera")!=-1);//opera
10	this.isNN = (sAgent.indexOf("netscape")!=-1);//netscape
11	this.isChr = (sAgent.indexOf("chrom")!=-1);//Chrom
12	this.isMa = this.isIE;//marthon
13	this.isOther = (!this.isIE && !this.isFF && !this.isSa && !this.isOp && !this.isNN && !this.isSa);//unknown Browser
14	/*
15	//應用方式
16	var oBrowser = new detectBrowser(); 
17	if (oBrowser.isIE){
18		alert("IE6.0/7.0(or above version).");
19	} 
20	*/
21} 
22
23function getObject(name) {
24  if (document.getElementById) { //firefox
25    this.obj = document.getElementById(name);
26  } else if (document.all) {  //ie
27    this.obj = document.getElementById(name);
28//     this.obj = document.all[name];
29  } else if (document.layers) { //
30     this.obj = document.layers[name];
31  }
32  return this.obj;
33}
34function checkvarempty(name,cname)
35{
36	pid = getObject(name);
37	if (!pid)
38	{
39		window.alert(cname+' 元件未發現');
40		return false;
41	}
42	if(pid.value==null || pid.value=="")
43	{
44		window.alert(cname+ ' 輸入欄位為空白');//+pid.value.length
45		pid.focus();
46		return false;
47	}
48	return true;
49}
50function checkvarlen(name,cname,len)
51{
52	pid = getObject(name);
53	if (pid.value.length < len)
54	{
55		window.alert(cname+' 輸入欄位長度不足 '+len+'個字元');//+pid.value.length
56		pid.focus();
57		return false;
58	}
59	return true;
60}
61
62function checkvarSpecial(name,cname)
63{
64	pid = getObject(name);
65	//var pattern = new RegExp("[~'!@#$%^&*()-+_=:]");  
66	//var pattern = new RegExp("['!$%^&*()+_=<>]");  
67	//var pattern = new RegExp("['!$%^&*()+=<>]");  
68	var pattern = new RegExp("['$%^&*]");  
69    if(pid.value != "" && pid.value != null){
70        if(pattern.test(pid.value)){
71            alert(cname+" 請勿填入特殊字元.");  
72			pid.focus();  
73            return false;  
74        }  
75    }  
76	return true;
77}
78
79function getvarvalue(name)
80{
81	p = getObject(name);
82	return p.value;
83}
84function openpopwindow(url,w,h,param)
85{
86	var load = "";
87	p = param;
88	if (p.length > 0)
89	{
90		load = window.open(url+param,'','scrollbars=no,menubar=no,height='+w+',width='+h+',resizable=no,toolbar=no,location=no,status=no');
91	}
92	else
93	{
94		load = window.open(url,'','scrollbars=no,menubar=no,height='+w+',width='+h+',resizable=no,toolbar=no,location=no,status=no');
95	}
96	if(load == null){
97		alert("此功能需使用彈出視窗!");
98		return false;
99	}
100	return true;
101}
102function checkinput(name, cname, len)
103{
104    ret = checkvarempty(name, cname);
105    if (ret == false)
106            return false;
107    ret = checkvarlen(name, cname, len);
108    if (ret == false)
109            return false;
110    ret = checkvarSpecial(name, cname);
111    if (ret == false)
112            return false;	
113    return true;	
114}
115function showmsg(msg)
116{
117	alert(msg);	
118}
119
120function checkvarisequal(nam1, nam2)
121{
122	p1 = getvarvalue(nam1);
123	p2 = getvarvalue(nam2);
124	if (p1 == p2)
125		return true;
126	return false;
127}
128
129function doOutput(key)
130{
131	var obj=document.getElementsByName(key);
132    var len = obj.length;
133    var checked = false;
134
135    for (i = 0; i < len; i++)
136    {
137        if (obj[i].checked == true)
138        {
139            return true;
140            break;
141        }
142    }
143	return false;
144}
145
146function showKeyPress(evt) {
147 evt = (evt) ? evt : window.event
148 return checkSpecificKey(evt.keyCode);
149}
150
151function checkSpecificKey(keyCode) {
152    //var specialKey = "#$%\^*\'\"\+";//Specific Key list
153	var specialKey = "\'\"";//Specific Key list
154    var realkey = String.fromCharCode(keyCode);
155    var flg = false;
156 flg = (specialKey.indexOf(realkey) >= 0);
157  if (flg) {
158        alert('請勿輸入特殊字符: ' + realkey);
159        return false;
160    }
161    return true;
162}
163
164function gosubmit(fname)
165{
166   var form = document.getElementById(fname);
167     form.submit();
168}
169
170function chackFile(fileName){
171    var fileName2 = fileName.toLowerCase();//全部轉成小寫在做判別比較具正確性
172    if(fileName2.lastIndexOf('.') != -1){
173        var fileType = fileName2.substring(fileName2.lastIndexOf('.')+1,fileName2.length);
174        if(!(fileType == 'jpg' || fileType == 'jpeg' || fileType == 'gif' )){
175             return false;
176        }else{
177            return true;
178        }
179    }
180    return false;
181}
182
183
184function isNumber(String) //字串值檢測 
185{ 
186	var Letters = "1234567890"; //可以自己增加可輸入值 
187    var i; 
188    var c; 
189	for( i = 0; i < String.length; i++ ) 
190	{ 
191		c = String.charAt(i); 
192		if (Letters.indexOf(c) < 0){
193			return false; 
194		}
195	} 
196    return true; 
197}
198
199function isPhone(String) //行動電話檢測 
200{ 
201	var Letters = "1234567890"; //可以自己增加可輸入值 
202    var i; 
203    var c; 
204	for( i = 0; i < String.length; i++ ) 
205	{ 
206		c = String.charAt(i); 
207		if(i==0 && c!=0){
208			return false; 
209		}
210		if(i==1 && c!=9){
211			return false; 
212		}
213		if (Letters.indexOf(c) < 0){
214			return false; 
215		}
216	} 
217    return true; 
218}
219
220function isTel(String) //電話值檢測 
221{ 
222	var Letters = "1234567890"; //可以自己增加可輸入值 
223    var i; 
224    var c; 
225	for( i = 0; i < String.length; i++ ) 
226	{ 
227		c = String.charAt(i); 
228		if (Letters.indexOf(c) < 0){
229			return false; 
230		}
231	} 
232    return true; 
233}
234
235
236function isBDay(String) //生日格式檢測 
237{ 
238    var Letters = "1234567890"; //可以自己增加可輸入值 
239    var i; 
240    var c; 
241	for( i = 0; i < String.length; i++ ) 
242	{		
243		c = String.charAt(i);
244		if(i==4 || i==7){
245			if(c !='-'){
246				return false; 
247			}
248		}else{			
249			if (Letters.indexOf(c) < 0){
250				return false; 
251			}
252		}
253	} 
254    return true; 
255}
256
257//閏年
258function isLeapYear(nYear){
259    if (nYear % 4 != 0){
260        return false;
261	}	
262    if (nYear % 100 != 0){
263        return true;
264    }
265    return (nYear % 400 == 0);
266}
267
268function isMonthAndDateCorrect(nYear, nMonth, nDay, c){	
269	
270	if(!isNumber(nYear)){
271	    return false;
272	}	
273	if(!isNumber(nMonth)){
274	    return false;
275	}	
276	if(!isNumber(nDay)){
277	    return false;
278	}
279	
280	nYear=parseInt(nYear);
281	nMonth=parseInt(nMonth);
282	nDay=parseInt(nDay);
283	
284	var d=new Date();
285    if (nYear >= d.getFullYear() || nYear < (d.getFullYear()-100) ){
286        return false;
287	}
288
289    if ((nMonth > 12 || nMonth < 1) && c==true){
290        return false;
291	}
292    if ((nMonth >= 12 || nMonth < 0) && c==false){
293		
294        return false;
295	}
296    if (nDay > 31 || nDay <= 0){
297        return false;
298    }
299
300    switch(nMonth){
301        case 1:
302        case 3:
303        case 5:
304        case 7:
305        case 8:
306        case 10:
307        case 12:
308			if(nDay <= 31){
309				return true;
310			}
311			break;			
312        case 4:
313        case 6:
314        case 9:
315        case 11:
316			if(nDay <= 30){
317				return true;
318			}
319			break;		
320        case 2:
321			if (isLeapYear(nYear)){
322				if(nDay <= 29){
323					return true;
324				}
325			}else{
326				if(nDay <= 28){
327					return true;
328				}			
329			}
330			break;			
331		default:
332
333			return false;
334			break;
335    }
336    return false;
337}
338
339function isEnglish(name) //英文值檢測 
340{ 
341	if(name.length == 0){
342		return false; 
343	}
344	for(i = 0; i < name.length; i++){ 
345		if(name.charCodeAt(i) > 128) 
346		return false; 
347	} 
348	return true; 
349} 
350
351function isChinese(name) //中文值檢測 
352{ 
353	if(name.length == 0) 
354		return false; 
355	for(i = 0; i < name.length; i++) { 
356		if(name.charCodeAt(i) > 128) 
357		return true; 
358	} 
359	return false; 
360} 
361
362function isMail(remail) {
363	if (remail.search(/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/)!=-1) {	   
364	   return true; 	  
365	}else{
366	  return false; 
367	}
368}
369
370//取值
371function radioValue(key) {
372	var obj=document.getElementsByName(key);
373    var len = obj.length;
374    var checked = false;
375
376    for (i = 0; i < len; i++)
377    {
378        if (obj[i].checked == true)
379        {
380			return obj[i].value;			
381			//return true;			
382            break;
383        }
384    }
385	return false;
386}
387
388//Checkbox全選
389function setCheckboxAll(all,key){
390	var chkall= document.getElementById(all);
391	var chkother= document.getElementsByTagName("input");
392	for (var i=0;i<chkother.length;i++)
393	{
394		if( chkother[i].type=='checkbox'  && chkother[i].id == key){
395			if(chkall.checked==true){
396				chkother[i].checked=chkall.checked;
397			}else{
398				chkother[i].checked="";
399			}
400		}
401	}
402}
403// 亂數 0=數 1=英 2=英數
404function _getRandom(x,max) {
405  var text = "";
406  switch(x){
407	  case 0:
408		var possible = "0123456789";
409	  case 1:
410		var possible = "abcdefghijklmnopqrstuvwxyz";
411	  case 2:
412		var possible = "abcdefghijklmnopqrstuvwxyz0123456789";		
413	  
414  }
415  for (var i = 0; i < max; i++)
416    text += possible.charAt(Math.floor(Math.random() * possible.length));
417  return text;
418}
419
420
421function SetCookie(name,value){
422    var Days = 1; //此 cookie 保存 1小時
423    var exp  = new Date();
424    exp.setTime(exp.getTime() + Days*60*60*1000);
425    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
426}
427
428function numberOfTimes(str,key){
429	return (str.split(key).length-1);
430}
431
432function checkFileForJPG(f){
433    //var re = /\.(jpg|gif|png)$/i;  //允許的圖片副檔名
434	var re = /\.(jpg|png)$/i;  //允許的圖片副檔名
435    if (!re.test(f)) {
436		return false;
437    }
438	return true;
439} 
440
441function checkFileForPDF(f){
442    //var re = /\.(jpg|gif|png)$/i;  //允許的圖片副檔名
443	var re = /\.(pdf|doc|docx|xls|xlsx)$/i;  //允許的圖片副檔名
444	var str=$("#"+f).val();
445		str=str.toLowerCase();
446    if (!re.test(str)) {
447		return false;
448    }
449	return true;
450} 
451
452function copyInput(xxx){
453  $('#'+xxx).show();
454  document.getElementById(xxx).select()
455  document.execCommand('copy')
456  $('#'+xxx).hide();
457  alert("複製完成!");
458}
459/*----------------------------*/
460
461//搜索
462function skey(key,act){
463	var skeyTXT=$("#"+key).val();
464	if(skeyTXT=="" && $("#tag").val()=='' && $("#bID").val()=='' && $("#cID").val()==''){
465        alert('請至少選填一項搜索條件.');
466        return false;
467	}
468	location.href=act+"?bID="+$("#bID").val()+"&cID="+$("#cID").val()+"&tag="+$("#tag").val()+"&skey="+encodeURI(skeyTXT);
469}
470
471
472//電子報
473function subEmailEn(key,xact)
474{
475	if($("#"+key).val()==''){
476        alert('請填入您的電子郵件.');
477		$("#"+key).focus();
478        return false;
479	}
480	if(isMail($("#"+key).val())==false){
481        alert('電子郵件錯誤.');
482		$("#"+key).focus();
483        return false;
484	}
485	$.ajax({
486		type: 'POST',
487		url: '_getAJAX.html',
488		data: {act:'ajaxSubEmailEn',lang:jsLang,mail:$("#"+key).val(),xact:xact},
489		dataType: 'html',				
490		success: function(res){
491			//$('#error').html(res);			
492			switch(res){
493				case "訂閱":
494					alert("完成訂閱本站資訊.");	
495				break; 
496				
497				case "未訂閱":
498					alert("您未曾訂閱過本站資訊.");	
499				break; 
500				
501				case "取消":
502					alert("完成取消訂閱本站資訊.");	
503				break; 
504		
505		
506				default:
507					
508				break; 				
509			}
510			$("#"+key).val('');
511			return false;			
512		}
513	});	
514	//$("#subMail").val($("#mTXT").val());
515	//$("#enewsAct").val(act);
516	//gosubmit(obj);
517}
518
519function checkForm(obj)
520{
521	
522	var aid = ["nick","_nick","email","nation","item2","btxt","authinput"];
523	var acn = ["名字","姓","Email","國家","功能","評論","驗證碼"];
524	var len = [1,1,7,1,1,5,5];
525			
526	end = aid.length;	
527	for(var i=0; i<end; ++i)
528	{
529		ret = checkinput(aid[i], acn[i], len[i]);
530		if (ret == false){
531			return false;
532		}
533	}
534	if(isMail($("#email").val())==false){
535		alert('Email 格式錯誤!');
536		$("#email").focus();
537		return false;
538	}	
539	
540	if($("input:radio[name=item1]").is(':checked') === false) {
541		alert('請選擇 連絡項目.');
542		$("#item1").focus();
543		return false;	
544	}
545	if($('#agree:checked').length <= 0){
546		alert('請選勾同意 網站使用條款 和 隱私權聲明.');
547		$("#agree").focus();
548		return false;			
549	}
550	
551	gosubmit(obj);
552}
553
554function ajaxGetSalesData(_this){
555	$.ajax({
556		type: 'POST',
557		url: '_getAJAX.html',
558		data: {act:'ajaxGetSalesData',id:parseInt($(_this).find('a').data('id'))},
559		dataType: 'html',				
560		success: function(res){			
561			$('.tab_list').html(res);
562		}
563	});
564}
565
566/*----------user----------------------*/
567
568function userSignUpForm(obj)
569{
570	/*
571	var aid = ["nick","_nick","email","add_pass1","add_pass2","bDay","mobile","addr","add_authinput"];
572	var acn = ["名字","姓","Email","密碼","密碼","生日","行動電話","地址","驗證碼"];
573	var len = [1,1,5,5,5,10,10,5,5];
574	*/
575	var aid = ["nick","_nick","email","add_pass1","add_pass2","bDay","mobile","add_authinput"];
576	var acn = ["名字","姓","Email","密碼","密碼","生日","行動電話","驗證碼"];
577	var len = [1,1,5,5,5,10,10,5];
578		
579	end = aid.length;	
580	for(var i=0; i<end; ++i){
581	    ret = checkinput(aid[i], acn[i], len[i]);
582	    if (ret == false){
583            return false;
584		}	
585	}
586	if(!checkvarisequal("add_pass1", "add_pass2")){
587        alert('會員密碼 輸入錯誤!');
588        return false;		
589	}
590	if(isMail($("#email").val())==false){
591        alert('Email 格式錯誤!');
592		$("#email").focus();
593        return false;
594	}	
595	if($('input[name=gender]').is(':checked')==false){
596        alert('性別 尚未選擇!');
597		$("#gender").focus();
598        return false;	
599	}
600/*
601	if($('#bY').val()!='' || $('#bM').val()!='' || $('#bD').val()!=''){
602		if(!isMonthAndDateCorrect($('#bY').val(), $('#bM').val(), $('#bD').val(), true)){
603        alert('生日 輸入錯誤!');
604        return false;		
605		}
606	}
607	*/
608	if($('#agree:checked').length <= 0){
609		alert('請選勾同意 網站使用條款 和 隱私權聲明.');
610		$("#agree").focus();
611		return false;			
612	}
613	gosubmit(obj);
614}
615
616
617function userLogInForm(obj){
618	var aid = ["acc_ii","pass_ii","authinput_ii"];
619	var acn = ["Email","會員密碼","驗證碼"];
620	var len = [5,5,5];
621		
622	end = aid.length;	
623	for(var i=0; i<end; ++i){
624	    ret = checkinput(aid[i], acn[i], len[i]);
625	    if (ret == false){
626            return false;
627		}	
628	}
629	if(isMail($("#acc_ii").val())==false){
630        alert('Email 格式錯誤!');
631		$("#acc_ii").focus();
632        return false;
633	}	
634	if($('#agree:checked').length <= 0){
635		alert('請選勾同意 網站使用條款 和 隱私權聲明.');
636		$("#agree").focus();
637		return false;			
638	}
639	gosubmit(obj);
640}
641
642function userChForm(obj)
643{
644	var aid = ["nick","_nick","bDay","mobile","addr","authinput"];
645	var acn = ["名字","姓","生日","行動電話","地址","驗證碼"];
646	var len = [1,1,10,10,5,5];
647		
648	end = aid.length;	
649	for(var i=0; i<end; ++i){
650	    ret = checkinput(aid[i], acn[i], len[i]);
651	    if (ret == false){
652            return false;
653		}	
654	}
655	if($('input[name=gender]').is(':checked')==false){
656        alert('性別 尚未選擇!');
657		$("#gender").focus();
658        return false;	
659	}
660	gosubmit(obj);
661}
662
663function userChPsForm(obj)
664{
665	var aid = ["passold","pass1","pass2","authinput"];
666	var acn = ["舊密碼","新密碼","新密碼","驗證碼"];
667	var len = [5,5,5,5];
668		
669	end = aid.length;	
670	for(var i=0; i<end; ++i){
671	    ret = checkinput(aid[i], acn[i], len[i]);
672	    if (ret == false){
673            return false;
674		}	
675	}
676	if(!checkvarisequal("pass1", "pass2")){
677        alert('新密碼 輸入錯誤!');
678        return false;		
679	}
680	gosubmit(obj);
681}
682
683
684function userGetPassForm(obj)
685{
686	var aid = ["email","authinput"];
687	var acn = ["電子郵件","驗證碼"];
688	var len = [5,5];
689		
690	end = aid.length;	
691	for(var i=0; i<end; ++i){
692	    ret = checkinput(aid[i], acn[i], len[i]);
693	    if (ret == false){
694            return false;
695		}	
696	}
697	if(isMail($("#email").val())==false){
698        alert('電子郵件 格式錯誤!');
699		$("#email").focus();
700        return false;
701	}
702	gosubmit(obj);
703}
704
705function userShopOrderDataAllDEL(obj){
706	if(doOutput('del[]')){
707		if(confirm('確定 刪除訂單 ?? ')){
708			document.getElementById(obj).action="member_4_ii.html?act=DelAll";
709			gosubmit(obj);
710		}
711	}else{
712        alert('尚未選擇訂單!?');
713        return false;	
714	}
715
716}
717
718function userShopOrderDataRep(_this){
719	if(!doOutput('rep[]')){
720		alert('尚未選擇產品.');
721        return false;	
722	}
723	
724	var aid = ["nick","mobile","addr","email","act","btxt","authinput"];
725	var acn = ["姓名","行動電話","地址","電子郵件","需求","退/換貨原因","驗證碼"];
726	var len = [2,10,5,5,1,5,5];
727		
728	end = aid.length;	
729	for(var i=0; i<end; ++i)
730	{
731	    ret = checkinput(aid[i], acn[i], len[i]);
732	    if (ret == false){
733	        return false;
734		}	
735	}
736	
737	if(isPhone($("#mobile").val())==false){
738        alert('行動電話 格式錯誤!請勿輸入特殊字元!');
739		$("#mobile").focus();
740        return false;	
741	}
742	if(isMail($("#email").val())==false){
743        alert('電子郵件 格式錯誤!');
744		$("#email").focus();
745        return false;
746	}	
747	//$(_this).val("送出中..");
748	//$(_this).prop('disabled', true);	
749	//alert('YYY');
750	gosubmit("form");
751
752}
753
754function ckMember_7()
755{
756	
757	var aid = ["number"];
758	var acn = ["點數序號"];
759	var len = [5];
760			
761	end = aid.length;	
762	for(var i=0; i<end; ++i)
763	{
764		ret = checkinput(aid[i], acn[i], len[i]);
765		if (ret == false){
766			return false;
767		}
768	}
769	
770	$.ajax({
771		type: 'POST',
772		url: '_getAJAX.html',
773		data: {act:'ajaxPointsCode',number:parseInt($("#number").val())},
774		dataType: 'html',				
775		success: function(res){
776			//$("#error").html(res);return false;	
777			switch(res){
778				case "OK":
779					alert("登錄成功.");
780					location.href='member_7.html';
781				break; 
782				
783				case "use":
784					alert("此序號已登錄過.");	
785				break; 
786				
787				case "error":
788					alert("無此序號.");	
789				break; 
790		
791				default:
792					alert(res);	
793				break; 				
794			}
795			return false;	
796			
797		}
798	});
799}
800
801
802/*invoice*/
803function ckMember_7_invoice(_this) {
804	
805	if(!isNumber($("#money").val()) || $("#money").val()=='' || parseInt($("#money").val())<=0){
806        alert("購買金額請填入數字。");
807		$("#money").focus();		
808		$("#money").val(0);
809		return false;
810	}
811	
812	var aI=0;
813	if($("#invImg").val()!=""){
814		if(checkFileForJPG($("#invImg").val())==false){
815			alert('上傳發票圖片只接受 .JPG檔');
816			//alert($(this).val());
817			$("#invImg").focus();
818			++aI;
819			return false;
820		}
821		
822		//if($(this)[0].files[0].size>600000){
823		if($("#invImg")[0].files[0].size>110000000){
824			alert('上傳發票圖片大小需低於100MB');
825			$("#invImg").focus();
826			++aI;
827			return false;		
828		}
829		
830	}else{
831		alert('未上傳發票圖片');
832		$("#invImg").focus();
833		++aI;
834		return false;		
835	}
836	if(aI>0){
837		return false;
838	}
839	$("#act").val('ajaxPointsInvImgUpload');
840	$(_this).html("正在上傳發票...");
841	$(_this).prop('onclick',null).off('click');
842	
843	//return false;
844	
845	  
846	setTimeout(function(){
847		var formData = new FormData($('form#xForm')[0]);
848		$.ajax({
849			type: 'POST',
850			url: '_getAJAX.html',
851			data: formData,
852			dataType: 'html',	
853			async: false,
854			cache: false,
855			contentType: false,
856			processData: false,
857			success: function(res){
858
859				switch(res){
860					case "OK":
861						$(_this).html("上傳完成");
862						$("#money").val(0);
863						$("#invImg").val('');
864						$("#_point").html('0');
865					break; 					
866			
867					default:
868						$(_this).html("上傳失敗");
869					break; 				
870				}
871				
872				return false;				
873			}
874		});	
875	}, 2000);		
876
877}
878
879function getPointFeedback() {	
880	if(!isNumber($("#money").val()) || $("#money").val()=='' || parseInt($("#money").val())<=0){
881        alert("購買金額請填入數字。");
882		$("#money").focus();		
883		$("#money").val(0);
884		return false;
885	} 
886	
887	$.ajax({
888		type: 'POST',
889		url: '_getAJAX.html',
890		data: {act:'getPointFeedback',m:$("#money").val()},
891		dataType: 'html',				
892		success: function(res){
893			$('#_point').html(res);
894			//alert(res);	
895			
896		}
897	});	
898	
899
900}
901
902
903function ckMember_7ii(_this) {
904	$(_this).html("兌換中...");	  
905	setTimeout(function(){
906		$.ajax({
907			type: 'POST',
908			url: '_getAJAX.html',
909			data: {act:'getPointExcGoods',xid:$(_this).data('id')},
910			dataType: 'html',				
911			success: function(res){
912				//alert(res);
913				switch(res){
914					case "OK":
915						$(_this).html("我要兌換");
916						alert("兌換完成");						
917					break; 
918					
919					case "point":
920						$(_this).html("我要兌換");
921						alert("點數不足");
922					break; 
923			
924					default:
925						$(_this).html("兌換失敗");
926						$("#error").html(res);
927					break; 				
928				}
929				
930				return false;	
931				
932			}
933		});	
934	}, 2000);		
935
936}
937
938
939function ckMember_8()
940{
941	
942	var aid = ["intxt","authinput"];
943	var acn = ["留言","驗證碼"];
944	var len = [5,5];
945			
946	end = aid.length;	
947	for(var i=0; i<end; ++i)
948	{
949		ret = checkinput(aid[i], acn[i], len[i]);
950		if (ret == false){
951			return false;
952		}
953	}
954	gosubmit("form");
955}
956
957function ckMemberEval()
958{
959	
960	var aid = ["btxt"];
961	var acn = ["評論"];
962	var len = [5];
963			
964	end = aid.length;	
965	for(var i=0; i<end; ++i)
966	{
967		ret = checkinput(aid[i], acn[i], len[i]);
968		if (ret == false){
969			return false;
970		}
971	}
972	gosubmit("form");
973	return false;
974}
975/*----------shopCar----------------------*/
976
977//JQ 加減 數量
978function shopGoodsAmountAct(fID,item){	
979	var fID=$("#"+fID);
980	var nAmount=fID.val();	
981	//var reserve=fID.data('reserve');
982	var reserve=fID.data("max");
983	if(item=='add'){
984		if(nAmount<reserve){
985			++nAmount;
986		}else{
987			return false;
988		}
989	}else if(item=='del'){		
990		if(nAmount>0){
991			--nAmount;
992		}else{
993			return false;
994		}
995	}
996	fID.val(nAmount);
997	//shopGoodsAmountForTotal();
998	return false;
999}
1000
1001function ajaxShopGoodsADD(_this,amount,r){	
1002	
1003	var gAmount=$("#"+amount);
1004	var reserve=parseInt(gAmount.data("max"));
1005	
1006	if(!isNumber(gAmount.val()) || gAmount.val()<=0){
1007        alert("購買數量請填入數字。");
1008		gAmount.focus();		
1009		gAmount.val(1);
1010		return false;	
1011	}	
1012	if(reserve<gAmount.val()){
1013        alert('目前本產品庫存不足'+gAmount.val()+"。\n\r"+"請重新選填購買數量。");
1014		gAmount.focus();		
1015		gAmount.val(1);
1016		return false;	
1017	}
1018	
1019	if(gAmount.length<=0){
1020		gAmount=1;
1021	}else{
1022		gAmount=parseInt(gAmount.val());
1023	}
1024	
1025	$(_this).unbind().attr("disabled", true);	
1026	
1027	$.ajax({
1028		type: 'POST',
1029		url: '_getAJAX.html',
1030		//data: {act:'ajaxGoodsAdd',gid:parseInt($("#gAmount").data("gid")),amount:$("#gAmount").val(),type1:$("#gType1").val(),type2:$("#gType2").val()},
1031		data: {act:'ajaxGoodsAdd',gid:parseInt($(_this).data("gid")),amount:gAmount,mod:'GoodsData'},//一般商品
1032		dataType: 'html',				
1033		success: function(res){
1034			//$("#error").html(res);return false;	
1035			//alert(res);return false;	
1036			switch(res){
1037				/*
1038				case "OK":
1039					if(r){
1040						//alert("加入完畢.");	
1041						location.href='s1.html';
1042					}else{
1043						alert("加入完畢.");	
1044					}
1045				break; 
1046				*/
1047				case "error":
1048					alert("商品錯誤.");	
1049				break; 
1050		
1051				default:
1052					//alert(res);	
1053					if(r){
1054						//alert("加入完畢.");	
1055						location.href='s1.html';
1056					}else{
1057						alert("加入完畢.");	
1058						$(".sCarNum").html(res);
1059					}
1060					
1061				break; 				
1062			}
1063			return false;				
1064		}
1065	});
1066	return false;	
1067}
1068
1069
1070function shopGoodsPlusADD(_this){	
1071	var gid=parseInt($(_this).data("gid"));
1072	var buyMax=parseInt($(_this).data("max"));	
1073	var gAmount=($(_this).parent().find("input").val());
1074	//alert($(_this).parent().html());return false;
1075	if(gAmount > buyMax){
1076		gAmount=1;
1077	}
1078	
1079	
1080	$(_this).unbind().attr("disabled", true);	
1081	
1082	$("#step").val('GoodsPlus');	
1083	$("#ArrId").val(gid);	
1084	$("#amount").val(gAmount);	
1085	$("#form").attr("action", "shopData.html");
1086	gosubmit("form");
1087}
1088
1089
1090function ajaxShopGiftsADD(_this){	
1091	$(_this).unbind().attr("disabled", true);	
1092	
1093	$.ajax({
1094		type: 'POST',
1095		url: '_getAJAX.html',
1096		data: {act:'ajaxShopGiftsADD',gid:parseInt($(_this).data("id")),amount:1,mod:'ShopGif'},//兌換商品
1097		dataType: 'html',				
1098		success: function(res){
1099			//$("#error").html(res);return false;	
1100			switch(res){
1101				case "OK":
1102					alert("加入完畢.");
1103					location.href='s1.html';
1104				break; 
1105				
1106				case "error":
1107					alert("商品錯誤.");	
1108				break; 
1109				
1110				case "num":
1111					alert("兌換商品需要有購買商品才可併單出貨.");	
1112					location.href='product.html';
1113				break; 
1114		
1115				default:
1116					//alert(res);	
1117				break; 				
1118			}
1119			return false;				
1120		}
1121	});
1122	return false;	
1123}
1124
1125function shopVoucherADD(_this){	
1126	$("#step").val('shopVoucher');	
1127	$("#ArrId").val($(_this).val());
1128	$('#amount').val($('#parameter').data("subtotal"));
1129	$("#form").attr("action", "shopData.html");
1130	gosubmit("form");
1131}
1132
1133function shopOffCodeADD(_this){	
1134	if($("#shopOffCode").val()==''){
1135        alert("請填入折扣碼。");
1136		$("#shopOffCode").focus();		
1137		$("#shopOffCode").val('');
1138		return false;
1139	} 
1140	$(_this).html("送出中..")
1141	$("#step").val('shopOffCode');	
1142	$("#ArrId").val($("#shopOffCode").val());
1143	$("#form").attr("action", "shopData.html");
1144	gosubmit("form");
1145}
1146//*----------------shopping-------------------------*/
1147
1148function shopCarActDel(obj,aid){
1149	if(confirm('確定 刪除 ?? ')){
1150		$("#step").val('GoodsDel');	
1151		$("#ArrId").val(aid);	
1152		$("#"+obj).attr("action", "shopData.html");
1153		gosubmit(obj);
1154	}
1155}
1156
1157function shopCarActAmount(obj,aid,div){
1158	$('#step').val('GoodsAmount');
1159	$('#ArrId').val(aid);
1160	$('#amount').val($('#'+div).val());
1161	$("#"+obj).attr("action", "shopData.html");
1162	gosubmit(obj);
1163
1164}
1165
1166function shopCarActClean(obj){
1167	if(confirm('確定 全部刪除 ?? ')){
1168		$('#step').val('GoodsClear');
1169		$("#"+obj).attr("action", "shopData.html");
1170		gosubmit(obj);
1171	}
1172}
1173
1174function shopCarAddPay(obj){
1175	var handsel="";
1176	if($("input:radio[name=shopPayType]").is(':checked') === false) {
1177		alert('請選擇 付款方式.');
1178		$("#shopPayType").focus();
1179		return false;	
1180	}
1181	/*
1182	if($("input:radio[name=shopShipType]").is(':checked') === false) {
1183		alert('請選擇 配送方式.');
1184		$("#shopShipType").focus();
1185		return false;	
1186	}
1187	*/
1188	$("#step").val('GoodsAddPay');
1189	$('#act').val($("input:radio[name=shopPayType]:checked" ).val());
1190	//$('#ArrId').val($("input:radio[name=shopShipType]:checked" ).val());
1191	$("#"+obj).attr("action", "shopData.html");
1192	gosubmit(obj);
1193}
1194
1195function shopCarAddOrder(obj,_this,iMod){
1196
1197	var aid = ["nick","mobile","email","zip","addr","xnick","xmobile","zip","addr",];
1198	var acn = ["訂購人","行動電話","電子郵件","郵遞區號","地址","收件人","行動電話","郵遞區號","地址"];
1199	var len = [2,8,5,3,5,2,8,3,5];
1200		
1201	end = aid.length;	
1202	for(var i=0; i<end; ++i)
1203	{
1204	    ret = checkinput(aid[i], acn[i], len[i]);
1205	    if (ret == false){
1206	        return false;
1207		}	
1208	}
1209	if($('input[name=gender]').is(':checked')==false){
1210        alert('性別 尚未選擇!');
1211		$("#gender").focus();
1212        return false;	
1213	}
1214	if($('input[name=xgender]').is(':checked')==false){
1215        alert('性別 尚未選擇!');
1216		$("#gender").focus();
1217        return false;	
1218	}
1219	/*
1220	if(isPhone($("#mobile").val())==false){
1221        alert('行動電話 格式錯誤!請勿輸入特殊字元!');
1222		$("#mobile").focus();
1223        return false;	
1224	}
1225	*/
1226	if(isMail($("#email").val())==false){
1227        alert('電子郵件 格式錯誤!');
1228		$("#email").focus();
1229        return false;
1230	}
1231	
1232	var x=$( "input:radio[name=invData]:checked" ).val();
1233	
1234	if(x==3){
1235		var aid = ["invTit","invNum"];
1236		var acn = ["發票抬頭","統一編號"];
1237		var len = [2,7];
1238			
1239		end = aid.length;	
1240		for(var i=0; i<end; ++i)
1241		{
1242			ret = checkinput(aid[i], acn[i], len[i]);
1243			if (ret == false){
1244				return false;
1245			}	
1246		}
1247	}
1248	$("#step").val('GoodsAddOrder');
1249	$("#"+obj).attr("action", "shopData.html");
1250	$(_this).html("送出中..");
1251	$(_this).prop('disabled', true);	
1252	$(_this).prop('onclick',null).off('click');
1253	gosubmit(obj);
1254}
1255//document.onkeypress = showKeyPress;

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.