PageSourceSearch

https://www.gstservicesmd.com/cp/resources/js/floating_window_3.js?md5=de92a2ee6e7b0dc92cd4b6376b2ec9633b0

js gstservicesmd.com collected 2026-10-04 05:26:20 UTC 11,609 bytes, 283 lines download raw bytes

1window.addEventListener("load", function() {
2	var floating_window_parent = false;
3	var obj_parent_pos = false;
4	var auto_reset_content_when_closed = false;
5	var extra_winid = "";
6	extraheight = 75;
7
8	function register_floating_window(winid)
9	{
10		extra_winid = winid;
11	}
12	window.register_floating_window = register_floating_window;
13
14	function open_floating_window(set_title,set_content,set_parent,setwidth,setheight,framename,setcolor,call_when_built)
15	{
16		if(!setcolor) setcolor = "#ddddee";
17		if(!setwidth) setwidth = 480;
18		if(!setheight) setheight = 320;
19
20		var fwt = ersDE("floating_window_table");
21		if (fwt)
22		{
23			fwt.style.backgroundColor = setcolor;
24			fwt.style.minHeight = setheight + "px";
25		}
26
27		//document.getElementById("floating_window").style.width = setwidth + "px";
28		//document.getElementById("floating_window").style.height = setheight + "px";
29		//document.getElementById("floating_window").style.maxWidth = "80vw";
30		//document.getElementById("floating_window").style.top = "50%";
31		//document.getElementById("floating_window").style.left = "50%";
32		var winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
33		var winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
34		//if(winWidth > setwidth) document.getElementById("floating_window").style.marginLeft = -1 * (winWidth / 2) + "px";
35		if((setheight + extraheight) * 1 >= winHeight * 1)
36		if(setwidth * 1 >= winWidth * 1.2 || (setheight + extraheight) * 1 >= winHeight * 1)
37		{
38			//document.getElementById("floating_window").style.position = "absolute";
39		}
40		else
41		{
42			document.getElementById("floating_window").style.position = "fixed";
43		}
44
45		//document.getElementById("floating_window").style.marginLeft = -1 * (setwidth / 2) + "px";
46		//if(winHeight > setheight) document.getElementById("floating_window").style.marginTop = -1 * (winHeight / 2) + "px";
47//document.getElementById("floating_window").style.marginTop = -1 * ((setheight * 1 + extraheight * 1) / 2) + "px";
48
49		if(set_parent=="body")
50		{
51			floating_window_parent = document.body;
52		}
53		else if(element_exists(set_parent))
54		{
55			floating_window_parent = document.getElementById(set_parent);
56		}
57		else if(element_exists("main_area"))
58		{
59			floating_window_parent = document.getElementById("main_area");
60		}
61		else
62		{
63			floating_window_parent = document.body;
64		}
65		set_info_location("init");
66		set_info_location("followup");
67
68		document.getElementById("floating_window_title").innerHTML = set_title;
69		var fwc = ersDE("floating_window_content");
70		if (fwc)
71		{
72			fwc.style.minHeight = (setheight - 38) + "px";
73			fwc.innerHTML = unescape_decode(set_content);
74		}
75		//document.getElementById("main_inner_area").style.display = "block";
76		document.getElementById("floating_window").style.visibility = "visible";
77
78		obj_parent = get_parent_element("floating_window");
79		obj_parent_pos = getObjPosition(obj_parent);
80		obj_pos = getElementPosition("floating_window");
81
82		width_diff = obj_parent_pos['width'] - obj_pos['width'];
83		set_x = width_diff / 2;
84
85		//document.getElementById("floating_window").style.left = set_x + "px";
86
87		if(framename)
88		{
89			set_info_location("followup");
90			iframe = document.getElementById(framename);
91			if (iframe.attachEvent){
92				iframe.attachEvent("onload", function(){
93					sizeresult = frame_autosize(iframe);
94					set_info_location("init");
95				});
96			} else {
97				iframe.onload = function(){
98					sizeresult = frame_autosize(iframe);
99					set_info_location("init");
100				};
101			}
102		}
103		else set_info_location("init");
104		//iwinpos = getElementPosition(floating_window_parent.id);
105		/*if(opener)
106		{
107			opener_pos = getObjPosition(opener);
108			set_y = (opener_pos['top'] - obj_parent_pos['top']) - obj_pos['height'] / 4;
109			document.getElementById("floating_window").style.top = set_y + "px";
110		}*/
111
112		if (call_when_built && {}.toString.call(call_when_built) === '[object Function]')
113		{
114			call_when_built();
115		}
116	}
117	window.open_floating_window = open_floating_window;
118
119	function frame_autosize(iframe)
120	{
121		iframe.width = null;
122		iframe.height = null;
123		newwidth=iframe.contentWindow.document.body.scrollWidth;
124		newheight=iframe.contentWindow.document.body.scrollHeight;
125		if(newheight > 400) newheight = 400;
126		iframe.width = (newwidth * 1 + 60) + "px";
127		iframe.height = (newheight * 1 + 30) + "px";
128		return new Array(iframe.width,iframe.height);
129	}
130	window.frame_autosize = frame_autosize;
131
132	function open_floating_frame(set_title,set_frame,set_parent,setwidth,setheight,setcolor,call_when_built)
133	{
134		if(/dev-test/.test(location.toString())) 
135		{
136			http_root = "https://ourers.com/";
137		} else http_root = "";
138
139		if(!setcolor) setcolor = "#ddddee";
140		if(!setwidth) setwidth = 480;
141		if(!setheight) setheight = 320;
142		set_frame = set_frame.replace(/\?/ig,"&");
143		set_content = "<iframe name='floating_frame' id='floating_frame' style='width:" 
143+ setwidth + "px; height:" + setheight + "px; max-width:100%' frameborder='0' src='" + http_root  + "/cp/index.php?render_frame=" + set_frame + "&rfsep=1'></iframe>";
144		open_floating_window(set_title,set_content,set_parent,setwidth,setheight,"floating_frame",setcolor,call_when_built);
145	}
146	window.open_floating_frame = open_floating_frame;
147
148	function open_floating_iframe(set_title,set_frame,set_parent,setwidth,setheight,setcolor)
149	{
150		if(/dev-test/.test(location.toString())) 
151		{
152			http_root = "https://ourers.com/";
153		} else http_root = "";
154
155		if(!setcolor) setcolor = "#ddddee";
156		if(!setwidth) setwidth = 480;
157		if(!setheight) setheight = 320;
158		set_frame = set_frame.replace(/\?/ig,"&");
159		set_content = "<iframe name='floating_frame' id='floating_frame' style='width:" + setwidth + "px; height:" + setheight + "px; max-width:100%' frameborder='0' src='" + http_root + "/cp/index.php?render_iframe=" + set_frame + "&rfsep=1'></iframe>";
160		open_floating_window(set_title,set_content,set_parent,setwidth,setheight,"floating_frame",setcolor);
161	}
162	window.open_floating_iframe = open_floating_iframe;
163
164	function open_floating_src(set_title,set_frame,set_parent,setwidth,setheight,setcolor)
165	{
166		if(!setcolor) setcolor = "#ddddee";
167		if(!setwidth) setwidth = 480;
168		if(!setheight) setheight = 320;
169		//set_frame = set_frame.replace(/\?/ig,"&"); // commented out because it interferes with get vars JML 2023-04-06
170		set_content = "<iframe name='floating_frame' id='floating_frame' style='width:" + setwidth + "px; height:" + setheight + "px; max-width:100%' frameborder='0' src='" + set_frame + "'></iframe>";
171		open_floating_window(set_title,set_content,set_parent,setwidth,setheight,"floating_frame",setcolor);
172	}
173	window.open_floating_src = open_floating_src;
174
175	function open_floating_ajax_link(set_title,set_container,set_ajax_link,set_parent,setwidth,setheight)
176	{
177		var set_content = "<div id='" + set_container + "'>&nbsp;</div>";
178		open_floating_window(set_title,set_content,set_parent,setwidth,setheight);
179		ajax_register_flexible_container("floating_window_content");
180		//ajax_register_flexible_container(set_container);
181		//ajax_link(set_container,set_ajax_link);
182		ajax_link(set_container,set_ajax_link,false, false, "set_info_location");
183		set_info_location("init");
184	}
185	window.open_floating_ajax_link = open_floating_ajax_link;
186
187	function close_floating_window()
188	{
189		window.dispatchEvent(new CustomEvent("closefloatingwindow"));
190		document.getElementById("floating_window").style.visibility = "hidden";
191
192		//document.getElementById("floating_window_table").style.width = "20px";
193		//document.getElementById("floating_window_table").style.height = "20px";
194		//document.getElementById("main_inner_area").style.visibility = "hidden";
195		if(auto_reset_content_when_closed) document.getElementById("floating_window_content").innerHTML = " ";
196	}
197	window.close_floating_window = close_floating_window;
198
199	//winabsplaced = new Array();
200	function set_info_location(set_loc_mode)
201	{
202		fwobj_pos = getElementPosition("floating_window");
203		setwidth = fwobj_pos['width'];
204		setheight = fwobj_pos['height'];
205		var winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
206		var winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
207
208		if(setwidth * 1 >= winWidth * 1.2 || (setheight * 1 + extraheight * 1) * 1 >= winHeight * 1)
209		{
210			//wabsindex = setwidth + "-" + winWidth + "-" + setheight + "-" + winHeight;
211			//if(typeof winabsplaced[wabsindex] == "undefined" || document.getElementById("floating_window").style.position!="absolute")
212			var wintop = document.body.scrollTop;
213			var winleft = document.body.scrollLeft;
214			if(!wintop) wintop = document.documentElement.scrollTop;
215			if(!winleft) winleft = document.documentElement.scrollLeft;
216
217			if(document.getElementById("floating_window").style.position!="absolute" || set_loc_mode=="init")
218			{
219				//document.getElementById("floating_window").style.top = "50%";
220				//document.getElementById("floating_window").style.left = "50%";
221				gotopx = wintop - fwobj_pos['offtop'];
222				//document.getElementById("floating_window").style.top = gotopx + "px";
223				//document.getElementById("floating_window").style.marginTop = 0;
224				//document.getElementById("floating_window").style.position = "absolute";
225			}
226			else
227			{
228				//document.getElementById("floating_window").style.top = "50%";
229				//document.getElementById("floating_window").style.left = "50%";
230				gotopx = wintop - fwobj_pos['offtop'];
231				topn = (document.getElementById("floating_window").style.top).replace(/px/ig,'') * 1;
232				if(gotopx * 1 < topn * 1)
233				{
234					//document.getElementById("floating_window").style.top = gotopx + "px";
235					//document.getElementById("floating_window").style.marginTop = 0;
236					//document.getElementById("floating_window").style.position = "absolute";
237				}
238			}
239		}
240		else
241		{
242			//document.getElementById("floating_window").style.top = "50%";
243			//document.getElementById("floating_window").style.left = "50%";
244			document.getElementById("floating_window").style.position = "fixed";
245
246			//document.getElementById("floating_window").style.marginLeft = -1 * (setwidth / 2) + "px";
247			//document.getElementById("floating_window").style.marginTop = -1 * (setheight / 2) + "px";
248			// + extraheight) / 2) + "px";
249		}
250		//document.getElementById("floating_window").style.marginLeft = -1 * (setwidth / 2) + "px";
251		//document.getElementById("floating_window").style.marginTop = -1 * ((setheight + extraheight) / 2) + "px";
252
253		if(element_exists("start_container") && extra_winid=="") extra_winid = "start_container";
254		if(extra_winid!="")
255		{
256			if(!floating_window_parent)
257			{
258				floating_window_parent = document.getElementById(extra_winid).parentNode;//document.getElementById("main_area");
259				if(!floating_window_parent.id) floating_window_parent.id = "floating_window_parent_placeholder";
260			}
261			iwinpos = getElementPosition(floating_window_parent.id);
262
263			var top = document.body.scrollTop;
264			var left = document.body.scrollLeft;
265			if(!top) top = document.documentElement.scrollTop;
266			if(!left) left = document.documentElement.scrollLeft;
267
268			elem = document.getElementById(extra_winid);
269			obj_pos = getElementPosition(extra_winid);
270			var rel_pos = document.getElementById(extra_winid).style.top.replace(/px/ig,'');
271			var rel_offset = (top - (obj_pos['top'] - rel_pos) + 20);
272			if(rel_offset < 0) rel_offset = 0;
273
274			elem.style.top = rel_offset + "px";
275		}
276
277		return;
278	}
279	window.set_info_location = set_info_location;
280	floating_window_exists = true;
281	window.onscroll = set_info_location;
282	window.onresize = set_info_location;
283});

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.