PageSourceSearch

https://gateway.staradvertiser.com/resources/scripts/js/resources.js

js staradvertiser.com collected 2026-09-24 08:28:55 UTC 5,203 bytes, 255 lines download raw bytes

1// -----------------------------------
2// GLOBAL RESOURCES
3// -----------------------------------
4
5// ####: Declarations and Variables
6var xmlHttp;
7
8
9
10// ###: Methods and Procedures
11
12//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13function getXmlHttpObject()
14{
15	var xmlHttp = null;
16	
17	try
18	{
19		// FireFox, Opera 8.0+, Safari
20		xmlHttp = new XMLHttpRequest();
21	}
22	catch(e)
23	{
24		try
25		{
26			// Internet Explorer
27			xmlHttp = new ActiveXObject("Msxml2.HMLHTTP");
28		}
29		catch(e)
30		{
31			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
32		}
33	}
34	
35	return xmlHttp;
36}
37
38//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39function swapClass(obj, cn)
40{
41		obj.className = cn;
42}
43
44function hideMsg(id)
45{
46	obj = document.getElementById(id);
47	if( obj && ( obj.style.display=='block' || obj.style.display=="" ) ) { 
48		document.getElementById(id).style.display = 'none'; 
49	}
50}
51
52function showMsg(id)
53{
54	obj = document.getElementById(id);
55	if( obj && ( obj.style.display=='none' || obj.style.display=="") ) { 
56		document.getElementById(id).style.display = 'block'; 
57	}
58}
59
60
61function verifyEmail(email)
62{
63	var status = false;     
64	var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
65	 if (email.search(emailRegEx) != -1) {
66		  status = true;
67	 }
68	 
69	 return status;
70}
71
72function nonAlpha(alpha)
73{
74	var status = false;     
75	var alphaRegEx = /^[a-zA-Z- ]+$/i;
76	if (alpha.search(alphaRegEx) == -1) {
77	  status = true;
78	}	 
79	return status;
80}
81
82function closeErr(errorDiv)
83{
84	var idx = 0;
85	var div = errorDiv.split(","); var obj = "";
86	for(idx = 0; idx < div.length; idx++)
87	{
88		obj = document.getElementById(div[idx]);
89		if (obj.style.display=="block") { obj.style.display="none"; }
90	}
91}
92
93function validZip(zipcode)
94{  
95	hideMsg("zipError");
96	
97	xmlHttp = getXmlHttpObject();
98	
99	if(xmlHttp===null)
100	{
101		alert("This browser does not support AJAX");
102		return;
103	}
104	
105	document.getElementById("zipError").innerHTML = "<span style=\"color:#090\">Validating zip code...</span>";
106	showMsg("zipError");
107	
108	var actionURL = "../../../validzip.php?zipcode="+zipcode;
109				
110	xmlHttp.onreadystatechange = displayZipResults;
111	xmlHttp.open("GET", actionURL, true);
112	xmlHttp.send(null);
113}
114
115function displayZipResults()
116{
117	if(xmlHttp.readyState == 4 && xmlHttp.status==200)
118	{
119		var response = xmlHttp.responseText;
120		var zipError = document.getElementById("zipError");
121		
122		var status = response.split(":");
123		
124		if (status[0]=="false")
125		{
126			zipError.innerHTML = status[1];
127		} else {
128			var saForm = document.getElementById("saNewSignup");
129			var saZip = document.getElementById("saZipCode");
130			var userZip = document.getElementById("userZipCode");
131			
132			saZip.value = userZip.value;
133			saForm.submit();
134		}
135	}
136}
137
138function validateZip(zipcode)
139{  
140	hideMsg("zipError");
141	
142	xmlHttp = getXmlHttpObject();
143	
144	if(xmlHttp===null)
145	{
146		alert("This browser does not support AJAX");
147		return;
148	}
149	
150	document.getElementById("zipError").innerHTML = "<span style=\"color:#090\">Validating zip code...</span>";
151	showMsg("zipError");
152	
153	var actionURL = "../../../validateZip.php?zipcode="+zipcode;
154				
155	xmlHttp.onreadystatechange = displayZipValidation;
156	xmlHttp.open("GET", actionURL, true);
157	xmlHttp.send(null);
158}
159
160function displayZipValidation()
161{
162	if(xmlHttp.readyState == 4 && xmlHttp.status==200)
163	{
164		var response = xmlHttp.responseText;
165		var zipError = document.getElementById("zipError");
166		
167		var status = response.split(":");
168		
169		if (status[0]=="false")
170		{
171			zipError.innerHTML = status[1];
172		} else {
173			var saForm = document.getElementById("saNewSignup");
174			var saZip = document.getElementById("saZipCode");
175			var userZip = document.getElementById("userZipCode");
176			var saOption = document.getElementById("saSignupOption");
177			
178			if (status[1]=="OA")
179			{
180				saOption.value = "combo";
181			} else {
182				saOption.value = "digital";
183			}
184			
185			saZip.value = userZip.value;
186			saForm.submit();
187		}
188	}
189}
190
191function getMainSubscriptionOffers( type )
192{
193
194	var combo = [
195					{
196						offerId: "1000484", 
197						offerName: "D-$19.95 FULL PRICE EZ PAY", 
198						termId: "1001404", 
199						price: "19.95", 
200						per: "month",
201						termAmount: "1", 
202						termUnit: "month"
203					},
204					{
205						offerId: "1001271", 
206						offerName: "D-$12.95 4DAY", 
207						termId: "1003398", 
208						price: "12.95", 
209						per: "month",
210						termAmount: "1", 
211						termUnit: "month"
212					}
213				];
214
215	var digital = [
216						{
217							offerId: "1003233", 
218							offerName: "$21.95 MO OAHU", 
219							termId: "1008476", 
220							price: "21.95", 
221							per: "month",
222							termAmount: "1", 
223							termUnit: "month"
224						},
225						{
226							offerId: "1003236", 
227							offerName: "$13.95 MO NI", 
228							termId: "1008481", 
229							price: "13.95", 
230							per: "month",
231							termAmount: "1", 
232							termUnit: "month"
233						},
234						{
235							offerId: "1003237", 
236							offerName: "$11.95 MO OUT OF STATE", 
237							termId: "1008485", 
238							price: "11.95", 
239							per: "month",
240							termAmount: "1", 
241							termUnit: "month"
242						}
243				  ];
244
245	if ( type == "combo" )
246	{
247		return combo;
248	} else if ( type == "digital" ) {
249		return digital
250	} else {
251		return combo.concat(digital);
252	}				  
253}
254
255

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.