PageSourceSearch

https://highresponsemarketing.com/dap/javascript/common.js?ver=7.1.1

js highresponsemarketing.com collected 2026-09-25 02:59:34 UTC 9,079 bytes, 323 lines download raw bytes

1function getCheckedValue(radioObj) {
2	if(!radioObj)
3		return "";
4	var radioLength = radioObj.length;
5	if(radioLength == undefined)
6		if(radioObj.checked)
7			return radioObj.value;
8		else
9			return "";
10	for(var i = 0; i < radioLength; i++) {
11		if(radioObj[i].checked) {
12			return radioObj[i].value;
13		}
14	}
15	return "";
16}
17
18function setCheckedValue(radioObj, newValue) {
19	if(!radioObj)
20		return;
21	var radioLength = radioObj.length;
22	if(radioLength == undefined) {
23		radioObj.checked = (radioObj.value == newValue.toString());
24		return;
25	}
26	for(var i = 0; i < radioLength; i++) {
27		radioObj[i].checked = false;
28		if(radioObj[i].value == newValue.toString()) {
29			radioObj[i].checked = true;
30		}
31	}
32}
33
34function validateEmailJS(email) {
35	var email = trim(email); // value of field with whitespace trimmed off
36	var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
37	var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ;
38
39	if (email == "") {
40		return false;
41	} else if (!emailFilter.test(email)) { //test for valid email format
42		return false;
43	} else if (email.match(illegalChars)) { // test for illegal characters
44		return false;
45	}
46
47	return true;
48}
49
50function clearDefaultText(form) {
51	if ( form.coupon_code.value == "(optional)" ) {
52		form.coupon_code.value = "";
53	}
54}
55
56function resetDefaultText(form) {
57	if ( form.coupon_code.value == "" ) {
58		form.coupon_code.value = "(optional)";
59	}
60}
61
62
63var IE = document.all ? true:false;
64if (!IE) document.captureEvents(Event.MOUSEMOVE);
65document.onmousemove = getMouseXY;
66var mouseX = 0;
67var mouseY = 0;
68
69function getMouseXY(e) {
70	if (IE) { // grab the x-y pos.s if browser is IE
71		mouseX = event.clientX + document.body.scrollLeft;
72		mouseY = event.clientY + document.body.scrollTop;
73	}
74	else {  // grab the x-y pos.s if browser is NS
75		mouseX = e.pageX;
76		mouseY = e.pageY;
77	}  
78	if (mouseX < 0){mouseX = 0;}
79	if (mouseY < 0){mouseY = 0;}  
80	//document.Show.MouseX.value = mouseX;
81	//document.Show.MouseY.value = mouseY;
82}
83
84//jQuery.noConflict();
85//jQuery(document).ready(function($) {
86//});    
87
88function toggleImageAndDiv(cid){
89	if (document.getElementById("expando_"+cid)) {
90		if (document.getElementById("expando_"+cid).className=="expando") { 
91			document.getElementById("expando_"+cid).className="expando3";
92			showDiv(cid);
93		} else { 
94			document.getElementById("expando_"+cid).className="expando";
95			hideDiv(cid);
96		}
97	}
98}
99
100function toggleImage(cid){
101	showDiv(cid);
102	document.getElementById("expando_"+cid).className="expando3";
103}
104
105function validatePassword(password) {
106 
107	for(j=0; j<password.length; j++) {
108	  if(parseInt(password[j])) continue;
109	   var pattern = /^[a-zA-Z_0-9@\#"<=>_\$\^%()*!&+;`\-[]\\\',\.\/\{\}\|\:\? ]+$/;
110	  if (pattern.test(password[j])) continue;
111 
112	} //end for
113
114	return true;
115}
116
117function isValidURL(url){
118	//var RegExp = /^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/;
119	var RegExp = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
120
121	if(url.substring(0,4) != "http") {
122		alert("Sorry, the URL must begin with 'http://...'")
123		return false;
124	}
125	
126	if(url.substring(0,16) == "http://localhost") {
127		//testing purposes only - for localhost deployment
128		return true;
129	}
130	
131	if( RegExp.test(url) ){
132		return true;
133	} else {
134		alert("Sorry, that is an invalid URL. Please enter a valid URL.")
135	}
136}
137
138function modButton(btn) {
139	btn.value = "Pls wait...";
140	btn.disabled = true;
141}
142
143function unModButton(btn, txt) {
144	btn.value = txt;
145	btn.disabled = false;
146}
147
148function showLongProgressBar(divName, txt){
149	document.getElementById(divName).innerHTML = txt + '<img src="/dap/images/progressbar.gif">';
150}
151
152function showRoundProgressBar(divName, txt){
153	document.getElementById(divName).innerHTML = txt + '<img src="/dap/images/progressbar-round.gif">';
154}
155
156function changeDiv(divName,input) {
157	document.getElementById(divName).innerHTML = input;
158}
159
160function clearDiv(divName) {
161	var divNameElem = document.getElementById(divName);
162	if(divNameElem) {
163		document.getElementById(divName).innerHTML = "";
164	}
165}
166
167function toggleDiv(input) {
168	var divName = document.getElementById(input);
169	if(divName.style.display == "none") {
170		divName.style.display = "block"; //to hide it
171	} else if(divName.style.display == "block") {
172		divName.style.display = "none"; //to show it
173	}
174	return false;
175}
176
177function showDiv(input) {
178	var divName = document.getElementById(input);
179	divName.style.display = "block"; //to show it
180}
181
182function hideDiv(input) {
183	var divName = document.getElementById(input);
184	divName.style.display = "none"; //to hide it
185}
186
187function trim(str, chars) {
188    return ltrim(rtrim(str, chars), chars);
189}
190
191function ltrim(str, chars) {
192    chars = chars || "\\s";
193    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
194}
195
196function rtrim(str, chars) {
197    chars = chars || "\\s";
198    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
199}
200
201//Start Fader Script
202/*************************************************************
203* NLB Background Color Fader v1.0
204* Author: Justin Barlow - www.netlobo.com
205*
206* Description:
207* The Background Color Fader allows you to gradually fade the
208* background of any HTML element.
209*
210* Usage:
211* Call the Background Color Fader as follows:
212*   NLBfadeBg( elementId, startBgColor, endBgColor, fadeTime );
213*
214* Description of Parameters
215*   elementId - The id of the element you wish to fade the
216*             background of.
217*   startBgColor - The background color you wish to start the
218*             fade from.
219*   endBgColor - The background color you want to fade to.
220*   fadeTime - The duration of the fade in milliseconds.
221*************************************************************/
222
223var nlbFade_hextable = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' ]; // used for RGB to Hex and Hex to RGB conversions
224var nlbFade_elemTable = new Array( ); // global array to keep track of faded elements
225var nlbFade_t = new Array( ); // global array to keep track of fading timers
226function NLBfadeBg( elementId, startBgColor, endBgColor, fadeTime )
227{
228	var timeBetweenSteps = Math.round( Math.max( fadeTime / 300, 30 ) );
229	var nlbFade_elemTableId = nlbFade_elemTable.indexOf( elementId );
230	if( nlbFade_elemTableId > -1 )
231	{
232		for( var i = 0; i < nlbFade_t[nlbFade_elemTableId].length; i++ )
233			clearTimeout( nlbFade_t[nlbFade_elemTableId][i] );
234	}
235	else
236	{
237		nlbFade_elemTable.push( elementId );
238		nlbFade_elemTableId = nlbFade_elemTable.indexOf( elementId );
239	}
240	var startBgColorRGB = hexToRGB( startBgColor );
241	var endBgColorRGB = hexToRGB( endBgColor );
242	var diffRGB = new Array( );
243	for( var i = 0; i < 3; i++ )
244		diffRGB[i] = endBgColorRGB[i] - startBgColorRGB[i];
245	var steps = Math.ceil( fadeTime / timeBetweenSteps );
246	var nlbFade_s = new Array( );
247	for( var i = 1; i <= steps; i++ )
248	{
249		var changes = new Array( );
250		for( var j = 0; j < diffRGB.length; j++ )
251			changes[j] = startBgColorRGB[j] + Math.round( ( diffRGB[j] / steps ) * i );
252		if( i == steps )
253			nlbFade_s[i - 1] = setTimeout( 'document.getElementById("'+elementId+'").style.backgroundColor = "'+endBgColor+'";', timeBetweenSteps*(i-1) );
254		else
255			nlbFade_s[i - 1] = setTimeout( 'document.getElementById("'+elementId+'").style.backgroundColor = "'+RGBToHex( changes )+'";', timeBetweenSteps*(i-1) );
256	}
257	nlbFade_t[nlbFade_elemTableId] = nlbFade_s;
258}
259function hexToRGB( hexVal )
260{
261	hexVal = hexVal.toUpperCase( );
262	if( hexVal.substring( 0, 1 ) == '#' )
263		hexVal = hexVal.substring( 1 );
264	var hexArray = new Array( );
265	var rgbArray = new Array( );
266	hexArray[0] = hexVal.substring( 0, 2 );
267	hexArray[1] = hexVal.substring( 2, 4 );
268	hexArray[2] = hexVal.substring( 4, 6 );
269	for( var k = 0; k < hexArray.length; k++ )
270	{
271		var num = hexArray[k];
272		var res = 0;
273		var j = 0;
274		for( var i = num.length - 1; i >= 0; i-- )
275			res += parseInt( nlbFade_hextable.indexOf( num.charAt( i ) ) ) * Math.pow( 16, j++ );
276		rgbArray[k] = res;
277	}
278	return rgbArray;
279}
280function RGBToHex( rgbArray )
281{
282	var retval = new Array( );
283	for( var j = 0; j < rgbArray.length; j++ )
284	{
285		var result = new Array( );
286		var val = rgbArray[j];
287		var i = 0;
288		while( val > 16 )
289		{
290			result[i++] = val%16;
291			val = Math.floor( val/16 );
292		}
293		result[i++] = val%16;
294		var out = '';
295		for( var k = result.length - 1; k >= 0; k-- )
296			out += nlbFade_hextable[result[k]];
297		retval[j] = padLeft( out, '0', 2 );
298	}
299	out = '#';
300	for( var i = 0; i < retval.length; i++ )
301		out += retval[i];
302	return out;
303}
304if (!Array.prototype.indexOf) {
305	Array.prototype.indexOf = function( val, fromIndex ) {
306		if( typeof( fromIndex ) != 'number' ) fromIndex = 0;
307		for( var index = fromIndex, len = this.length; index < len; index++ )
308			if( this[index] == val ) return index;
309		return -1;
310	}
311}
312function padLeft( string, character, paddedWidth )
313{
314	if( string.length >= paddedWidth )
315		return string;
316	else
317	{
318		while( string.length < paddedWidth )
319			string = character + string;
320	}
321	return string;
322}
323//End Fader Script

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.