PageSourceSearch

https://www.dataaccess.com/js/function.js

js dataaccess.com collected 2026-10-02 04:06:11 UTC 8,626 bytes, 277 lines download raw bytes

1function OpenWin(psurl) {
2    win = window.open(psurl);
3}
4
5function getElementAbsPosX(el)
6{
7    var dx = 0;
8    if (el.offsetParent) {
9		dx = el.offsetLeft + 8;
10		while (el = el.offsetParent) {
11		    dx += el.offsetLeft;
12		}
13    }
14    return dx;
15}
16
17function getElementAbsPosY(el, foo)
18{
19    var dy = 0;
20    if (el.offsetParent) {
21		dy = el.offsetTop + el.offsetHeight / 2;
22		while (el = el.offsetParent) {
23		    if (foo == 0)
24			dy += el.offsetTop;
25		}
26    }
27    return dy;
28}
29
30// when an embedded label is clicked, force focus to input field.
31function ChangeFocus(el)
32{	
33	while (el.tagName != 'INPUT') 
34	{		
35		el = el.previousSibling;	
36		if (el.tagName == 'SPAN') el = el.firstChild;			
37	}  
38	el.focus();
39}
40
41// OnChange of an input field, set the label's visibility based on value of the input field.
42function UpdateHelpText(el){
43  var label = document.getElementById("label_"+el.name);
44  if (label) {
45    if (el.value == '') {
46      label.style.visibility = 'visible';
47    }
48    else {
49      label.style.visibility = 'hidden';
50    }
51  }
52}
53
54// page may not have these objects if user is logged in or login ability is disabled.
55function showEmbLabel(){
56  var oLogin = document.getElementById("member_loginid");
57  var oPassword = document.getElementById("member_password");
58  if (oLogin){ UpdateHelpText(oLogin); }
59  if (oPassword){ UpdateHelpText(oPassword); }
60}
61
62function doResize()
63{
64	document.getElementById('content').style.width=(document.body.offsetWidth>400)?document.body.offsetWidth-400+'px':'0px';
65	document.getElementById('column1').style.height=document.getElementById('content').offsetHeight+50+'px'
66}
67
68function doSubmit(event, theForm)
69{		
70	for (i=0; i<theForm.elements.length; i++){
71		if (theForm.elements[i].type == "text" || theForm.elements[i].type == "textarea" || theForm.elements[i].type == "password" ){
72			if (theForm.elements[i].getAttribute('required') == "required" && theForm.elements[i].value == ""){
73				alert("Please fill in all required fields.");
74				return false;
75			}
76			if (theForm.elements[i].getAttribute('validate') == 'false'){
77				alert("Please fill valid entries.");
78				return false;
79			}
80		}
81	}
82	theForm.submit();
83}    
84
85function toggleShipping(bState)
86{
87	bState=!bState;
88	if (document.getElementById('oShipping_Name')){
89		document.getElementById('oShipping_Name').disabled = bState;
90	}
91	if (document.getElementById('oShip_Street1')){
92		document.getElementById('oShip_Street1').disabled = bState;
93	}
94	if (document.getElementById('oShip_Street2')){
95		document.getElementById('oShip_Street2').disabled = bState;
96	}
97	if (document.getElementById('oShip_City')){
98		document.getElementById('oShip_City').disabled = bState;
99	}
100	if (document.getElementById('oShip_State')){
101		document.getElementById('oShip_State').disabled = bState;
102	}
103	if (document.getElementById('oShip_Zip')){
104		document.getElementById('oShip_Zip').disabled = bState;
105	}
106	if (document.getElementById('oShip_Country')){
107		document.getElementById('oShip_Country').disabled = bState;
108	}
109	if (document.getElementById('oShip_Phone')){
110		document.getElementById('oShip_Phone').disabled = bState;
111	}
112}
113
114function sitemap()
115{
116	var oSitemap = document.getElementById("sitemap")
117	if(oSitemap){
118		
119		this.listItem = function(li){
120			if(li.getElementsByTagName("ul").length > 0){
121				var ul = li.getElementsByTagName("ul")[0];
122				ul.style.display = "none";
123				var span = document.createElement("span");
124				span.className = "collapsed";
125				span.onclick = function(){
126					ul.style.display = (ul.style.display == "none") ? "block" : "none";
127					this.className = (ul.style.display == "none") ? "collapsed" : "expanded";					
128					doResize();
129				};
130				li.appendChild(span);
131			};
132		};
133		
134		var aItems = oSitemap.getElementsByTagName("li");
135		for(var i=0;i<aItems.length;i++){
136			listItem(aItems[i]);
137		};
138		
139	};	
140};
141
142function insertSmiley(text)
143{
144	var textarea = document.forms['globalForm'].comments;
145	text = ' ' + text + ' ';
146	
147	//check if text length limit for textarea is not exceeding 5000 characters
148	if ((text.length + textarea.value.length) <= 5000)
149	{
150		// Attempt to create a text range (IE).
151		if ((textarea.caretPos != null) && (textarea.createTextRange != null))
152		{
153			var caretPos = textarea.caretPos;
154
155			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
156			caretPos.select();
157		}	
158		// Firefox text range replace.
159		else if (textarea.selectionStart != null)
160		{	
161			var begin = textarea.value.substr(0, textarea.selectionStart);
162			var end = textarea.value.substr(textarea.selectionEnd);
163			var scrollPos = textarea.scrollTop;        
164			
165			textarea.value = begin + text + end;
166
167			if (textarea.setSelectionRange)
168			{
169				textarea.focus();
170				textarea.setSelectionRange(begin.length + text.length, begin.length + text.length);
171			}
172			
173			textarea.scrollTop = scrollPos;		
174		}	
175		else
176		{		
177			textarea.value += text;
178			textarea.focus(textarea.value.length - 1);	
179		}
180	}
181	
182	var iCharsRemaining = 5000 - textarea.value.length;
183	document.getElementById('countdown').innerHTML = "[" + iCharsRemaining + "/" + 5000 + "]";	
184} 
185
186function HideMoreSmileys(){
187	document.getElementById('MoreSmilies').style.display="none";
188}
189
190function smileysToggle(){
191	var oExpandSmilyes =document.getElementById("ExpandSmilies"); 
192	var oMoreSmilies =document.getElementById("MoreSmilies"); 
193	if(oMoreSmilies.style.display=="none"){ 
194		oMoreSmilies.style.display="block";
195		oExpandSmilyes.className = 'expanded';
196	} else {
197		oMoreSmilies.style.display="none";
198		oExpandSmilyes.className = '';
199	}
200}
201
202function RefreshImage(valImageId) 
203{
204	var objImage = document.images[valImageId];
205	if (objImage == undefined) {
206		return;
207	}
208	var now = new Date();
209	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
210}
211	
212function limitText(limitField, limitCount, limitNum) {	
213	if (limitField.value.length > limitNum) {
214		limitField.value = limitField.value.substring(0, limitNum);
215	} else {
216		var iCharsRemaining = limitNum - limitField.value.length;
217		limitCount.innerHTML = "[" + iCharsRemaining + "/" + limitNum + "]";
218	}
219}
220
221function verifyField(theField,bOnLoad) {                 
222	var pattern=/[A-Z]/i;
223	var validation=theField.getAttribute('validate');
224	var required = theField.getAttribute('required');
225	if (theField.value!=''||validation=='') {                                             
226		if (theField.id=='authorname') {
227			theField.setAttribute('validate','true');
228			pattern = /[A-Z0-9]/i
229		}
230		if (theField.id=='authorURL') {                                              
231			theField.value =theField.value.replace(' ','');        
232			pattern = /([\w-]+\.)+[\w-]+([\w- .\/?%&=]*)/i;                                            
233		}  
234		if (theField.id=='oEmail') {                                              
235			theField.value =theField.value.replace(' ','');        
236			pattern = /^\S+@\S+\.\S+$/;                                            
237		} 
238		if (pattern.test(theField.value) || (theField.id== "comments" && theField.value!='')) {                          
239			theField.setAttribute('validate','true');
240			if (!bOnLoad) {
241				theField.style.boxShadow = '';				
242				theField.style.filter ="progid:DXImageTransform.Microsoft.Shadow(color='white', Direction= 135, Strength=2)"; 
243			}
244			validated = true;                        
245		}
246		else {                           
247			theField.setAttribute('validate','false');
248			if (!bOnLoad) {
249				theField.style.boxShadow = '0 0 1.5px 1px red';				
250				theField.style.filter ="progid:DXImageTransform.Microsoft.Shadow(color='red', Direction= 135, Strength=2)"; 
251			}
252			validated = false;
253		}
254	}
255	else if(theField.value == '' && required == "required") {
256		theField.setAttribute('validate','false');
257		if (!bOnLoad){
258			theField.style.boxShadow = '0 0 1.5px 1px red';				
259			theField.style.filter ="progid:DXImageTransform.Microsoft.Shadow(color='red', Direction= 135, Strength=2)";
260		}
261		validated=false;		
262	}
263	else {                           
264		theField.setAttribute('validate','true');
265		if (!bOnLoad){
266			theField.style.boxShadow = '';			
267			theField.style.filter ="progid:DXImageTransform.Microsoft.Shadow(color='white', Direction= 135, Strength=2)";
268		}
269		validated =true;
270
271	}
272	return validated;
273}
274
275function CallLimitText(){
276	setTimeout(function() {limitText(document.getElementById('comments'), document.getElementById('countdown'), 5000);}, 50);
277}

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.