PageSourceSearch

https://mysharetrading.com/themes/sharetrading/js/sharetrading8893.js

js mysharetrading.com collected 2026-10-02 20:08:52 UTC 13,735 bytes, 499 lines download raw bytes

1var browserName=navigator.appName; 
2
3isMSIE = false;
4if (browserName=="Microsoft Internet Explorer")
5{
6	isMSIE = true;
7}
8
9function getElem(ident) {
10	var exp, obj;
11
12	if (document.getElementById) {
13		exp = "document.getElementById('" + ident + "')";
14	}
15	else if (document.all) {
16		exp = "document.all['" + ident + "']";
17	}
18
19	return eval(exp);
20}
21
22
23function getWidth(obj) {
24
25	if (typeof(obj) == "string") {
26		obj = getElem(obj);	
27	}
28	if (obj == undefined) return;
29
30	return (obj.offsetWidth);
31
32}
33
34function getHeight(obj) {
35
36	if (typeof(obj) == "string") {
37		obj = getElem(obj);	
38	}
39	if (obj == undefined) return;
40
41	return (obj.offsetHeight);
42
43}
44
45function resize_h(id, from, to, step, count) {
46
47	if (count == undefined) count = 10;
48	obj = getElem(id);	
49	if (obj == undefined) return;
50	if (to < from) { step = -1 * step }
51
52	obj.style.overflow = "hidden";
53	obj.style.height = from + 'px';
54	setTimeout("resize_h_step('" + id + "'," + to + "," + step + "," + (count - 1) + ")", 0);
55}
56
57function resize_h_step(id, to, step, count) {
58
59	obj = getElem(id);	
60	if (obj == undefined) return;
61
62	currheight = obj.offsetHeight;
63	if ((count == 0) || (Math.abs(currheight - to) < Math.abs(step))) {
64		obj.realheight = currheight + (to - currheight);
65		obj.style.height = "auto";
66		if (isMSIE) { obj.style.height = "1%"; }
67		if (obj.rundone != undefined) { obj.rundone(); obj.rundone = function() {}; }
68	} else {
69		currheight += step;
70		obj.style.height = currheight + 'px';
71		step *= 3;
72		setTimeout("resize_h_step('" + id + "'," + to + "," + step + "," + (count - 1) + ")", 10);
73	}
74}
75
76function getChild(parent,tagname,classname) {
77	
78	elements = parent.getElementsByTagName(tagname);
79	for (i=0;i<elements.length;i++) {
80		if (elements[i].className == classname) {
81			return elements[i];
82		}
83	}
84}
85function move(obj,cood_x,cood_y) {
86	setTimeout(mv, 10, obj, cood_x, cood_y);
87}
88
89function mv(obj,cood_x,cood_y) {
90	//alert(cood_x + ' ' + cood_y);
91}
92
93document.getElementsByClassName = childbyClass = function(className, parentElement) {
94	var children = parentElement.getElementsByTagName('*');
95	var elements = [], child;
96	for (var i = 0, length = children.length; i < length; i++) {
97	  child = children[i];
98	  if (child.className == className)
99	    elements.push(child);
100	}
101	return elements;
102};
103
104function elem(element) {
105  if (typeof element == 'string')
106    element = document.getElementById(element);
107  return element;
108}
109
110function opacity(id, opacStart, opacEnd, step) {
111	object = elem(id);
112	changeOpac(opacStart, object);
113	clearTimeout(object.opacTimeout);
114	if (opacStart > opacEnd) { stepdir = -1 * step; }
115	else { stepdir = step; }
116	object.opacTimeout = setTimeout("_opacity('" + object.id + "'," + opacEnd + "," + stepdir + ")",0);
117}
118
119function _opacity(id,opacEnd,stepdir) {
120	object = elem(id);	
121	if ((opac = getStyle(object,"opacity")) == undefined)
122		currOp = 100;
123	else
124		currOp = opac * 100;
125	if (Math.abs(opacEnd - currOp) < Math.abs(stepdir)) {
126		currOp = opacEnd;
127		changeOpac(currOp, object);
128	}
129	if (currOp == opacEnd) {
130		if (object.runEnd) { object.runEnd(); /*object.runEnd = null;*/ }
131		return;
132	}
133	changeOpac((currOp + stepdir), object);
134	object.opacTimeout = setTimeout("_opacity('" + id + "'," + opacEnd + "," + stepdir + ")",20);
135}
136
137function changeOpac(opacity, object) {
138	object = elem(object);
139	object.style.opacity = (opacity / 100);
140	object.style.MozOpacity = (opacity / 100);
141	object.style.KhtmlOpacity = (opacity / 100);
142	if (opacity == 100) object.style.filter = '';
143	else object.style.filter = "alpha(opacity="+opacity+")";
144}
145
146function getStyle(el,styleProp)
147{
148	var x = elem(el);
149	if (x.currentStyle)
150		var y = x.currentStyle[styleProp];
151	else if (window.getComputedStyle)
152		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(hyphenate(styleProp));
153	else if (document.defaultView.getComputedStyle)
154		var y = document.defaultView.getComputedStyle(x,null)[hyphenate(styleProp)];			
155	return y;
156}
157
158function hyphenate(string)
159{
160	return string.replace(/\w[A-Z]/g, function(match){
161		return (match.charAt(0)+'-'+match.charAt(1).toLowerCase());
162	});
163}
164
165function Point(x, y) {
166	this.x = x;
167	this.y = y;
168}
169
170function getObjCoords(o) {
171	var oX = 0;
172	var oY = 0;
173	if (o.offsetParent) {
174		while (1) {
175			oX+=o.offsetLeft;
176			oY+=o.offsetTop;
177			if (!o.offsetParent) {
178				break;
179			}
180			o=o.offsetParent;
181		}
182	} else if (o.x) {
183		oX+=o.x;
184		oY+=o.y;
185	}
186	//alert(oX + \":\" + oY);
187	return new Point(oX, oY);
188}
189
190function ss_changeSlide(dynename, num) {
191	var data = eval(dynename);
192	if ((data['current'] != null) && (num == data['current'])) return;
193	//document.getElementById(dynename + '_cDesc').innerHTML = data['titles'][num];
194	//document.getElementById(dynename + '_cDesc').href = data['links'][num];
195	document.getElementById(dynename + '_s' + num).style.visibility = 'visible';
196	document.getElementById(dynename + '_tn' + num).className = 'selected';
197	if (data['current'] != null) {
198		document.getElementById(dynename + '_s' + data['current']).style.visibility = 'hidden';
199		document.getElementById(dynename + '_tn' + data['current']).className = '';
200	}
201	data['current'] = num;
202}
203
204var animatedtab = true;
205
206function cio_rotateSponsors(id) {
207	var obj = elem(id);
208	var sponsor_divs = childbyClass('sponsor_div',obj);
209	obj.sponsorNum = 0;
210
211	for (var i = 0, length = sponsor_divs.length; i < length; i++) {
212		sponsor_div = sponsor_divs[i];
213		sponsor_div.id = 'sponsor_div' + i;
214	}
215	obj.sponsor_divs = sponsor_divs;
216	sponsor_divs[0].style.display = "block";
217	obj.rotating = setTimeout('cio_rotateSponsors_once("' + id + '")',5000);
218}
219
220function cio_rotateSponsors_once(id) {
221	var obj = elem(id);
222	obj.sponsor_divs[obj.sponsorNum].style.display = "none";
223	if (++obj.sponsorNum>=obj.sponsor_divs.length) obj.sponsorNum = 0;
224	obj.sponsor_divs[obj.sponsorNum].style.display = "block";
225	opacity(obj.sponsor_divs[obj.sponsorNum].id, 0, 100, 7);
226	obj.rotating = setTimeout('cio_rotateSponsors_once("' + id + '")',5000);
227}
228
229/*
230
231===================================================
232XHTML/CSS/DHTML Semantically correct drop down menu 
233===================================================
234Altered by: Kelvin Tse
235
236Author: Sam Hampton-Smith
237Site: http://www.hampton-smith.com
238
239Description:	This script takes a nested set of <ul>s
240		and turns it into a fully functional
241		DHTML menu. All that is required is 
242		the correct use of class names, and
243		the application of some CSS.
244		
245Use:		Please leave this information at the
246		top of this file, and it would be nice
247		if you credited me/dropped me an email
248		to let me know you have used the menu.
249		sam AT hampton-smith.com
250
251
252---------------------------------------------------
253Credits: 	Inspiration/Code borrowed from Dave Lindquist (http://www.gazingus.org)
254		Menu hide functionality was aided by some code I found on http://www.jessett.com/
255
256*/
257
258
259var currentMenu = null;
260var currentStarter = null;
261var mytimer = null;
262var timerOn = false;
263var opera = window.opera ? true : false;
264var menuLeftMax = 0;
265var menuRightMax = 960;
266
267if (!document.getElementById)
268	document.getElementById = function() { return null; }
269
270function initialiseMenu(menu, starter, root) {
271	var leftstarter = false;
272
273	if (menu == null || starter == null) return;
274		currentMenu = menu;
275		currentStarter = starter;
276
277	starter.onmouseover = function() {
278		if (currentMenu) {
279			if (this.parentNode.parentNode!=currentMenu) {
280				currentMenu.style.visibility = "hidden";
281				currentStarter.className = "";
282			}
283			if (this.parentNode.parentNode==root) {
284				tempCurrentMenu = currentMenu
285				while (tempCurrentMenu.parentNode.parentNode!=root) {
286					tempCurrentMenu.parentNode.parentNode.style.visibility = "hidden";
287					tempCurrentMenu = tempCurrentMenu.parentNode.parentNode;
288				}
289			}
290			currentMenu = null;
291			this.showMenu();
292		}
293	}
294
295	menu.onmouseover = function() {
296	/*
297		if (currentMenu) {
298			currentMenu = null;
299			this.showMenu();
300		}
301	*/
302	}	
303
304	starter.showMenu = function() {
305		var leftoff = 0;
306		if (!opera) {
307			if (this.parentNode.parentNode==root) {
308				menuLeft = this.parentNode.offsetLeft + leftoff;
309				menuTop = this.offsetTop + this.offsetHeight;
310			}
311			else {
312				menuLeft = this.parentNode.offsetLeft + leftoff + this.offsetWidth;
313				menuTop = this.offsetTop;
314			}
315		}
316		else {
317			if (this.parentNode.parentNode==root) {
318				menuLeft = this.offsetLeft + leftoff;
319				menuTop = this.offsetHeight;
320			}
321			else {
322				menuLeft = this.offsetWidth;
323				menuTop = this.offsetTop ;
324			}
325
326		}
327		menuWidth = getMenuWidth(menu);
328		menu.style.width = menuWidth + "px";
329		menuLeft = menuLeft - (menuWidth/2) + (getWidth(this)/2);
330		if (menuLeft < menuLeftMax) { menuLeft = menuLeftMax; }
331		else if ((menuLeft + menuWidth) > menuRightMax) { menuLeft = menuRightMax - menuWidth; }
332		menu.style.left = menuLeft + "px";
333		menu.style.top = menuTop + "px";
334		menu.style.visibility = "visible";
335		currentMenu = menu;
336		currentStarter = this;
337		currentStarter.className = "hoverStarter";
338	}
339
340	starter.onfocus	 = function() {
341		starter.onmouseover();
342	}
343
344	menu.onfocus	 = function() {
345	}
346
347	menu.showMenu = function() {
348		menu.style.visibility = "visible";
349		currentMenu = menu;
350		stopTime();
351	}
352
353	menu.hideMenu = function()  {
354		if (!timerOn) {
355			mytimer = setInterval("killMenu('" + this.id + "', '" + root.id + "');", 400);
356			timerOn = true;
357			for (var x=0;x<menu.childNodes.length;x++) {
358				if (menu.childNodes[x].nodeName=="LI") {
359					if (menu.childNodes[x].getElementsByTagName("UL").length>0) {
360						menuItem = menu.childNodes[x].getElementsByTagName("UL").item(0);
361						menuItem.style.visibility = "hidden";
362					}
363				}
364			}
365		}
366	}
367
368/*
369	menu.onmouseout = function(event) {
370		this.hideMenu();
371	}
372
373	starter.onmouseout = function() {
374		for (var x=0;x<menu.childNodes.length;x++) {
375			if (menu.childNodes[x].nodeName=="LI") {
376				if (menu.childNodes[x].getElementsByTagName("UL").length>0) {
377					menuItem = menu.childNodes[x].getElementsByTagName("UL").item(0);
378					menuItem.style.visibility = "hidden";
379				}
380			}
381		}
382		if (starter.className == "starter") {
383			menu.hideMenu();
384		} else {
385			menu.style.visibility = "hidden";
386		}
387	}
388	*/
389}
390function killMenu(menu, root) {
391	var menu = document.getElementById(menu);
392	var root = document.getElementById(root);
393	menu.style.visibility = "hidden";
394	for (var x=0;x<menu.childNodes.length;x++) {
395		if (menu.childNodes[x].nodeName=="LI") {
396			if (menu.childNodes[x].getElementsByTagName("UL").length>0) {
397				menuItem = menu.childNodes[x].getElementsByTagName("UL").item(0);
398				menuItem.style.visibility = "hidden";
399			}
400		}
401	}
402	while (menu.parentNode.parentNode!=root) {
403		menu.parentNode.parentNode.style.visibility = "hidden";
404		menu = menu.parentNode.parentNode;
405	}
406	stopTime();
407}
408function stopTime() {
409	if (mytimer) {
410		 clearInterval(mytimer);
411		 mytimer = null;
412		 timerOn = false;
413	}
414} 
415
416function hmenu_init() { 
417	var root = document.getElementById("hnavbar_menu");
418	getMenus(root, root);
419}
420
421function getMenus(elementItem, root) {
422	var selectedItem;
423	var menuStarter;
424	var menuItem;
425	for (var x=0;x<elementItem.childNodes.length;x++) {
426		if (elementItem.childNodes[x].nodeName=="LI") {
427			if (elementItem.childNodes[x].getElementsByTagName("UL").length>0) {
428				menuStarter = elementItem.childNodes[x].getElementsByTagName("A").item(0);
429				menuItem = elementItem.childNodes[x].getElementsByTagName("UL").item(0);
430				getMenus(menuItem, root);
431				initialiseMenu(menuItem, menuStarter, root);
432			}
433		}
434	}
435}
436
437function getMenuWidth(menu) {
438	var menuItem = menu.getElementsByTagName("li");
439	var total = 0;
440	for (var x=0;x<menuItem.length;x++) {
441		total += getWidth(menuItem[x]);
442	}
443	return total;
444}
445tabboxpref = 'tbox';
446tabbarpref = 'dyntabbar';
447tabpref = 'dyntab';
448tabboxouterpref = 'dyntabbox';
449tabsel = [];
450changingtab = false;
451function switchtab(boxid,tabid,animated) {
452	tabfid = tabpref + '_' + boxid + '_' + tabid;
453	tabboxfid = tabboxpref + '_' + boxid + '_' + tabid;
454	if (!(ptabid = tabsel[boxid])) { tabsel[boxid] = ptabid = 1; }
455	ptabfid = tabpref + '_' + boxid + '_' + ptabid;
456	ptabboxfid = tabboxpref + '_' + boxid + '_' + ptabid;
457	ptabboxouterid = tabboxouterpref + '_' + boxid;
458	if (animated == undefined) { animated = true; }
459
460
461	if (tabsel[boxid] == tabid) { return; }
462
463	if (atabbox = document.getElementById(tabboxfid)) {
464
465		changingtab = true;
466
467		ptabbox = document.getElementById(ptabboxfid);
468		/* show current */
469		//atabbox.style.visibility = "hidden";
470
471		//if (animatedtab && animated) { step = 3; } else { step = 1; }
472		//if (animatedtab && animated) {
473		if (animatedtab && animated) {
474			ptabboxouter = document.getElementById(ptabboxouterid);
475			ptabboxouter.style.overflow = "hidden";
476			fromheight = getHeight(ptabbox);
477			fromheight = ptabboxouter.offsetHeight - 1;
478			ptabboxouter.style.height = fromheight + "px";
479			atabbox.style.display = "block";
480			atabbox.style.height = ptabbox.style.height = "auto";
481			resize_h(ptabboxouterid, fromheight, getHeight(atabbox),10, 3);
482		} else {
483			atabbox.style.display = "block";
484		}
485		if (atab = document.getElementById(tabfid)) {
486			atab.className = 'sel';
487			tabsel[boxid] = tabid;
488		}
489		/* hide prev */
490		if (ptabbox) {
491			ptabbox.prevheight = ptabbox.offsetHeight;
492			ptabbox.style.display = "none";
493			if (ptab = document.getElementById(ptabfid)) {
494				ptab.className = '';
495			}
496		}
497	}
498}
499

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.