PageSourceSearch

https://godinfo.net/scripts/page.js

js godinfo.net collected 2026-10-07 10:36:06 UTC 5,920 bytes, 207 lines download raw bytes

1
2/** 
3* 偵測螢幕判斷是否轉至手機版用
4********/
5	//螢幕寬度:screen.width
6	//螢幕高度:screen.height
7	//可瀏覽頁面寬度:screen.availWidth
8	//可瀏覽頁面高度:screen.availHeight
9	 // alert('寬:'+$(window).width()+' 高:'+$(window).height());
10var ua;
11$(document).ready(function() {   
12	var url=window.location.toString();
13	var str="";
14	var mode="w";
15	
16	var page=location.pathname;
17	
18	if(page!="/"&& page!="/yellowpage/" && page!="/index.html"  && page!="/yellowpage/index.html"){
19		mode = 'm'; //只有首頁需要轉 
20	}
21	
22	if(url.indexOf("?")!=-1){
23	   var ary=url.split("?")[1].split("&");
24	   for(var i in ary){
25		 if(ary[i].split("=")[0]=='m' && ary[i].split("=")[1]) {
26			mode = 'm';  // 不轉 
27		 }
28	  }
29	}	 
30	/*
31	if($(window).width() < 800 && $(window).height() < 600 && mode =='w'){ 
32	 location.href = {/literal}'{$mob_href}'{literal};
33	}
34	*/
35
36	ua = navigator.userAgent.toLowerCase();
37	if( use_redirect=='Y' && mode =='w' && (ua.match("iphone") || ua.match("ipod") || ua.match("android")|| ua.match("symbianos")|| ua.match("ios") || ua.match("blackberry")) && !ref_mob){
38		 location.href = mob_href; // 手機版
39	}  
40	
41	if (lock_mouse=='Y'){ 
42		document.oncontextmenu = function (event) { 
43				if (document.all)
44						window.event.returnValue = false; // for IE
45				else
46						event.preventDefault();
47		};
48		document.onselectstart = function (event) { 
49				if (document.all)
50						window.event.returnValue = false; // for IE
51				else
52						event.preventDefault();
53		};
54		document.onpaste = function (event) { 
55				if (document.all)
56						window.event.returnValue = false; // for IE
57				else
58						event.preventDefault();
59		};
60		document.oncopy = function (event) { 
61				if (document.all)
62						window.event.returnValue = false; // for IE
63				else
64						event.preventDefault();
65		};
66		document.oncut = function (event) { 
67				if (document.all)
68						window.event.returnValue = false; // for IE
69				else
70						event.preventDefault();
71		};
72	}
73	
74	
75
76  // 公司介紹地圖
77	$('#tipx').click(function(){	$('#maptip').hide();	});
78	$('#corp').click(	function(){	$('#maptip').toggle();}); 
79	 var max_w = $('.Content-body').width();
80
81	$(".Content-body img").load(function() {
82        if( this.width > max_w){
83            $(this).css({"max-width":max_w+"px","height":"auto"});
84        }
85    }).each(function(){
86        if(this.complete) $(this).trigger('load');
87    });
88 
89
90	if( window.location.href.indexOf("?fb=1")!=-1){
91 
92	$("html").css('background','#FFFFFF');
93	$("body").css('overflow-x','hidden');
94	$("body").css('background-color','#FFFFFF');
95	$('body').css('background-image','none');
96	$("#Tbody,#header,#container,#mainContent,#innermainContent").css('width','780px');
97	$("#sidebar").hide();
98
99	$('a').each(function() {
100			 var href = this.href;
101			 if(href.indexOf("?fb=1")==-1){
102							$(this).attr('href', href.replace(".html",".html?fb=1") );
103			}
104	});
105	FB.Canvas.setDoneLoading( function(response) {
106			FB.Canvas.setAutoGrow();
107	});
108}
109	
110});
111
112function gotoMOB(i){	
113	if ((ua.match("iphone") || ua.match("ipod") || ua.match("android")|| ua.match("symbianos")|| ua.match("ios") || ua.match("blackberry")) && !ref_mob){
114		location.href = mob_href;
115	}else{
116	 if(i) alert( alert_mob + org_href );
117	}
118} 
119	
120	
121/** 
122* 調整畫面高度用
123********/	
124$( document ).ready(function() {
125        init();
126        setTimeout(function(){ init(); }, 2000);
127		window.addEventListener('scroll', function(){ init();}, true);
128});
129function init() { 
130 if(document.getElementById("innermainContent")&& document.getElementById("sidebar") ){
131	 document.getElementById("sidebar").style.height="";
132	 document.getElementById("mainContent").style.height="";
133	 if( document.getElementById("innermainContent").clientHeight > document.getElementById("sidebar").clientHeight){
134			document.getElementById("sidebar").style.height = document.getElementById("innermainContent").clientHeight+'px';
135	 }else{
136			document.getElementById("mainContent").style.height = document.getElementById("sidebar").clientHeight+'px';
137	 }
138 }
139} 
140
141function nowinit() {
142	if(document.getElementById("cglist") && document.getElementById("cglist").style.display=="none") document.getElementById("cglist").style.display="block";
143	else  document.getElementById("cglist").style.display="none";
144	init();//調整sidebar&mainContent高度
145}
146function nowinitenews() {
147	if(document.getElementById("subenews") && document.getElementById("subenews").style.display=="none") document.getElementById("subenews").style.display="block";
148	else  document.getElementById("subenews").style.display="none";
149	init();//調整sidebar&mainContent高度
150}
151function nowinithot() {
152	if(document.getElementById("hotlist") && document.getElementById("hotlist").style.display=="none") document.getElementById("hotlist").style.display="block";
153	else  document.getElementById("hotlist").style.display="none";
154	init();//調整sidebar&mainContent高度
155}
156
157
158
159/** 
160* 訂閱電子報用
161********/
162
163// 檢查欄位
164function checkSubFields() {
165   var labels = {
166      subemail:   "Email" 
167   };
168
169   var fmts = {
170      sbuemail:   /.+@.+/ 
171   };
172
173   var message = "";
174   var f = document.forms['sub'];
175
176 
177
178   for(k in fmts) {
179        
180      if(!fmts[k].test( f.elements[k].value)) {  
181         message += labels[k]+"格式不對喔";  
182      }
183   } 
184   
185   return message;
186   
187}
188
189function clickSub(){
190var message = checkSubFields();
191
192   if(message){ alert(message); return false;}
193   else{ 
194     alert('認證信已寄到您的信箱,請在24小時內確認!!'); 
195     return true;
196   }
197}
198
199function clickDesub(){
200var message = checkSubFields();
201   if(message){ alert(message); return false;}
202   else{ 
203     alert('已取消訂閱電子報!!');  
204     return true;
205   }
206}
207 

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.