PageSourceSearch

https://www.frenchpolishes.com/acatalog/actiniccore.js

js frenchpolishes.com collected 2026-10-02 16:24:45 UTC 9,794 bytes, 368 lines download raw bytes

1var bPageIsLoaded = false;
2/***********************************************************************
3*
4* setCookie -	Generic Set Cookie routine
5*
6* Input: sName	 -	Name of cookie to create
7*	 sValue	 -	Value to assign to the cookie
8*	 sExpire -	Cookie expiry date/time (optional)
9*
10* Returns: null
11*
12************************************************************************/
13
14function setCookie(sName, sValue, sExpire) 
15    {
16    var sCookie = sName + "=" + escape(sValue) +"; path=/";	// construct the cookie
17    if (sExpire)
18    	{
19    	sCookie += "; expires=" + sExpire.toGMTString();	// add expiry date if present
20    	}
21    document.cookie = sCookie;					// store the cookie
22    return null;
23    }
24
25/***********************************************************************
26*
27* getCookie	-	Generic Get Cookie routine
28*
29* Input: sName	-	Name of cookie to retrieve
30*
31* Returns:		Requested cookie or null if not found
32*
33************************************************************************/
34
35function getCookie(sName) 
36    {
37    var sCookiecrumbs = document.cookie.split("; "); 	// break cookie into crumbs array
38    var sNextcrumb
39    for (var i=0; i < sCookiecrumbs.length; i++) 
40	{
41	sNextcrumb = sCookiecrumbs[i].split("=");	// break into name and value
42	if (sNextcrumb[0] == sName)			// if name matches
43	    {
44	     return unescape(sNextcrumb[1]); 		// return value
45	    }
46	}
47	return null;
48    }
49
50/***********************************************************************
51*
52* saveReferrer -	Saves the referrer to a Cookie
53*
54* Input: 		nothing
55*
56* Returns:		null
57*
58************************************************************************/
59
60function saveReferrer() 
61    {
62    var bSetCookie = false;
63    if (parent.frames.length == 0)					// No FrameSet
64		{
65		bSetCookie = true;
66		}
67    else														// FrameSet in use
68		{
69		var bCatalogFrameSet = false;
70		for (var nFrameId = parent.frames.length; nFrameId > 0; nFrameId--)
71			{
72			if (parent.frames[nFrameId - 1].name == 'CatalogBody')	// Catalog FrameSet used
73				{
74				bCatalogFrameSet = true;
75				break;
76				}
77			}
78		if (bCatalogFrameSet)							// Catalog FrameSet
79			{
80			if (window.name=='CatalogBody')			// and this is the CatalogBody frame
81				{
82				bSetCookie = true;
83				}
84			}
85		else													// Not Catalog FrameSet
86			{
87			bSetCookie = true;
88			}
89		}
90    if (bSetCookie)
91		{
92		var sUrl = document.URL;
93		var nHashPos = sUrl.lastIndexOf("#");		// Look for URL anchor
94		if (nHashPos > 0)									// if it exists
95		    {
96		    sUrl = sUrl.substring(0,nHashPos);		// then remove it
97		    }
98		setCookie("ACTINIC_REFERRER", sUrl);		// Emulates HTTP_REFERER
99		}
100	    return null;
101	    }
102
103/***********************************************************************
104*
105* CreateArray	creates an array with n elements
106*
107* Input: n	-	number of elements
108*
109* Returns:		the created array
110*
111************************************************************************/
112
113function CreateArray(n)
114	{
115	this.length = n;
116	for (var i=1; i <= n; i++)							// for all ns
117		{
118		this[i] = new Section();						// create a section structure
119		}
120	return this;											// return the created array
121	}
122
123/***********************************************************************
124*
125* Section	-	creates the section structure for raw section lists
126*
127* Input: 				nothing
128*
129* Returns:				nothing
130************************************************************************/
131
132function Section()
133	{
134	this.sURL = null;
135	this.sName = null;
136	this.sImage = null;
137	this.nImageWidth = null;
138	this.nImageHeight= null;
139	this.nSectionId	= null;
140	this.pChild = null;
141	}
142	
143/***********************************************************************
144*
145* SwapImage			-	swaps an image to the alternative
146*
147* Input:	sName		-	name of the image
148*
149*			sAltImage	-	filename of the alternative image
150*
151************************************************************************/
152
153function SwapImage(sName, sAltImage)
154	{
155	var nCount = 0;
156	document.aSource = new Array;						// array for images
157	if (document[sName] != null)						// if image name exists
158		{
159		document.aSource[nCount++] = document[sName];	// store image
160		if(null == document[sName].sOldSrc)
161			{
162			document[sName].sOldSrc = document[sName].src;	// store image source
163			}
164		document[sName].src = sAltImage;				// change image source to alternative
165		}
166	}
167
168/***********************************************************************
169*
170* RestoreImage		-	restores an image to the original
171*
172* Input: 				nothing
173*
174* Returns:				nothing
175************************************************************************/
176
177function RestoreImage()
178	{
179	var nCount, aSource = document.aSource;
180	if (aSource != null)									// if array of images exists
181		{
182		for(nCount=0; nCount < aSource.length; nCount++)	// restore all images
183			{
184			if ((aSource[nCount] != null) &&
185				(aSource[nCount].sOldSrc != null))	// if we stored something for this image
186				{
187				aSource[nCount].src = aSource[nCount].sOldSrc;	// restore the original image
188				}
189			}
190		}
191	}
192
193/***********************************************************************
194*
195* PreloadImages		-	restores an image to the original
196*
197* Input: 				nothing
198*
199* Returns:				nothing
200*
201************************************************************************/
202
203function PreloadImages()
204	{
205	bPageIsLoaded = true;
206	if(document.images)
207		{
208		if(!document.Preloaded)							// preload array defined?
209			{
210			document.Preloaded = new Array();		// no, define it
211			}
212		var nCounter , nLen = document.Preloaded.length, saArguments = PreloadImages.arguments;
213		for(nCounter = 0; nCounter < saArguments.length; nCounter++)	// iterate through arguments
214			{
215			document.Preloaded[nLen] = new Image;
216			document.Preloaded[nLen++].src = saArguments[nCounter];
217			}
218   	}
219	}
220	
221/***********************************************************************
222*
223* ShowPopUp		-	creates pop up window
224*
225* Input: sUrl		-	URL o page to display
226*			nWidth	-	Width of window
227*			nHeight	-	Height of window
228*
229* Returns:				nothing
230*
231************************************************************************/
232
233function ShowPopUp(sUrl, nWidth, nHeight)
234  	{  
235	window.open(sUrl, 'ActPopup', 'width=' + nWidth + ',height=' + nHeight + ',scrollbars, resizable');
236	if (!bPageIsLoaded)
237		{
238		window.location.reload(true);
239		}
240	}
241
242/***********************************************************************
243*
244* DecodeMail		-	decodes the obfuscated mail address in 'contactus' link
245*
246* Input: 				nothing
247*
248* Returns:				nothing
249*
250************************************************************************/
251
252function DecodeMail()
253	{
254	var nIdx = 0;
255	for( ; nIdx < document.links.length; nIdx++ )
256		if ( document.links[ nIdx ].name == "contactus" )
257		{
258		var sOldRef = document.links[ nIdx ].href;
259
260		while( sOldRef.indexOf( " [dot] " ) != -1 )
261			sOldRef = sOldRef.replace( " [dot] ", "." );
262			
263		while( sOldRef.indexOf( " [at] " ) != -1 )
264			sOldRef = sOldRef.replace( " [at] ", "@" );
265			
266		document.links[ nIdx ].href = sOldRef;
267		}
268	}
269
270/***********************************************************************
271*
272* HtmlInclude		-	Parses the page for <a href> tags and if any found 
273*							with rel="fragment" attribute then create an XMLHTTP
274*							request to download the referenced file and insert the
275*							file content in place of the referring tag.
276*							In case of error just leave it as is.
277*
278*	NOTE: this function is automatically attached to the onload event handler
279*	therefore this processing is done on all pages where this js file is included.
280*
281* Returns:				nothing
282*
283* Author:				Zoltan Magyar
284*
285************************************************************************/
286
287function HtmlInclude() 
288	{ 
289	var req;
290	//
291	// Check browser type
292	//
293	if (typeof(XMLHttpRequest) == "undefined") 	// IE
294		{ 
295		try 
296			{ 
297			req = new ActiveXObject("Msxml2.XMLHTTP"); 
298			} 
299		catch(e) 
300			{ 
301			try 
302				{ 
303				req = new ActiveXObject("Microsoft.XMLHTTP"); 
304				} 
305			catch(e) 										// no luck?
306				{ 
307				return; 										// nothing to do then
308				} 
309			} 
310		} 
311	else 														// Mozzila
312		{  
313		req = new XMLHttpRequest(); 
314		} 
315	//
316	// Get <a href> tags and iterate on them
317	//
318	var tags = document.getElementsByTagName("A"); 
319	var i; 
320	for (i = 0; i < tags.length; i++) 
321		{ 
322		//
323		// Check if we got "fragment" as rel attribute
324		//
325		if (tags[i].getAttribute("rel") == "fragment") 
326			{
327			try
328				{
329				//
330				// Try to pull the referenced file from the server
331				//
332				req.open('GET', tags[i].getAttribute("href"), false); 
333				if (document.characterSet) 
334					{
335					req.overrideMimeType("text/html; charset=" + document.characterSet);
336					}
337				req.send(null); 
338				if (req.status == 200) 					// got the content?
339					{ 
340					//
341					// Replace the reference with the pulled in content
342					//
343					var span = document.createElement("SPAN"); 
344					span.innerHTML = req.responseText; 
345					tags[i].parentNode.replaceChild(span, tags[i]);
346					} 
347				}
348			catch(e)											// couldn't pull it from the server (maybe preview)
349				{
350				return;										// don't do anything then
351				}
352			} 
353		} 
354	} 
355
356//
357// The following lines will automatically parse all the pages 
358// where this script is included by attaching the HtmlInclude
359// function to the onload event.
360//
361if (window.attachEvent) 								// IE 
362	{ 
363	window.attachEvent("onload", HtmlInclude); 
364	} 
365else 															// DOM
366	{  
367	window.addEventListener("load", HtmlInclude, false); 
368	}

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.