PageSourceSearch

https://www.gddinstruments.com/components/com_proforms/js/underline.js

js gddinstruments.com collected 2026-10-04 13:23:49 UTC 16,148 bytes, 651 lines download raw bytes

1// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2// @license: Mad4Media Javascipt License - copyright Mad4Media - Fahrettin Kutyol - All rights reserved    ++
3// (re-) publishing or forking for any purpose of commercial or non-commercial use is not allowed.		   ++
4// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5
6var _d = document;
7var _db ;
8dojo.addOnLoad(function(){_db = _d.body});
9var head = document.getElementsByTagName("head")[0];
10
11var _Browser = {
12	IE :!!(window.attachEvent && navigator.userAgent.indexOf('Opera') === -1),
13	Opera :navigator.userAgent.indexOf('Opera') > -1,
14	WebKit :navigator.userAgent.indexOf('AppleWebKit/') > -1,
15	Gecko :navigator.userAgent.indexOf('Gecko') > -1
16			&& navigator.userAgent.indexOf('KHTML') === -1,
17	MobileSafari :!!navigator.userAgent.match(/Apple.*Mobile.*Safari/),
18	IEVersion : function getInternetExplorerVersion() {
19		var rv = -1; // Return value assumes failure.
20		if (navigator.appName == 'Microsoft Internet Explorer') {
21			var ua = navigator.userAgent;
22			var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
23			if (re.exec(ua) != null)
24				rv = parseFloat(RegExp.$1);
25		}
26		return rv;
27	}
28}
29
30var _OS = {
31		Win :  (navigator.appVersion.indexOf("Win")!=-1),
32		Mac :  (navigator.appVersion.indexOf("Mac")!=-1),
33		Linux: (navigator.appVersion.indexOf("Linux")!=-1)
34}
35
36
37function _(e) {
38	return dojo.byId(e);
39}
40function _S(e) {
41	return _(e).style;
42}
43function _Style(n, s, v) {
44	return (v) ? dojo.style(n, s, v) : dojo.style(n, s);
45}
46
47function _D(e,s){
48	_(e).style.display = s ? "block":"none";
49}
50
51function _newElement(e) {
52	return _d.createElement(e);
53}
54function _newElement2Body(e, s, cN, id) {
55	n = _newElement(e);
56	n.className = cN;
57	_Style(n, s);
58	n.id = id;
59	_d.body.appendChild(n);
60	return n;
61}
62function _removeNode(node){
63	node.parentNode.removeChild(node);
64}
65
66
67function _ToggleDisplay(e, hi) {
68	hi = (hi) ? hi : "block";
69	_S(e).display = (_S(e).display == "none") ? hi : "none";
70}
71function _ToggleVisibility(e) {
72	hi = _S(e).visibility = (_S(e).visibility == "hidden") ? "visible"
73			: "hidden";
74}
75function _ToggleFade(e) {
76	if (_S(e).opacity == 0)
77		dojo.fadeIn( {
78			node :_(e)
79		}).play();
80	else
81		dojo.fadeOut( {
82			node :_(e)
83		}).play();
84}
85
86function funcExists(funcName){
87	var isset;
88	   try {
89	      eval("isset=typeof "+funcName+" == 'function';");
90	   } catch (e) {
91	      isset=false;
92	   }
93	   return isset;
94}
95
96function _WindowSize() {
97	var w = 0;
98	var h = 0;
99
100	// IE
101	if (!window.innerWidth) {
102		// strict mode
103		if (!(document.documentElement.clientWidth == 0)) {
104			w = document.documentElement.clientWidth;
105			h = document.documentElement.clientHeight;
106		}
107		// quirks mode
108		else {
109			w = document.body.clientWidth;
110			h = document.body.clientHeight;
111		}
112	}
113	// w3c
114	else {
115		w = window.innerWidth;
116		h = window.innerHeight;
117	}
118	return {
119		width :w,
120		height :h
121	};
122}// EOF window.size
123
124function _WindowCenter() {
125	var hWnd = (arguments[0] != null) ? arguments[0] : {
126		width :0,
127		height :0
128	};
129
130	var _x = 0;
131	var _y = 0;
132	var offsetX = 0;
133	var offsetY = 0;
134
135	// IE
136	if (!window.pageYOffset) {
137		// strict mode
138		if (!(document.documentElement.scrollTop == 0)) {
139			offsetY = document.documentElement.scrollTop;
140			offsetX = document.documentElement.scrollLeft;
141		}
142		// quirks mode
143		else {
144			offsetY = document.body.scrollTop;
145			offsetX = document.body.scrollLeft;
146		}
147	}
148	// w3c
149	else {
150		offsetX = window.pageXOffset;
151		offsetY = window.pageYOffset;
152	}
153
154	_x = ((_WindowSize().width - hWnd.width) / 2) + offsetX;
155	_y = ((_WindowSize().height - hWnd.height) / 2) + offsetY;
156
157	return {
158		x :_x,
159		y :_y
160	};
161}
162
163var _AbsoluteBounds = function(element) {
164	var valueT = 0, valueL = 0;
165	do {
166		valueT += element.offsetTop || 0;
167		valueL += element.offsetLeft || 0;
168		element = element.offsetParent;
169		if (element) {
170			if (element.tagName.toUpperCase() == 'BODY')
171				break;
172			var p = element.style.position;
173			if (p !== 'static')
174				break;
175		}
176	} while (element);
177
178	var dim = _Dimensions(element);
179	var bounds = new Object();
180	bounds.l = valueL;
181	bounds.t = valueT;
182	bounds.w = dim.width;
183	bounds.h = dim.height;
184	return bounds;
185}
186
187function _Dimensions(element) {
188
189	var els = dojo.getComputedStyle(dojo.byId(element));
190	var display = els.display;
191
192	element = _(element);
193	if (display != 'none' && display != null) // Safari bug
194		return {
195			width :element.offsetWidth,
196			height :element.offsetHeight
197		};
198
199	// All *Width and *Height properties give 0 on elements with display none,
200	// so enable the element temporarily
201
202	var stl = _S(element);
203	var originalVisibility = els.visibility;
204	var originalPosition = els.position;
205	var originalDisplay = els.display;
206	els.visibility = 'hidden';
207	els.position = 'absolute';
208	els.display = 'block';
209	var originalWidth = element.clientWidth;
210	var originalHeight = element.clientHeight;
211	els.display = originalDisplay;
212	els.position = originalPosition;
213	els.visibility = originalVisibility;
214	return {
215		width :originalWidth,
216		height :originalHeight
217	};
218}
219
220function _ViewportOffset(forElement, noAddScroll) {
221	var addScroll = noAddScroll ? false : true;
222	var valueT = 0, valueL = 0;
223	var element = forElement;
224	do {
225		valueT += element.offsetTop || 0;
226		valueL += element.offsetLeft || 0;
227
228		// Safari fix
229		if (element.offsetParent == document.body
230				&& element.style.position == 'absolute')
231			break;
232
233	} while (element = element.offsetParent);
234
235	element = forElement;
236	do {
237		if (!_Browser.Opera
238				|| (element.tagName && (element.tagName.toUpperCase() == 'BODY'))) {
239			valueT -= element.scrollTop || 0;
240			valueL -= element.scrollLeft || 0;
241		}
242	} while (element = element.parentNode);
243
244	var scroll = _cumulativeScrollOffset(forElement);
245	var dim = dojo.coords(forElement);
246	var bounds = new Object();
247	bounds.l = valueL + (addScroll ? scroll.left : 0);
248	bounds.t = valueT + (addScroll ? scroll.top : 0);
249	bounds.w = dim.w;
250	bounds.h = dim.h;
251	return bounds;
252}
253function _cumulativeScrollOffset(element) {
254	element = _(element);
255	var valueT = 0, valueL = 0;
256	do {
257		valueT += element.scrollTop || 0;
258		valueL += element.scrollLeft || 0;
259		element = element.parentNode;
260	} while (element);
261	return {
262		left :valueL,
263		top :valueT
264	};
265}
266
267function _docScroll(){
268	var doc = document.documentElement, body = document.body;
269	var left = (doc && doc.scrollLeft || body && body.scrollLeft || 0);
270	var top = (doc && doc.scrollTop  || body && body.scrollTop  || 0);
271	
272	return {
273		left :left,
274		top :top
275	};
276
277}
278
279
280
281function _Percent(number,percent,round){
282	return round?Math.round((number*percent/100)):(number*percent/100);
283}
284
285Array.prototype.in_array = function(needle) {
286	for(var i=0; i < this.length; i++) if(this[ i] === needle) return true;
287	return false;
288	};
289
290String.prototype.startsWith = function(pattern) {
291    return this.indexOf(pattern) === 0;
292};
293
294String.prototype.endsWith =  function(pattern) {
295  var d = this.length - pattern.length;
296  return d >= 0 && this.lastIndexOf(pattern) === d;
297};
298
299var removeScript = new Array();
300function script2head(node){
301	
302	for(t=0;t<removeScript.length;t++){
303		_removeNode(removeScript[t]); 
304	}
305	removeScript = new Array();
306	
307	 var scriptArray = node.getElementsByTagName("script");
308	 var headArray = head.getElementsByTagName("script");
309	 var sourceArray = new Array();
310	 var noneSourceArray = new Array();
311	 
312	 for(t=0;t<headArray.length;t++){
313		 var source = headArray[t].src;
314		 if(source){
315			 sourceArray.push(source);
316		 }else{
317			 noneSourceArray.push(headArray[t]); 
318		 }
319	 }
320	 
321	 var nsaLength = noneSourceArray.length;
322
323     var totalScripts = scriptArray.length;
324     if (totalScripts!= 0) {
325    	 for(i=0; i< totalScripts;i++){
326    		 
327    		 var src = scriptArray[0].getAttribute("src");
328    		 var itemInnerHTML = scriptArray[0].innerHTML;
329    		 var isNew = true;
330    		 if(sourceArray.in_array(src)){
331    			 isNew = false;
332    		 }else{
333    			 for(t=0; t<nsaLength; t++){
334    				 if(noneSourceArray[t].innerHTML == itemInnerHTML){
335    					 isNew = false;
336    					 break;
337    				 }
338    			 }
339    		 }
340        	 if(isNew){
341        		 	 var script = document.createElement("script");
342                     script.setAttribute("language", "JavaScript");
343                     script.setAttribute("type", "text/javascript");
344                     
345                     if(src != undefined){
346                   	  script.setAttribute("src", src);
347                     } 
348                     var scriptInner = document.createTextNode(itemInnerHTML);
349                     
350                     if(_Browser.IE){
351                    	 script.text = itemInnerHTML; 
352                     }else {
353                    	 script.appendChild(scriptInner);
354                     }
355        		 
356        		 
357                     head.appendChild(script); 
358                     var noCache = scriptArray[0].getAttribute("noCache");
359            		 if(noCache=="true" || noCache =="1"){
360            			 removeScript.push(script);
361            		 }
362                 
363        	 }
364              _removeNode(scriptArray[0]);             
365         }
366     }
367}
368
369
370getKidsByTagName = function(object,tagname){
371	if(object==null) return null;
372	var returnArray = new Array();
373	var c = object.firstChild;
374	if(c!= undefined ){
375		if( c.nodeName == tagname){
376			returnArray.push(c);
377		}
378		while(c=c.nextSibling){
379			if(c.nodeName== tagname){
380				returnArray.push(c);
381			}
382		}
383	}else return null;
384	if(returnArray.length==0) return null;
385	return returnArray;
386}
387
388function nextTag(startNode,tag){
389	var node = startNode;
390	while(node = node.nextSibling){
391		if(node.tagName==tag){
392			return node;
393		}
394	}
395	return undefined;
396}
397
398function previousTag(startNode,tag){
399	var node = startNode;
400	while(node = node.previousSibling){
401		if(node.tagName==tag){
402			return node;
403		}
404	}
405	return undefined;
406}
407
408
409
410
411
412
413String.prototype.stripTags = function (){
414	return this.replace(/(<([^>]+)>)/ig,""); 
415	}
416
417
418function _LoadTo(href,node,success,error){
419	mWait.play();
420	var lcb = dojo.hitch(this,function(response,ioArgs){
421		_(node).innerHTML = response;
422		mWait.stop();
423		if(success){
424			success(response);
425		}
426		return true;
427	});
428	
429	var errBack = dojo.hitch(this,function(response,ioArgs){
430		
431		mWait.stop();
432		if(error){
433			error();
434		}
435		return false;
436	});
437	
438	return dojo.xhrGet({
439	    url: href,
440	    load: lcb,
441	    error: errBack
442	});	
443	
444}
445
446var _fx = {
447	animateDim: function(node,duration,widthStart,widthEnd,widthUnit,heightStart,heightEnd,heightUnit,onEnd){
448
449	if(!node) return false;
450	
451	var props = new Object();
452	if(widthEnd !=undefined){
453		props.width = new Object();
454		if(widthStart !=undefined) props.width.start = widthStart;
455		props.width.end = widthEnd;
456		props.width.unit = widthUnit || "px";
457	}
458	
459	if(heightEnd !=undefined){
460		props.height = new Object();
461		if(heightStart !=undefined) props.height.start = heightStart;
462		props.height.end = heightEnd;
463		props.height.unit = heightUnit || "px";
464	}
465	if(onEnd==undefined) onEnd = function(){return true;};
466	
467		dojo.animateProperty( {
468			node : node,
469			duration :duration,
470			properties :props,
471		 onEnd: onEnd
472		}).play();	
473		
474		return true;
475	},
476	animToHeight: function(node, duration, heightEnd, onEnd){
477		this.animateDim(node, duration, undefined, undefined, undefined, undefined, heightEnd, "px", onEnd);
478	},
479	animToWidth: function(node, duration, widthtEnd, onEnd){
480		this.animateDim(node, duration, undefined, widthtEnd, "px", undefined, undefined, undefined, onEnd);
481	},
482	animatePosition: function(node,duration,leftStart,leftEnd,leftUnit,topStart,topEnd,topUnit,onEnd){
483		if(!node) return false;		
484		var props = new Object();
485		if(leftEnd !=undefined){
486			props.left = new Object();
487			if(leftStart !=undefined) props.left.start = leftStart;
488			props.left.end = leftEnd;
489			props.left.unit = leftUnit || "px";
490		}
491		
492		if(topEnd !=undefined){
493			props.top = new Object();
494			if(topStart !=undefined) props.top.start = topStart;
495			props.top.end = topEnd;
496			props.top.unit = topUnit || "px";
497		}
498		if(onEnd == undefined) onEnd = function(){return true;};
499		
500		dojo.animateProperty( {
501			node : node,
502			duration :duration,
503			properties : props,
504		 onEnd: onEnd
505		}).play();	
506		return true;
507	},
508	animToTop: function(node, duration, topEnd, onEnd){
509		this.animatePosition(node, duration, undefined, undefined, undefined, undefined, topEnd, "px", onEnd);
510	},
511	animToLeft: function(node, duration, leftEnd, onEnd){
512		this.animatePosition(node, duration, undefined, leftEnd, "px", undefined, undefined, undefined, onEnd);
513	},
514	fadeOpacity: function(node,duration,opacityStart,opacityEnd,onEnd){
515		duration = duration || 300;
516		if(opacityStart== undefined) opacityStart = 0;
517		if(opacityEnd== undefined) opacityEnd = 1;
518		onEnd = onEnd || function(){return true;};
519		dojo.animateProperty( {
520			node : node,
521			duration :duration,
522			properties : {
523				opacity : {
524					start: opacityStart,
525					end : opacityEnd
526				}
527			},
528		 onEnd: onEnd
529			 }).play();
530	}
531	
532};
533
534function makeParameters(node,separate){
535		var params = new Object;
536		var ro = new Array();
537		if(typeof separate === "string"){
538			ro.push(separate);
539		}else ro = separate;
540		
541		var evalContainer = "";
542		for(t=0; t< node.length;t++){
543			if(!ro.in_array(node[t].nodeName)){
544				evalContainer += "params."+ node[t].nodeName +" = '"+node[t].nodeValue+"';";
545			}
546		}
547		if(evalContainer != "") eval(evalContainer);
548		return params;	
549}
550
551function extractNamespace(obj){
552	var namespace = obj.namespace || ("mooj"+nameSpaceCounter++);
553	delete obj.namespace;
554	return namespace;
555}
556
557function generalParameters(node){
558	return makeParameters(node.attributes,["class","style","title","alt","align","valign","width","height","border","bgcolor"]);
559}
560function deleteParameters(prams,toDelete){
561	var dob = new Array();
562	if(typeof toDelete === "string"){
563		dob.push(toDelete);
564	}else dob = toDelete;
565	
566	for(t=0; t< toDelete.length;t++){
567		eval("delete params."+dob[t]+";");
568	}	
569}
570
571function detectMouseButton(e){
572	var leftclick;
573	var middleclick;
574	var rightclick;
575	if (!e) var e = window.event;
576	if (e.which) {
577		leftclick = (e.which == 1);
578		middleclick = (e.which ==2);
579		rightclick = (e.which == 3);
580	}
581	else if (e.button) {
582		if( !_Browser.IE){
583			leftclick = (e.button == 0);
584			middleclick = (e.button == 1);
585			rightclick = (e.button == 2);
586		}else {
587			leftclick = (e.button ==1);
588			middleclick = (e.button == 4);
589			rightclick = (e.button == 2);
590		}
591	}
592	var buttonObject= {
593			left: leftclick,
594			middle: middleclick,
595			right: rightclick
596	}
597	return buttonObject;	
598}
599
600function detectMousePosition(e){
601	if (!e){var e = window.event;}
602	if (e.pageX || e.pageY){
603		x = e.pageX;
604		y = e.pageY;
605	}else if (e.clientX || e.clientY){
606		x = e.clientX;
607		y = e.clientY;
608	}
609	return {x:x,y:y};
610}
611
612function _Absoulutize(node,addX,addY){
613	addX = addX || 0;
614	addY = addY || 0;
615	var bounds = _ViewportOffset(node,true);
616	document.body.appendChild(node);
617	var ns = node.style;
618	ns.position = "absolute";
619	ns.display ="block";
620	ns.left = (bounds.l +addX) +"px";
621	ns.top = (bounds.t +addY) +"px";
622	ns.width = bounds.w +"px";
623	ns.height = bounds.h +"px";
624	ns.zIndex = "999999999";
625	return bounds;
626}
627
628function _AppendBounds(b/*bounds*/,node){
629	var ns = node.style;
630	ns.left = b.l +"px";
631	ns.top = b.t + "px";
632	ns.width = b.w +"px";
633	ns.height = b.h +"px";
634	return true;
635}
636
637function _Delayed(delay,func){
638	setTimeout(func,delay);
639}
640function _Delayed500(func){
641	_Delayed(500, func);
642}
643
644
645//
646//window.alert = function(text){
647//	newPopup('Alert','Alert',text,300,200);
648//}
649
650
651

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.