PageSourceSearch

https://mikeirwinart.com/js/searchEngine/searchEngine.js?v=6690b1797e

js mikeirwinart.com collected 2026-09-26 18:09:17 UTC 78,445 bytes, 2,423 lines download raw bytes

1
2    function newHttpReq()
3    {
4        var newRequest = null;
5
6        try
7        {
8            newRequest = new XMLHttpRequest();
9        }
10        catch(trymicrosoft)
11        {
12            try
13            {
14                newRequest = new ActiveXObject("Msxml2.XMLHTTP");
15            }
16            catch(othermicrosoft)
17            {
18                try
19                {
20                    newRequest = new ActiveXObject("Microsoft.XMLHTTP");
21                }
22                catch(failed)
23                {
24                    newRequest = null;
25                }
26            }
27        }
28
29        return newRequest;
30
31    }
32
33    var image001 = new Image();
34    image001.src = '/assets/images/Searching.gif';
35
36    var flagcolorselected = false;
37    var closeTimerSearchTypeOptionsSearchEngine = 0;
38
39    var request = newHttpReq();
40    var httpobject = [];
41    httpobject[-1] = newHttpReq();
42
43    var backgroundobject;
44    var sourceobject;
45    var targetobject;
46    var requestcount = 0;
47
48    if(!httpobject[-1])
49    {
50        alert("Error Initializing XMLHttpRequest!");
51    }
52
53    function bringtotop(artworkid,tag,status)
54    {
55
56        var url = '/queries/updateartworktags.php?artworkid=' + artworkid + '&tag=' + tag + '&status='+status;
57        if((request.readyState != 4) && (request.readyState != 0))
58        {
59            request.abort();
60            request = newHttpReq();
61        }
62
63        request.open('GET',url,true);
64        request.onreadystatechange = updatebringtotop;
65        request.send(null);
66
67        return;
68
69    }
70
71    function skip(artworkid)
72    {
73
74        var sourcediv = document.getElementById('artworkdiv[' + artworkid + ']');
75        sourcediv.parentNode.removeChild(sourcediv);
76
77    }
78
79
80    function updatebringtotop()
81    {
82
83        try
84        {
85            if(request.readyState == 4)
86            {
87            }
88
89            if(request.status == 200)
90            {
91            }
92        }
93        catch (e)
94        {
95            return;
96        }
97
98
99        if (request.readyState == 4)
100        {
101            if(request.status == 200)
102            {
103                //alert(request.responseText);
104                var artworkid = request.responseText;
105
106                var sourcediv = document.getElementById('artworkdiv[' + artworkid + ']');
107                //sourcediv.parentNode.removeChild(sourcediv);
108
109                sourcediv.innerHTML = '';
110
111            }
112        }
113    }
114
115
116    function promotemember(artworkid,status)
117    {
118
119        var url = '/queries/promotemember.php?artworkid=' + artworkid + '&status='+status;
120
121        if((request.readyState != 4) && (request.readyState != 0))
122        {
123            request.abort();
124            request = newHttpReq();
125        }
126
127        request.open('GET',url,true);
128        request.onreadystatechange = updatepage;
129        request.send(null);
130
131        return;
132
133    }
134
135
136    function promoteartwork(artworkid,status)
137    {
138
139        var url = '/queries/promoteartwork.php?artworkid=' + artworkid + '&status='+status;
140
141        if((request.readyState != 4) && (request.readyState != 0))
142        {
143            request.abort();
144            request = newHttpReq();
145        }
146
147        request.open('GET',url,true);
148        request.onreadystatechange = updatepage;
149        request.send(null);
150
151        return;
152
153    }
154
155
156    function updatepage()
157    {
158
159        try
160        {
161            if(request.readyState == 4)
162            {
163            }
164
165            if(request.status == 200)
166            {
167            }
168        }
169        catch (e)
170        {
171            return;
172        }
173
174
175        if (request.readyState == 4)
176        {
177            if(request.status == 200)
178            {
179
180                alert(request.responseText);
181
182            }
183        }
184    }
185
186    function showpromotion(action)
187    {
188        if(document.getElementById('dimdiv'))
189        {
190            var widthclient = parseInt(document.documentElement.clientWidth);
191            var heightclient = parseInt(document.documentElement.clientHeight);
192
193            backgroundobject = document.getElementById('dimdiv');
194            backgroundobject.style.width = '100%';
195            backgroundobject.style.height = document.body.scrollHeight + 0 + 'px';
196            backgroundobject.style.visibility = 'visible';
197
198            targetobject = document.getElementById('lookupdiv');
199
200            var targetObjectWidth = widthclient - 52;
201
202            if(targetObjectWidth > 700)
203            {
204                targetObjectWidth = 700;
205            }
206
207            targetobject.style.width = targetObjectWidth + 'px';
208
209            var sourceposx, sourceposy;
210            sourceobject = document.getElementById('promotionDiv');
211
212            if (sourceobject.offsetParent)
213            {
214                sourceposy = sourceobject.offsetTop;
215
216                while (sourceobject = sourceobject.offsetParent)
217                {
218                    sourceposy += sourceobject.offsetTop;
219                }
220            }
221
222            // Add 50 because loopupdiv has padding set to 25.
223            sourceposx = ((widthclient - targetObjectWidth - 52) / 2);
224            sourceposy -= 1;
225
226            //alert(widthclient + ' - ' + targetObjectWidth + ' - ' + sourceposx);
227
228            targetobject.style.pixelLeft = sourceposx;
229            targetobject.style.pixelTop = sourceposy;
230            targetobject.style.left = sourceposx + 'px';
231            targetobject.style.top = sourceposy + 'px';
232
233            var localvalue = requestcount;
234            var poststring = "action=" + action + "&pagename=" + thispage + "&pagetitle=" + searchEngineSponsorshipTitle + "&cacheId=" + searchEngineSponsorshipCacheId;
235
236            if(action == 'submit')
237            {
238                var sourcepagename = document.getElementById('sourcepagename').value;
239                sourcepagename = sourcepagename.replace(/&/g,'--ampersand--');
240
241                poststring = poststring + "&sourcepagename=" + sourcepagename;
242
243                document.getElementById('lookupdiv').scrollIntoView(true);
244
245            }
246
247            targetobject.innerHTML = "<p style='float: left; font: 10pt arial; padding-top: 3px; padding-right: 5px;'>Please Wait</p><img style='float: left;' src='/assets/images/Searching.gif'>";
248            targetobject.style.visibility = "visible";
249
250            httpobject[localvalue] = newHttpReq();
251            httpobject[localvalue].onreadystatechange = function(){
252
253                try
254                {
255                    if(httpobject[localvalue].readyState == 4)
256                    {
257                    }
258
259                    if(httpobject[localvalue].status == 200)
260                    {
261                    }
262                }
263                catch (e)
264                {
265                    return;
266                }
267
268                if(httpobject[localvalue].readyState == 4 && httpobject[localvalue].status == 200)
269                {
270                    //document.getElementById('lookupdiv2').innerHTML = httpobject[localvalue].responseText;
271
272                    var response = httpobject[localvalue].responseText.split("EXTRAINSTRUCTIONS");
273
274                    document.getElementById('lookupdiv').innerHTML = response[0];
275
276                    if(response[1])
277                    {
278                        eval(response[1]);
279                    }
280
281
282                }
283
284
285            };
286
287            var url = '/queries/querysearchpagepromotion.php';
288
289            httpobject[localvalue].open('POST',url,true);
290            httpobject[localvalue].setRequestHeader("content-type", "application/x-www-form-urlencoded");
291            httpobject[localvalue].send(poststring);
292
293            requestcount += 1;
294
295        }
296    }
297
298
299    function closelookupwindow()
300    {
301        if(document.getElementById('lookupdiv'))
302        {
303            document.getElementById('lookupdiv').style.visibility = 'hidden';
304        }
305
306        if(document.getElementById('dimdiv'))
307        {
308            document.getElementById('dimdiv').style.visibility = 'hidden';
309        }
310    }
311
312    function changeproductfilter()
313    {
314        window.location = document.getElementById('productfilter').value;
315    }
316
317    function changemediumfilter()
318    {
319        window.location = document.getElementById('mediumfilter').value;
320    }
321
322    function changecollectionid()
323    {
324        window.location = document.getElementById('collectionid').value;
325    }
326
327    function expandallsubjectsdiv()
328    {
329        document.getElementById('allsubjectsdiv').style.height = 'auto';
330        document.getElementById('expanddiv').innerHTML = '&nbsp;';
331    }
332
333    function expandallcollectionsdiv()
334    {
335        document.getElementById('allcollectionsdiv').style.height = '';
336        document.getElementById('expandcollectionsdiv').innerHTML = '&nbsp;';
337    }
338
339    var flagemailcleared = 0;
340
341    function clearemail()
342    {
343        if(flagemailcleared == 0)
344        {
345            document.getElementById('promotionemail').value = '';
346            flagemailcleared = 1;
347        }
348    }
349
350
351    function searchEngineSidebarSubmitEmailSubscription()
352    {
353        createGlobalForegroundAndBackgroundDiv();
354        showGlobalForegroundAndBackgroundDiv();
355
356        var localvalue = requestcount;
357        var email = document.getElementById('searchEngineSidebarEmail').value;
358
359
360        if(email == '' || email == 'E-Mail Address')
361        {
362            alert('You must enter an e-mail address.');
363            return;
364        }
365
366        document.getElementById('searchEngineSidebarEmail').value = '';
367
368        httpobject[localvalue] = newHttpReq();
369        httpobject[localvalue].onreadystatechange = function(){
370
371            try
372            {
373                if(httpobject[localvalue].readyState == 4)
374                {
375                }
376
377                if(httpobject[localvalue].status == 200)
378                {
379                }
380            }
381            catch (e)
382            {
383                return;
384            }
385
386            if(httpobject[localvalue].readyState == 4 && httpobject[localvalue].status == 200)
387            {
388                var response = httpobject[localvalue].responseText.split("--JSON_RESPONSE_DATA--");
389
390                document.getElementById('globalForegroundDiv').innerHTML = response[0];
391
392                if(response[1])
393                {
394                    var responseData = JSON.parse(response[1]);
395
396                    if(responseData.hasOwnProperty('visitorData'))
397                    {
398                        window.dataLayer = window.dataLayer || [];
399                        dataLayer.push({
400                            'event': 'gtm.subscribe',
401                            'eventLabel': 'search-sidebar',
402                            'visitorEmail': email
403                        });
404                    }
405                }
406            }
407        };
408
409        var url = '/queries/queryGlobalEmailSubscriptionPopUp.php';
410        var postString = 'action=submit&email=' + email + '&sourcePage=' + window.location.pathname;
411
412        httpobject[localvalue].open('post',url,true);
413        httpobject[localvalue].setRequestHeader('content-type', 'application/x-www-form-urlencoded');
414        httpobject[localvalue].send(postString);
415
416        requestcount += 1;
417
418        return;
419
420    }
421
422
423    function searchEngineSidebarEmailCheckForEnter(e)
424    {
425        if(e.keyCode === 13)
426        {
427            searchEngineSidebarSubmitEmailSubscription();
428        }
429    }
430
431    function storescreenwidth()
432    {
433        var localvalue = requestcount;
434        var poststring = "screenwidth=" + screen.width;
435
436        httpobject[localvalue] = newHttpReq();
437        httpobject[localvalue].onreadystatechange = function(){
438
439            try
440            {
441                if(httpobject[localvalue].readyState == 4)
442                {
443                }
444
445                if(httpobject[localvalue].status == 200)
446                {
447                }
448            }
449            catch (e)
450            {
451                return;
452            }
453
454            if(httpobject[localvalue].readyState == 4 && httpobject[localvalue].status == 200)
455            {
456                //alert(httpobject[localvalue].responseText);
457            }
458
459
460        };
461
462        var url = '/queries/querystorescreenwidth.php';
463
464        httpobject[localvalue].open('post',url,true);
465        httpobject[localvalue].setRequestHeader('content-type','application/x-www-form-urlencoded');
466        httpobject[localvalue].send(poststring);
467
468        requestcount += 1;
469
470    }
471
472    var flagbottomvisible = false;
473    var flagtransitioninprogress = false;
474    var targetheight = 0;
475
476    function showbottom()
477    {
478        flagtransitioninprogress = true;
479
480        targetheight = 0;
481
482        document.getElementById('specialpromotiondiv').style.height = targetheight + 'px';
483        document.getElementById('specialpromotiondiv').style.visibility = 'visible';
484
485        showinprogress();
486    }
487
488    function showinprogress()
489    {
490        targetheight += 1;
491        document.getElementById('specialpromotiondiv').style.height = targetheight + 'px';
492
493        if (targetheight < 50)
494        {
495            t = setTimeout("showinprogress()", 10);
496        }
497        else
498        {
499            flagtransitioninprogress = false;
500            flagbottomvisible = true;
501        }
502    }
503
504
505    function hidebottom()
506    {
507        flagtransitioninprogress = true;
508        targetheight = parseInt(document.getElementById('specialpromotiondiv').style.height);
509
510        hideinprogress();
511    }
512
513    function hideinprogress()
514    {
515        targetheight -= 1;
516        document.getElementById('specialpromotiondiv').style.height = targetheight + 'px';
517
518        if (targetheight > 0)
519        {
520            t = setTimeout("hideinprogress()", 10);
521        }
522        else
523        {
524            document.getElementById('specialpromotiondiv').style.visibility = 'hidden';
525            flagtransitioninprogress = false;
526            flagbottomvisible = false;
527        }
528    }
529
530    function showemailform()
531    {
532
533        if(!document.getElementById('foregrounddiv') || !document.getElementById('backgrounddiv'))
534        {
535            var newdiv;
536            var cssstyle;
537
538            // Background Div
539            if(!document.getElementById('backgrounddiv'))
540            {
541                newdiv = document.createElement('div');
542                cssstyle = 'position: fixed; z-index: 5000; left: 0px; top: 0px; width: 10px; height: 10px; background-color: #000000; visibility: hidden; opacity: 0.50; filter: alpha(opacity=50);';
543                newdiv.id = 'backgrounddiv';
544                newdiv.setAttribute('style',cssstyle);
545                newdiv.style.cssText = cssstyle;
546                document.body.appendChild(newdiv);
547            }
548
549            // Foreground Div
550            if(!document.getElementById('foregrounddiv'))
551            {
552                newdiv = document.createElement('div');
553                cssstyle = 'position: fixed; z-index: 5001; left: 0px; top: 0px; width: 700px; min-height: 50px; padding: 0px; overflow: auto; border: 15px solid #666666; background-color: #FFFFFF; visibility: hidden; box-shadow: 0px 0px 50px #000000;';
554                newdiv.id = 'foregrounddiv';
555                newdiv.setAttribute('style',cssstyle);
556                newdiv.style.cssText = cssstyle;
557                document.body.appendChild(newdiv);
558            }
559        }
560
561        var backgroundobject = document.getElementById('backgrounddiv');
562        backgroundobject.style.width = '100%';
563        backgroundobject.style.height = '100%';
564        backgroundobject.style.visibility = 'visible';
565
566        var widthclient = parseInt(document.documentElement.clientWidth);
567        var heightclient = parseInt(document.documentElement.clientHeight);
568
569        var widthtarget = parseInt(widthclient*0.80);
570        var heighttarget = parseInt(heightclient*0.60);
571
572        if((widthtarget + 30) > widthclient)
573        {
574            widthtarget = widthclient - 30;
575        }
576
577        if((heighttarget + 30) > heightclient)
578        {
579            heighttarget = heightclient - 30;
580        }
581
582        if(widthtarget > 800)
583        {
584            widthtarget = 800;
585        }
586
587        if(heighttarget > 600)
588        {
589            heighttarget = 600;
590        }
591
592        //var widthtarget = 800;
593        //var heighttarget = 300;
594
595        var offsetleft = 0;
596        var offsettop = 0;
597
598        var offsetx = 0;
599        var offsety = 0;
600
601        if(document.documentElement.scrollTop && !document.body.scrollTop)
602        {
603            //offsetleft = document.documentElement.scrollLeft;
604            //offsettop = document.documentElement.scrollTop;
605        }
606        else
607        {
608            //offsetleft = document.body.scrollLeft;
609            //offsettop = document.body.scrollTop;
610        }
611
612        var logindiv = document.getElementById('foregrounddiv');
613        logindiv.style.width = widthtarget + 'px';
614        logindiv.style.height = heighttarget + 'px';
615        logindiv.style.visibility = 'visible';
616        logindiv.innerHTML = "<img src='/assets/images/Searching.gif' style='float: left;'>";
617
618        logindiv.style.left = (offsetx + offsetleft + parseInt((widthclient - (widthtarget + 30)) / 2)) + 'px';
619        logindiv.style.top = (offsety + offsettop + parseInt((heightclient - (heighttarget + 30)) / 2)) + 'px';
620
621        var localvalue = requestcount;
622
623        httpobject[localvalue] = newHttpReq();
624        httpobject[localvalue].onreadystatechange = function(){
625
626            try
627            {
628                if(httpobject[localvalue].readyState == 4)
629                {
630                }
631
632                if(httpobject[localvalue].status == 200)
633                {
634                }
635            }
636            catch (e)
637            {
638                return;
639            }
640
641            if(httpobject[localvalue].readyState == 4 && httpobject[localvalue].status == 200)
642            {
643                document.getElementById('foregrounddiv').innerHTML = httpobject[localvalue].responseText;
644            }
645
646
647        };
648
649        var url = '/queries/queryemailsubscriptionforeground.php';
650        var poststring = 'action=refresh';
651
652        httpobject[localvalue].open('post',url,true);
653        httpobject[localvalue].setRequestHeader('content-type', 'application/x-www-form-urlencoded');
654        httpobject[localvalue].send(poststring);
655
656        requestcount += 1;
657
658        return;
659    }
660
661    function submitsubscriptionemail()
662    {
663
664        var localvalue = requestcount;
665        var email = document.getElementById('subscriptionemail').value;
666
667        if(email == '' || email == 'E-Mail Address')
668        {
669            alert('You must enter an e-mail address.');
670            return;
671        }
672
673        document.getElementById('submitsubscriptiondiv').innerHTML = "<img src='/assets/images/Searching.gif' style='float: left; padding-top: 5px;'>";
674
675        httpobject[localvalue] = newHttpReq();
676        httpobject[localvalue].onreadystatechange = function(){
677
678            try
679            {
680                if(httpobject[localvalue].readyState == 4)
681                {
682                }
683
684                if(httpobject[localvalue].status == 200)
685                {
686                }
687            }
688            catch (e)
689            {
690                return;
691            }
692
693            if(httpobject[localvalue].readyState == 4 && httpobject[localvalue].status == 200)
694            {
695                var response = httpobject[localvalue].responseText.split("<EXTRAINSTRUCTIONS>");
696
697                document.getElementById('foregrounddiv').innerHTML = response[0];
698
699                if(response[1])
700                {
701                    eval(response[1]);
702                }
703
704            }
705
706
707        };
708
709        var url = '/queries/queryemailsubscriptionforeground.php';
710        var poststring = 'action=submit&sourcepage=' + domainAbbreviation + '+Search+Page+Popup&email=' + email;
711
712        httpobject[localvalue].open('post',url,true);
713        httpobject[localvalue].setRequestHeader('content-type', 'application/x-www-form-urlencoded');
714        httpobject[localvalue].send(poststring);
715
716        requestcount += 1;
717
718        return;
719
720    }
721
722
723    function hideforegrounddiv()
724    {
725        document.getElementById('backgrounddiv').style.visibility = 'hidden';
726        document.getElementById('foregrounddiv').style.visibility = 'hidden';
727        document.getElementById('foregrounddiv').innerHTML = '&nbsp;';
728    }
729
730    function checkforentersubscriptionemail(theEvent)
731    {
732        if (theEvent == null)
733        {
734            theEvent = window.event;
735        }
736
737        if (theEvent.target)
738        {
739            theTarget = theEvent.target;
740        }
741        else
742        {
743            theTarget = theEvent.srcElement;
744        }
745
746        if (theEvent.keyCode == 13)
747        {
748            submitsubscriptionemail();
749        }
750    }
751
752    function facebookpopup(url)
753    {
754        var width = 680;
755        var height = 400;
756
757        var leftposition = Number((screen.width/2)-(width/2));
758        var topposition = Number((screen.height/2)-(height/2));
759
760        window.open(url,'facebookwindow','width=' + width + ',height=' + height + ',resizable=1,toolbar=0,menubar=0,status=0,location=0,left=' + leftposition + ',top=' + topposition);
761    }
762
763    function googlepluspopup(url)
764    {
765        var width = 720;
766        var height = 500;
767
768        var leftposition = Number((screen.width/2)-(width/2));
769        var topposition = Number((screen.height/2)-(height/2));
770
771        window.open(url,'googlepluswindow','width=' + width + ',height=' + height + ',resizable=1,toolbar=0,menubar=0,status=0,location=0,left=' + leftposition + ',top=' + topposition);
772    }
773
774    function checkfacebookcount(sourceurl)
775    {
776        $.get('https://graph.facebook.com/' + sourceurl + '', function(data) {
777
778            var fbshares = 0;
779            var fblikes = 0;
780            var fbtotal = 0;
781
782            if ((data.shares != 0) && (data.shares != undefined) && (data.shares != null))
783            {
784                fbshares = data.shares;
785            }
786
787            if ((data.likes != 0) && (data.likes != undefined) && (data.likes != null))
788            {
789                fblikes = data.likes;
790            }
791
792            fbtotal = fbshares + fblikes;
793
794            if(true || fbtotal > 0)
795            {
796                document.getElementById('facebookcountdiv').style.display = 'inline-block';
797                document.getElementById('facebookcount').innerHTML = fbtotal;
798            }
799
800        },'jsonp');
801
802    }
803
804    function checkgooglepluscount(sourceurl)
805    {
806
807        $.get('/queries/querysocialapis.php?target=googleplus&url=' + sourceurl, function(data) {
808
809            if ((data != 0) && (data != undefined) && (data != null))
810            {
811                document.getElementById('googlepluscountdiv').style.display = 'inline-block';
812                document.getElementById('googlepluscount').innerHTML = data;
813            }
814        },'html');
815
816    }
817
818    function mouseoverfacebook()
819    {
820        var targetobject = document.getElementById('facebookimage');
821        targetobject.src = '/assets/images/IconFacebookSmall.png';
822    }
823
824    function mouseoutfacebook()
825    {
826        var targetobject = document.getElementById('facebookimage');
827        targetobject.src = '/assets/images/IconFacebookSmallGrayscale.png';
828    }
829
830    function mouseovergoogleplus()
831    {
832        var targetobject = document.getElementById('googleplusimage');
833        targetobject.src = '/assets/images/IconGooglePlusSmall.png';
834    }
835
836    function mouseoutgoogleplus()
837    {
838        var targetobject = document.getElementById('googleplusimage');
839        targetobject.src = '/assets/images/IconGooglePlusSmallGrayscale.png';
840    }
841
842    var closetimersearchtypeoptions    = 0;
843
844    function showsearchtypeoptions()
845    {
846        cancelclosetimersearchtypeoptions();
847
848        document.getElementById('searchtypeoptionsdiv').style.display = 'inline-block';
849    }
850
851
852    function hidesearchtypeoptionstime()
853    {
854        closetimersearchtypeoptions = window.setTimeout(hidesearchtypeoptions, 250);
855    }
856
857    function hidesearchtypeoptions()
858    {
859        document.getElementById('searchtypeoptionsdiv').style.display = 'none';
860    }
861
862    function cancelclosetimersearchtypeoptions()
863    {
864        if(closetimersearchtypeoptions)
865        {
866            window.clearTimeout(closetimersearchtypeoptions);
867            closetimersearchtypeoptions = null;
868        }
869    }
870
871
872    function showcolorchart(targetcolorid,currentcolor,currenturl,flagscroll)
873    {
874        var localvalue = requestcount;
875
876        var poststring = 'action=showcolors&targetcolorid=' +targetcolorid + '&currentcolor=' + currentcolor + '&currenturl=' + encodeURIComponent(currenturl);
877
878        if(flagscroll == 1)
879        {
880            var sourceposx, sourceposy;
881            var sourceobject = document.getElementById(targetcolorid + 'div');
882
883            if (sourceobject.offsetParent)
884            {
885                sourceposx = sourceobject.offsetLeft;
886                sourceposy = sourceobject.offsetTop;
887
888                while (sourceobject = sourceobject.offsetParent)
889                {
890                    sourceposx += sourceobject.offsetLeft;
891                    sourceposy += sourceobject.offsetTop;
892                }
893            }
894
895
896            document.getElementById('sidebarcolordiv').scrollIntoView(true);
897            //window.scrollTo(0,sourceposy - 50);
898        }
899
900        document.getElementById(targetcolorid + 'chartdiv').innerHTML = "<img src='/assets/images/Searching.gif' style='display: inline-block'>";
901        document.getElementById(targetcolorid + 'chartdiv').style.display = 'inline-block';
902
903        httpobject[localvalue] = newHttpReq();
904        httpobject[localvalue].onreadystatechange = function(){
905
906            try
907            {
908                if(httpobject[localvalue].readyState == 4)
909                {
910                }
911
912                if(httpobject[localvalue].status == 200)
913                {
914                }
915            }
916            catch (e)
917            {
918                return;
919            }
920
921            if(httpobject[localvalue].readyState == 4 && httpobject[localvalue].status == 200)
922            {
923                document.getElementById(targetcolorid + 'chartdiv').innerHTML = httpobject[localvalue].responseText;
924            }
925
926
927        };
928
929        var url = '/queries/querysearchenginecolorchart.php';
930
931        httpobject[localvalue].open('post',url,true);
932        httpobject[localvalue].setRequestHeader("content-type", "application/x-www-form-urlencoded");
933        httpobject[localvalue].send(poststring);
934
935        //alert(poststring);
936
937        requestcount += 1;
938
939
940    }
941
942    function highlightcolor(targetcolorid,targetcolor)
943    {
944        //alert(targetcolorid + ' - ' + targetcolor);
945        document.getElementById(targetcolorid + 'div').style.backgroundImage = 'none';
946        document.getElementById(targetcolorid + 'div').style.backgroundColor = targetcolor;
947    }
948
949    function selectcolor(targetcolorid,targeturl)
950    {
951        document.getElementById(targetcolorid + 'chartdiv').innerHTML = "<img src='/assets/images/Searching.gif' style='display: inline-block'>";
952        window.location = targeturl;
953    }
954
955    function showcolorcharttop(currenturl)
956    {
957        var localvalue = requestcount;
958
959        var poststring = 'action=showcolors&currenturl=' + encodeURIComponent(currenturl);
960
961        //alert(poststring);
962
963        document.getElementById('messagediv').innerHTML = "<img src='/assets/images/Searching.gif' style='display: inline-block; padding-top: 25px; padding-bottom: 25px;'>";
964        document.getElementById('messagediv').style.display = 'inline-block';
965
966        httpobject[localvalue] = newHttpReq();
967        httpobject[localvalue].onreadystatechange = function(){
968
969            try
970            {
971                if(httpobject[localvalue].readyState == 4)
972                {
973                }
974
975                if(httpobject[localvalue].status == 200)
976                {
977                }
978            }
979            catch (e)
980            {
981                return;
982            }
983
984            if(httpobject[localvalue].readyState == 4 && httpobject[localvalue].status == 200)
985            {
986                document.getElementById('messagediv').innerHTML = httpobject[localvalue].responseText;
987            }
988
989
990        };
991
992        var url = '/queries/querysearchenginecolorcharttop.php';
993
994        httpobject[localvalue].open('post',url,true);
995        httpobject[localvalue].setRequestHeader("content-type", "application/x-www-form-urlencoded");
996        httpobject[localvalue].send(poststring);
997
998        //alert(poststring);
999
1000        requestcount += 1;
1001
1002
1003    }
1004
1005
1006    function highlightcolortop(targetcolorid,targetcolor)
1007    {
1008        //alert(targetcolorid + ' - ' + targetcolor);
1009        document.getElementById(targetcolorid + 'topdiv').style.backgroundImage = 'none';
1010        document.getElementById(targetcolorid + 'topdiv').style.backgroundColor = targetcolor;
1011    }
1012
1013    function selectcolortop(targetcolorid,targetcolor,targeturl)
1014    {
1015        flagcolorselected = true;
1016        document.getElementById(targetcolorid + 'topdiv').style.backgroundColor = targetcolor;
1017        document.getElementById(targetcolorid + 'topchartdiv').innerHTML = "<img src='/assets/images/Searching.gif' style='display: inline-block'>";
1018        window.location = targeturl;
1019    }
1020
1021
1022    function showdimensionsapplychanges()
1023    {
1024        document.getElementById('dimensionsapplychangesdiv').style.display = 'inline-block';
1025    }
1026
1027    function showdimensionsapplychangestop()
1028    {
1029        document.getElementById('dimensionsapplychangestopdiv').style.display = 'inline-block';
1030    }
1031
1032    function dimensionsapplychanges(currenturl)
1033    {
1034        var minimumprintwidth = document.getElementById('minimumprintwidth').value;
1035        var minimumprintheight = document.getElementById('minimumprintheight').value;
1036
1037        var maximumprintwidth = document.getElementById('maximumprintwidth').value;
1038        var maximumprintheight = document.getElementById('maximumprintheight').value;
1039
1040        if(minimumprintwidth > 50 && minimumprintheight > 50)
1041        {
1042            alert('Both dimensions can not exceed 48".  Please reduce one of your dimensions to less than 48".');
1043            return;
1044        }
1045
1046        //var newurl = currenturl + '?minimumprintwidth=' + minimumprintwidth + '&minimumprintheight=' + minimumprintheight + '&maximumprintwidth=' + maximumprintwidth + '&maximumprintheight=' + maximumprintheight;
1047        var newurl = currenturl + '?minimumprintwidth=' + minimumprintwidth + '&minimumprintheight=' + minimumprintheight;
1048
1049        window.location = newurl;
1050    }
1051
1052    function dimensionsapplychangestop(currenturl)
1053    {
1054        var minimumprintwidth = document.getElementById('minimumprintwidthtop').value;
1055        var minimumprintheight = document.getElementById('minimumprintheighttop').value;
1056
1057        if(minimumprintwidth > 50 && minimumprintheight > 50)
1058        {
1059            alert('Both dimensions can not exceed 48".  Please reduce one of your dimensions to less than 48".');
1060            return;
1061        }
1062
1063        //var newurl = currenturl + '?minimumprintwidth=' + minimumprintwidth + '&minimumprintheight=' + minimumprintheight + '&maximumprintwidth=' + maximumprintwidth + '&maximumprintheight=' + maximumprintheight;
1064        var newurl = currenturl + '?minimumprintwidth=' + minimumprintwidth + '&minimumprintheight=' + minimumprintheight;
1065
1066        window.location = newurl;
1067    }
1068
1069    var touchx0;
1070    var touchy0;
1071    var timestamp0;
1072
1073    var touchxcurrent;
1074    var touchycurrent;
1075
1076    function touchcapturestart(evt)
1077    {
1078        if(evt.touches)
1079        {
1080            timestamp0 = new Date();
1081            timestamp0 = timestamp0.getTime();
1082
1083            touchx0 = evt.touches[0].pageX;
1084            touchy0 = evt.touches[0].pageY;
1085
1086            touchxcurrent = touchx0;
1087            touchycurrent = touchy0;
1088        }
1089    }
1090
1091    function touchcapturemove(evt)
1092    {
1093        if(evt.touches)
1094        {
1095            touchxcurrent = evt.touches[0].pageX;
1096            touchycurrent = evt.touches[0].pageY;
1097        }
1098    }
1099
1100    function touchcaptureend(evt)
1101    {
1102        if(isNaN(touchx0) || isNaN(touchy0) || isNaN(touchxcurrent) || isNaN(touchycurrent))
1103        {
1104            return;
1105        }
1106
1107        var touchdeltax = touchxcurrent - touchx0;
1108        var touchdeltay = touchycurrent - touchy0;
1109        var currenttime = new Date();
1110        currenttime = currenttime.getTime();
1111
1112        var touchtimestampdelta = currenttime - timestamp0;
1113
1114        //alert(touchdeltax + ' - ' + touchdeltay + ' - ' + touchtimestampdelta);
1115
1116        if(touchdeltax < -100 && Math.abs(touchdeltay) < 100 && touchtimestampdelta < 1500)
1117        {
1118            if(document.getElementById('linknext'))
1119            {
1120                showswipeinprogress();
1121                document.getElementById('linknext').click();
1122            }
1123        }
1124
1125        if(touchdeltax > 100 && Math.abs(touchdeltay) < 100 && touchtimestampdelta < 1500)
1126        {
1127            if(document.getElementById('linkprevious'))
1128            {
1129                showswipeinprogress();
1130                document.getElementById('linkprevious').click();
1131            }
1132        }
1133
1134    }
1135
1136    function showswipeinprogress()
1137    {
1138        var widthclient = parseInt(document.documentElement.clientWidth);
1139        var heightclient = parseInt(document.documentElement.clientHeight);
1140
1141        var widthtarget = 131;
1142        var heighttarget = 23;
1143
1144        var offsetleft = 0;
1145        var offsettop = 0;
1146
1147        if(true)
1148        {
1149            if(document.documentElement.scrollTop && !document.body.scrollTop)
1150            {
1151                offsetleft = document.documentElement.scrollLeft;
1152                offsettop = document.documentElement.scrollTop;
1153            }
1154            else
1155            {
1156                offsetleft = document.body.scrollLeft;
1157                offsettop = document.body.scrollTop;
1158            }
1159        }
1160        else
1161        {
1162            var sourceobject = document.getElementById('h1title');
1163
1164            if (sourceobject.offsetParent)
1165            {
1166                offsettop = sourceobject.offsetTop;
1167
1168                while (sourceobject = sourceobject.offsetParent)
1169                {
1170                    offsettop += sourceobject.offsetTop;
1171                }
1172            }
1173        }
1174
1175        if(!document.getElementById('foregrounddiv') || !document.getElementById('backgrounddiv'))
1176        {
1177
1178            var newdiv;
1179            var cssstyle;
1180
1181            // Background Div
1182            if(!document.getElementById('backgrounddiv'))
1183            {
1184                newdiv = document.createElement('div');
1185                cssstyle = 'position: fixed; z-index: 5000; left: 0px; top: 0px; width: 10px; height: 10px; background-color: #000000; visibility: hidden; opacity: 0.25; filter: alpha(opacity=25);';
1186                newdiv.id = 'backgrounddiv';
1187                newdiv.setAttribute('style',cssstyle);
1188                newdiv.style.cssText = cssstyle;
1189                document.body.appendChild(newdiv);
1190            }
1191
1192            // Foreground Div
1193            if(!document.getElementById('foregrounddiv'))
1194            {
1195                newdiv = document.createElement('div');
1196                cssstyle = 'position: fixed; z-index: 5001; left: 0px; top: 0px; width: 10px; min-height: 10px; padding: 0px; overflow: hidden; border: none; background-color: transparent; visibility: hidden; box-shadow: none;';
1197                newdiv.id = 'foregrounddiv';
1198                newdiv.setAttribute('style',cssstyle);
1199                newdiv.style.cssText = cssstyle;
1200                document.body.appendChild(newdiv);
1201            }
1202        }
1203
1204        var backgroundobject = document.getElementById('backgrounddiv');
1205        backgroundobject.style.width = '100%';
1206        backgroundobject.style.height = '100%';
1207        //backgroundobject.style.visibility = 'visible';
1208
1209        var foregrounddiv = document.getElementById('foregrounddiv');
1210        foregrounddiv.style.width = widthtarget + 'px';
1211        foregrounddiv.style.height = heighttarget + 'px';
1212        foregrounddiv.style.backgroundColor = 'transparent';
1213        foregrounddiv.style.border = 'none';
1214        foregrounddiv.style.boxShadow = 'none';
1215        foregrounddiv.innerHTML = "<img src='/assets/images/Searching.gif' style='float: left;'>";
1216
1217        foregrounddiv.style.left = (offsetleft + parseInt((widthclient - widthtarget) / 2)) + 'px';
1218        foregrounddiv.style.top = (offsettop + parseInt((heightclient - heighttarget) / 2)) + 'px';
1219        //foregrounddiv.style.top = offsettop + 'px';
1220
1221        foregrounddiv.style.visibility = 'visible';
1222
1223    }
1224
1225    var lastsourcediv = '';
1226    var lastsourcedropdown = '';
1227    var lastsourcedropdownclassname = '';
1228
1229    function showOptions(optionname)
1230    {
1231        if(lastsourcediv != '')
1232        {
1233            document.getElementById('hiddendivscontainer').appendChild(lastsourcediv);
1234        }
1235
1236        var sourcedropdown = document.getElementById('dropdown' + optionname);
1237        var sourcediv = document.getElementById('hidden' + optionname + 'div');
1238        var targetdiv = document.getElementById('messagediv');
1239        //targetdiv.appendChild(sourcediv);
1240
1241        if(lastsourcedropdownclassname != '')
1242        {
1243            lastsourcedropdown.className = lastsourcedropdownclassname;
1244        }
1245
1246        if(sourcediv != lastsourcediv)
1247        {
1248            targetdiv.style.display = 'none';
1249        }
1250        else
1251        {
1252
1253        }
1254
1255        if(targetdiv.style.display == 'none')
1256        {
1257            if(sourcedropdown)
1258            {
1259                if(sourcedropdown.className != 'customdropdownselected')
1260                {
1261                    lastsourcedropdownclassname = sourcedropdown.className;
1262                }
1263
1264                sourcedropdown.className = 'customdropdownselected';
1265                sourcedropdown.focus();
1266            }
1267            
1268            targetdiv.innerHTML = sourcediv.innerHTML;
1269            targetdiv.style.display = 'inline-block';
1270
1271            if(optionname == 'colors')
1272            {
1273                showcolorcharttop(javascriptCurrentUrl);
1274            }
1275
1276            if(optionname == 'collections')
1277            {
1278                showAllCollections('initialLoad', '', javascriptCurrentTag, '');
1279            }
1280
1281            if(optionname == 'shapes')
1282            {
1283                //showShapeOptions(javascriptCurrentUrl);
1284            }
1285            
1286            if(optionname == 'galleries')
1287            {
1288                if(document.getElementById('horizontalScrollingArtistCollectionsParentContainerDiv'))
1289                {
1290                    document.getElementById('horizontalScrollingArtistCollectionsParentContainerDiv').style.display = 'none';
1291                }
1292            }
1293        }
1294        else
1295        {
1296            if(optionname == 'collections')
1297            {
1298                //targetdiv.scrollIntoView(true);
1299                window.scrollTo(0,0);
1300            }
1301            
1302            targetdiv.style.display = 'none';
1303          
1304            if(document.getElementById('horizontalScrollingArtistCollectionsParentContainerDiv'))
1305            {
1306                document.getElementById('horizontalScrollingArtistCollectionsParentContainerDiv').style.display = 'inline-block';
1307            }          
1308            
1309        }
1310
1311        lastsourcediv = sourcediv;
1312        lastsourcedropdown = sourcedropdown;
1313    }
1314    
1315    function hideOptions()
1316    {
1317        document.getElementById('messagediv').style.display = 'none';
1318    }
1319
1320    function showSearchCollectionMainProducts()
1321    {
1322        var targetDiv = document.getElementById('searchCollectionMainProductsContainerDiv');
1323
1324        if(targetDiv.style.display == 'none')
1325        {
1326            targetDiv.style.display = 'flex';
1327            document.getElementById('dropdownproducts').className = 'customdropdownhighlighted';
1328        }
1329        else
1330        {
1331            targetDiv.style.display = 'none';
1332            document.getElementById('dropdownproducts').className = 'customdropdown';
1333        }
1334    }
1335
1336    function showAllCollections(action, tab, tag, page, targetDivId)
1337    {
1338        var localvalue = requestcount;
1339
1340        if(targetDivId === undefined || targetDivId === '')
1341        {
1342            targetDivId = 'messagediv';
1343        }
1344
1345        var productType = javascriptUrlProductType;
1346        var collectionUrl = javascriptUrlCollection;
1347        
1348        var postString = 'action=' + action + '&tab=' + tab + '&currentTag=' + encodeURIComponent(tag) + '&currentCollectionUrl=' + collectionUrl + "&page=" + page + "&productType=" + productType + "&targetDivId=" + targetDivId;
1349
1350        //alert(targetDivId);
1351
1352        document.getElementById(targetDivId).innerHTML = "<img src='/assets/images/Searching.gif' style='display: inline-block; padding-top: 25px; padding-bottom: 25px;'>";
1353        document.getElementById(targetDivId).style.display = 'inline-block';
1354
1355        if(true || page > 1 || action != 'initialLoad')
1356        {
1357            document.getElementById(targetDivId).scrollIntoView(true);
1358        }
1359
1360        httpobject[localvalue] = newHttpReq();
1361        httpobject[localvalue].onreadystatechange = function(){
1362
1363            try
1364            {
1365                if(httpobject[localvalue].readyState == 4)
1366                {
1367                }
1368
1369                if(httpobject[localvalue].status == 200)
1370                {
1371                }
1372            }
1373            catch (e)
1374            {
1375                return;
1376            }
1377
1378            if(httpobject[localvalue].readyState == 4 && httpobject[localvalue].status == 200)
1379            {
1380                document.getElementById(targetDivId).innerHTML = httpobject[localvalue].responseText;
1381				document.getElementById(targetDivId).scrollIntoView(true);
1382            }
1383
1384
1385        };
1386
1387        var url = '/queries/querySearchEngineCollectionsDropDown.php';
1388
1389        httpobject[localvalue].open('post',url,true);
1390        httpobject[localvalue].setRequestHeader("content-type", "application/x-www-form-urlencoded");
1391        httpobject[localvalue].send(postString);
1392
1393        requestcount += 1;
1394    }
1395
1396    function toggleNavigationSubjectsProducts()
1397    {
1398		var targetId = 'searchEngineNavigationSubjectChildrenProductsContainerDiv';
1399		
1400		if(!document.getElementById(targetId))
1401		{
1402			targetId = 'searchEngineNavigationSubjectChildrenProductsContainerDiv002';
1403		}
1404		
1405        var className = document.getElementById(targetId).className;
1406        var newClassName = 'parentLimitChildrenNo';
1407
1408        if(className == 'parentLimitChildrenNo')
1409        {
1410            newClassName = 'parentLimitChildrenYes';
1411            document.getElementById(targetId).className = newClassName;
1412            document.getElementById(targetId).scrollIntoView(true);
1413            document.getElementById('navigationSubjectsProductsButtonCaption').innerHTML = 'More Subjects';
1414            document.getElementById('navigationSubjectsProductsButtonImage').src = '/images/ArrowDownTransparent.png';
1415        }
1416        else
1417        {
1418            document.getElementById(targetId).className = newClassName;
1419            document.getElementById('navigationSubjectsProductsButtonCaption').innerHTML = 'Collapse';
1420            document.getElementById('navigationSubjectsProductsButtonImage').src = '/images/ArrowUpTransparent.png';
1421        }
1422
1423
1424    }
1425
1426
1427    function togglecollections()
1428    {
1429        //alert(searchcollectiongroupid);
1430
1431        if(document.getElementById('collectionsexpanddiv').getAttribute('customvisible') != 1)
1432        {
1433            document.getElementById('collectionsexpanddiv').setAttribute('customvisible',1);
1434
1435            document.getElementById('collectionsexpanddiv').style.display = 'none';
1436            document.getElementById('collectionsbottomdiv').style.display = 'inline-block';
1437        }
1438        else
1439        {
1440            document.getElementById('collectionsexpanddiv').setAttribute('customvisible',0);
1441
1442            document.getElementById('collectionsexpanddiv').style.display = 'inline-block';
1443            document.getElementById('collectionsbottomdiv').style.display = 'none';
1444
1445            document.getElementById('collectionstopdiv').scrollIntoView(true);
1446        }
1447
1448        if(false)
1449        {
1450            if(document.getElementById('collectionsexpanddiv').style.display != 'inline-block')
1451            {
1452                document.getElementById('collectionsexpanddiv').style.display = 'none';
1453                document.getElementById('collectionsbottomdiv').style.display = 'inline-block';
1454            }
1455            else
1456            {
1457                document.getElementById('collectionsexpanddiv').style.display = 'inline-block';
1458                document.getElementById('collectionsbottomdiv').style.display = 'none';
1459
1460                document.getElementById('collectionstopdiv').scrollIntoView(true);
1461            }
1462        }
1463    }
1464
1465
1466    function toggleCollectionsNew(memKey, action)
1467    {
1468        var localValue = requestcount;
1469        var postString = "collectionGroupId=" + memKey + "&action=" + action;
1470
1471        httpobject[localValue] = newHttpReq();
1472        httpobject[localValue].onreadystatechange = function(){
1473
1474            try
1475            {
1476                if(httpobject[localValue].readyState == 4)
1477                {
1478                }
1479
1480                if(httpobject[localValue].status == 200)
1481                {
1482                }
1483            }
1484            catch (e)
1485            {
1486                return;
1487            }
1488
1489            if(httpobject[localValue].readyState == 4 && httpobject[localValue].status == 200)
1490            {
1491                document.getElementById('searchEngineCollectionsContainerDiv').scrollIntoView(true);
1492                document.getElementById('searchEngineCollectionsContainerDiv').innerHTML = httpobject[localValue].responseText;
1493            }
1494
1495
1496        };
1497
1498        document.getElementById('collectionsToggleDiv').innerHTML = "<img src='/assets/images/Searching.gif' style='display: inline-block;' alt='Loading' title='Loading'>";
1499
1500        var url = '/queries/querySearchEngineCollections.php';
1501
1502        httpobject[localValue].open('post',url,true);
1503        httpobject[localValue].setRequestHeader("Content-type", "application/x-www-form-urlencoded");
1504        httpobject[localValue].send(postString);
1505
1506        requestcount += 1;
1507
1508
1509
1510        //alert(searchcollectiongroupid);
1511
1512        if(document.getElementById('collectionsexpanddiv').getAttribute('customvisible') != 1)
1513        {
1514            document.getElementById('collectionsexpanddiv').setAttribute('customvisible',1);
1515
1516            document.getElementById('collectionsexpanddiv').style.display = 'none';
1517            document.getElementById('collectionsbottomdiv').style.display = 'inline-block';
1518        }
1519        else
1520        {
1521            document.getElementById('collectionsexpanddiv').setAttribute('customvisible',0);
1522
1523            document.getElementById('collectionsexpanddiv').style.display = 'inline-block';
1524            document.getElementById('collectionsbottomdiv').style.display = 'none';
1525
1526            document.getElementById('collectionstopdiv').scrollIntoView(true);
1527        }
1528
1529    }
1530
1531
1532    function showMoreFromArtist(urlSearchEngineType, urlMedium, urlTag, urlProduct, urlCollection, artworkId, currentPage)
1533    {
1534        if(document.getElementById("moreImagesDiv[" + artworkId + "]"))
1535        {
1536            hidemorefromartist(artworkId);
1537
1538            return;
1539        }
1540
1541		window.dataLayer = window.dataLayer || [];
1542		dataLayer.push({'event': 'search_engine_button_show_more_from_artist_click'});
1543
1544        var newdiv = document.createElement("div");
1545        newdiv.id = "moreImagesDiv[" + artworkId + "]";
1546        newdiv.style.display = "inline-block";
1547        newdiv.style.boxSizing = 'border-box';
1548        newdiv.style.visibility = "visible";
1549        newdiv.style.width = "100%";
1550        //newdiv.style.maxWidth = "400px";
1551        newdiv.style.overflow = 'hidden';
1552        newdiv.style.textAlign = "center";
1553        newdiv.style.borderWidth = '1px';
1554        newdiv.style.borderStyle = 'solid';
1555        newdiv.style.borderColor = '#AAAAAA';
1556        newdiv.style.borderRadius = '0px';
1557        newdiv.style.padding = '0px';
1558        newdiv.style.margin = '0px';
1559        newdiv.style.marginTop = '10px';
1560        newdiv.style.marginBottom = '25px';
1561        newdiv.style.boxShadow = '0px 5px 8px #EEEEEE';
1562        newdiv.innerHTML = "<img style='display: inline-block; padding-top: 15px; padding-bottom: 10px;' src='/assets/images/Searching.gif'>";
1563
1564        var referencediv = '';
1565        
1566        if(document.getElementById("artistNameDiv[" + artworkId + "]"))
1567        {
1568            referencediv = document.getElementById("artistNameDiv[" + artworkId + "]");
1569        }
1570 
1571        if(document.getElementById("flowDataDiv[" + artworkId + "]"))
1572        {
1573            referencediv = document.getElementById("flowDataDiv[" + artworkId + "]");
1574        } 
1575        
1576        referencediv.parentNode.insertBefore(newdiv, referencediv.nextSibling);
1577
1578        var localValue = requestcount;
1579        var localArtworkId = artworkId;
1580        var postString = "artworkId=" + artworkId + "&urlSearchEngineType=" + urlSearchEngineType + "&urlMedium=" + urlMedium + "&urlTag=" + urlTag + "&urlProduct=" + urlProduct + "&urlCollection=" + urlCollection + "&currentPage=" + currentPage;
1581
1582        httpobject[localValue] = newHttpReq();
1583        httpobject[localValue].onreadystatechange = function(){
1584
1585            try
1586            {
1587                if(httpobject[localValue].readyState == 4)
1588                {
1589                }
1590
1591                if(httpobject[localValue].status == 200)
1592                {
1593                }
1594            }
1595            catch (e)
1596            {
1597                return;
1598            }
1599
1600            if(httpobject[localValue].readyState == 4 && httpobject[localValue].status == 200)
1601            {
1602                document.getElementById('moreImagesDiv[' + localArtworkId + ']').innerHTML = httpobject[localValue].responseText;
1603            }
1604
1605
1606        };
1607
1608        var url = '/queries/querySearchEngineMoreImagesNew.php';
1609
1610        httpobject[localValue].open('post',url,true);
1611        httpobject[localValue].setRequestHeader("Content-type", "application/x-www-form-urlencoded");
1612        httpobject[localValue].send(postString);
1613
1614        requestcount += 1;
1615    }
1616
1617    function hidemorefromartist(artworkid)
1618    {
1619        if(document.getElementById("moreImagesDiv[" + artworkid + "]"))
1620        {
1621            var divtoremove = document.getElementById("moreImagesDiv[" + artworkid + "]");
1622
1623            divtoremove.parentNode.removeChild(divtoremove);
1624        }
1625    }
1626
1627    function scrolltoartwork(artworkid)
1628    {
1629        if(document.getElementById('artworkdiv[' + artworkid + ']'))
1630        {
1631            var targetdiv = document.getElementById('artworkdiv[' + artworkid + ']');
1632            targetdiv.scrollIntoView(true);
1633        }
1634    }
1635
1636    var previousTabId = '';
1637
1638    function selectProd
1638uctDetailTab(tabId)
1639    {
1640        var availableTabs = document.getElementsByClassName('productDetailTabLink');
1641
1642        for(i = 0; i < availableTabs.length; i ++)
1643        {
1644            var currentTabId = availableTabs[i].id;
1645            currentTabId = currentTabId.replace("productDetailTabLink[", "");
1646            currentTabId = currentTabId.replace("]", "");            
1647            
1648            if(currentTabId == tabId)
1649            {
1650                availableTabs[i].className = 'productDetailTabLink productDetailTabLinkSelected';
1651
1652                var sourceDivId = 'productDetailDiv[' + currentTabId + ']';
1653
1654                if(document.getElementById(sourceDivId))
1655                {
1656                    document.getElementById(sourceDivId).className = 'productDetailContentDiv productDetailContentDivSelected';
1657                }
1658            }
1659            else
1660            {
1661                availableTabs[i].className = 'productDetailTabLink';
1662
1663                var sourceDivId = 'productDetailDiv[' + currentTabId + ']';
1664
1665                if(document.getElementById(sourceDivId))
1666                {
1667                    document.getElementById(sourceDivId).className = 'productDetailContentDiv';
1668                }
1669            }
1670        }
1671
1672        if(false && previousTabId == 'video')
1673        {
1674            var youtubeVideos = document.getElementsByClassName('productDetailYoutubeVideo');
1675
1676            for(i = 0; i < youtubeVideos.length; i++)
1677            {
1678                var previousSrc = youtubeVideos[i].src;
1679                youtubeVideos[i].src = '';
1680                youtubeVideos[i].src = previousSrc;
1681
1682            }
1683        }
1684
1685        previousTabId = tabId;
1686
1687    }
1688
1689    function submitDescriptionForm()
1690    {
1691        var targetPageDescription = document.getElementById('targetPageDescription').value;
1692
1693        if(targetPageDescription.length < 200)
1694        {
1695            alert('You must enter at least 200 characters.');
1696            return;
1697        }
1698
1699        document.getElementById('targetPageDescriptionForm').submit();
1700    }
1701
1702    function countTargetPageDescriptionCharacters()
1703    {
1704        var targetPageDescription = document.getElementById('targetPageDescription').value;
1705        var numCharacters = targetPageDescription.length;
1706
1707        document.getElementById('targetPageDescriptionNumCharacters').innerHTML = numCharacters;
1708    }
1709
1710    function checkscreenwidth()
1711    {
1712        if(screen.width != screenWidth)
1713        {
1714            storescreenwidth();
1715        }
1716    }
1717
1718    function scrollToProducts()
1719    {
1720        showOptions('products');
1721        //document.getElementById('messagediv').scrollIntoView(true);
1722
1723         $('html, body').animate({
1724                scrollTop: $("#messagediv").offset().top - 20
1725            }, 500);
1726    }
1727
1728    function scrollToCollections()
1729    {
1730        if(!document.getElementById('dropDownCollectionsContainerDiv'))
1731        {
1732            showOptions('collections');
1733        }
1734
1735        //document.getElementById('messagediv').scrollIntoView(true);
1736
1737         $('html, body').animate({
1738                scrollTop: $("#messagediv").offset().top - 20
1739            }, 500);
1740    }
1741
1742    function displayAllFilters()
1743    {
1744        var availableFilters = document.getElementsByClassName('customdropdowncontainer');
1745
1746        for(var i = 0; i < availableFilters.length; i ++)
1747        {
1748            if(availableFilters[i].id == 'customDropdownSort')
1749            {
1750                continue;
1751            }
1752
1753            availableFilters[i].style.display = 'inline-block';
1754        }
1755
1756        document.getElementById('moreFiltersDiv').style.display = 'none';
1757    }
1758
1759    function customDropDownCheckForEnter(e)
1760    {
1761        if(e.keyCode == 13)
1762        {
1763            e.target.click();
1764        }
1765    }
1766    
1767	function searchEngineSearchFocus()
1768    {
1769        if(document.getElementById('searchFormSearchEngine'))
1770        {
1771            var currentClassName = document.getElementById('searchFormSearchEngine').className;
1772            if(currentClassName.indexOf('searchFormSearchEngineActivated') == -1)
1773            {
1774                var newClassName = currentClassName + ' searchFormSearchEngineActivated';
1775                document.getElementById('searchFormSearchEngine').className = newClassName;
1776            }
1777        }
1778        
1779        if(document.getElementById('searchFormSearchEngineSearchTypeDiv'))
1780        {
1781            document.getElementById('searchFormSearchEngineSearchTypeDiv').style.display = 'inline-block';
1782        }
1783
1784        if(document.getElementById('headerCustomSearchTypeDiv'))
1785        {
1786            document.getElementById('headerCustomSearchTypeDiv').style.display = 'inline-block';
1787        }
1788    }
1789    
1790    function checkForEnterSearchFormSearchEngine(e)
1791    {
1792        if (e == null)
1793        {
1794            e = window.event;
1795        }
1796
1797        if (e.keyCode === 13)
1798        {
1799            document.getElementById('searchFormSearchEngine').submit();
1800        }
1801    }    
1802    
1803    function checkForEmptySearchInput(e)
1804    {
1805        if(document.getElementById('searchFormSearchEngineInput').value.length == 0)
1806        {
1807            if(document.getElementById('searchFormSearchEngineImageXClearSearch'))
1808            {
1809                document.getElementById('searchFormSearchEngineImageXClearSearch').style.display = 'none';
1810                document.getElementById('searchFormSearchEngineInput').style.marginLeft = '10px';
1811            }
1812        }  
1813    }
1814
1815    function showSearchTypeOptionsSearchEngine(targetId,triggerMethod)
1816    {
1817        triggerMethod = triggerMethod || 'default';
1818
1819        cancelCloseTimerSearchTypeOptionsSearchEngine();
1820
1821        if(targetId)
1822        {
1823            if(document.getElementById(targetId))
1824            {
1825                document.getElementById(targetId).style.display = 'inline-block';
1826
1827                if(true || triggerMethod == 'keyDown')
1828                {
1829                    globalFocusTrap = focusTrap(document.getElementById(targetId),{onDeactivate: hidesearchtypeoptionsheader, clickOutsideDeactivates: true,});
1830                    globalFocusTrap.activate();
1831                }
1832
1833                return;
1834            }
1835        }
1836
1837        document.getElementById('searchTypeOptionsSearchEngineDiv').style.display = 'inline-block';
1838    }    
1839    
1840    function hideSearchTypeOptionsTimeSearchEngine()
1841    {
1842        closeTimerSearchTypeOptionsSearchEngine = window.setTimeout(hideSearchTypeOptionsSearchEngine, 250);
1843    }
1844
1845    function cancelCloseTimerSearchTypeOptionsSearchEngine()
1846    {
1847        if(closeTimerSearchTypeOptionsSearchEngine)
1848        {
1849            window.clearTimeout(closeTimerSearchTypeOptionsSearchEngine);
1850            closeTimerSearchTypeOptionsSearchEngine = null;
1851        }
1852    }    
1853    
1854    function hideSearchTypeOptionsSearchEngine()
1855    {
1856        var elements = document.getElementsByClassName('searchTypeOptionsContainer');
1857
1858        for(var i = 0; i < elements.length; i ++)
1859        {
1860            elements[i].style.display = 'none';
1861        }
1862
1863        if(document.getElementById('searchTypeOptionsSearchEngineDiv'))
1864        {
1865            document.getElementById('searchTypeOptionsSearchEngineDiv').style.display = 'none';
1866        }
1867    }
1868
1869    function cancelCloseTimerSearchTypeOptionsSearchEngine()
1870    {
1871        if(closeTimerSearchTypeOptionsSearchEngine)
1872        {
1873            window.clearTimeout(closeTimerSearchTypeOptionsSearchEngine);
1874            closeTimerSearchTypeOptionsSearchEngine = null;
1875        }
1876    }    
1877    
1878    function selectSearchTypeSearchEngine(searchTypeId,searchTypeName)
1879    {
1880        var elements = document.getElementsByClassName('searchType');
1881
1882        for(var i = 0; i < elements.length; i ++)
1883        {
1884            elements[i].value = searchTypeId;
1885        }
1886
1887        var elements = document.getElementsByClassName('searchTypeName');
1888
1889        for(var i = 0; i < elements.length; i ++)
1890        {
1891            elements[i].innerHTML = searchTypeName;
1892        }
1893
1894        hideSearchTypeOptionsSearchEngine();
1895    }
1896
1897    function toggleSearchEngineNavigation(parentDivId)
1898    {
1899        var currentClassName = document.getElementById(parentDivId).className;
1900        var newClassName = 'searchEngineNavigationElementContainer searchEngineNavigationElementContainerExpanded';
1901        
1902        if(currentClassName == newClassName)
1903        {
1904            newClassName = 'searchEngineNavigationElementContainer';
1905        }
1906
1907        if(parentDivId == 'searchEngineNavigationColorsDiv' && newClassName == 'searchEngineNavigationElementContainer searchEngineNavigationElementContainerExpanded')
1908        {
1909            showSearchEngineNavigationColorChart();
1910        }
1911        
1912        if(parentDivId == 'searchEngineNavigationCollectionsDiv')
1913        {
1914            var desktopMobile = 'desktop';
1915            var targetDivId = '';
1916            var navigationPosition = getComputedStyle(document.getElementById('searchEngineNavigationDiv')).getPropertyValue('position');
1917            
1918            if(navigationPosition == 'absolute')
1919            {
1920                desktopMobile = 'mobile';
1921                targetDivId = 'searchEngineNavigationCollectionsContainer';
1922            }
1923
1924            if(newClassName == 'searchEngineNavigationElementContainer searchEngineNavigationElementContainerExpanded')
1925            {
1926                showAllCollections('initialLoad', '', javascriptCurrentTag, '', targetDivId);
1927                
1928                if(false && desktopMobile == 'desktop')
1929                {
1930                    newClassName = 'searchEngineNavigationElementContainer';
1931                }
1932            }
1933            else
1934            {
1935                hideOptions();
1936                
1937                document.getElementById('searchEngineNavigationCollectionsContainer').style.display = '';
1938                document.getElementById('searchEngineNavigationCollectionsContainer').innerHTML = '';
1939                
1940                if(desktopMobile == 'mobile')
1941                {
1942                    document.getElementById(parentDivId).scrollIntoView(true);
1943                }
1944            }
1945        }
1946
1947        document.getElementById(parentDivId).className = newClassName;
1948        
1949    }
1950    
1951
1952	function toggleSearchEngineNavigationWhiteLabelWebsites(parentDivId)
1953    {
1954        var currentClassName = document.getElementById(parentDivId).className;
1955        var newClassName = 'searchEngineNavigationElementContainer searchEngineNavigationElementContainerExpanded';
1956        
1957        if(currentClassName == newClassName)
1958        {
1959            newClassName = 'searchEngineNavigationElementContainer';
1960        }
1961
1962        if(parentDivId == 'searchEngineNavigationColorsDiv' && newClassName == 'searchEngineNavigationElementContainer searchEngineNavigationElementContainerExpanded')
1963        {
1964            showSearchEngineNavigationColorChart();
1965        }
1966        
1967        document.getElementById(parentDivId).className = newClassName;
1968    }
1969	
1970
1971    function showSearchEngineNavigationColorChart()
1972    {
1973        var localvalue = requestcount;
1974        
1975        var postString = 'action=showcolors&currenturl=' + encodeURIComponent(javascriptCurrentUrl);
1976
1977        document.getElementById('searchEngineNavigationColorsContainer').innerHTML = "<img src='/assets/images/Searching.gif' style='display: inline-block; padding-top: 25px; padding-bottom: 25px;'>";
1978
1979        httpobject[localvalue] = newHttpReq();          
1980        httpobject[localvalue].onreadystatechange = function(){
1981        
1982            try 
1983            {
1984                if(httpobject[localvalue].readyState == 4)
1985                {
1986                }
1987            
1988                if(httpobject[localvalue].status == 200)
1989                {
1990                }
1991            }
1992            catch (e)
1993            {
1994                return;
1995            }
1996            
1997            if(httpobject[localvalue].readyState == 4 && httpobject[localvalue].status == 200)
1998            {
1999                document.getElementById('searchEngineNavigationColorsContainer').innerHTML = httpobject[localvalue].responseText;
2000            }
2001        
2002        
2003        };      
2004        
2005        var url = '/queries/querySearchEngineNavigationColorChart.php'; 
2006
2007        httpobject[localvalue].open('post',url,true);
2008        httpobject[localvalue].setRequestHeader("content-type", "application/x-www-form-urlencoded");
2009        httpobject[localvalue].send(postString);        
2010
2011        requestcount += 1;  
2012
2013
2014    }   
2015
2016    
2017    function showNavigationDimensionsApplyChanges()
2018    {
2019        document.getElementById('searchEngineNavigationDimensionsApplyChangesDiv').style.display = 'inline-block';
2020    }
2021
2022    function searchEngineNavigationDimensionsApplyChanges(currentUrl)
2023    {
2024        var minimumPrintWidth = document.getElementById('navigationMinimumPrintWidth').value;
2025        var minimumPrintHeight = document.getElementById('navigationMinimumPrintHeight').value;
2026        
2027        if(minimumPrintWidth > 50 && minimumPrintWidth > 50)
2028        {
2029            alert('Both dimensions can not exceed 48".  Please reduce one of your dimensions to less than 48".');
2030            return;
2031        }
2032
2033        var newUrl = currentUrl + '?minimumprintwidth=' + minimumPrintWidth + '&minimumprintheight=' + minimumPrintHeight;
2034        
2035        window.location = newUrl;
2036    }   
2037    
2038    function searchEngineNavigationShowAllSubjects(parentSubjectId, navigationSubjectsProductId, urlFilterProductType, urlFilterMedium)
2039    {
2040        var localvalue = requestcount;
2041
2042        var postString = "parentSubjectId=" + parentSubjectId + "&navigationSubjectsProductId=" + navigationSubjectsProductId + "&urlFilterProductType=" + urlFilterProductType + "&urlFilterMedium=" + urlFilterMedium;
2043
2044        document.getElementById('searchEngineAllSubjectsDiv').style.display = "inline-block";
2045        document.getElementById('searchEngineAllSubjectsDiv').innerHTML = "<img src='/assets/images/Searching.gif'>";
2046
2047        httpobject[localvalue] = newHttpReq();          
2048        httpobject[localvalue].onreadystatechange = function(){
2049        
2050            try 
2051            {
2052                if(httpobject[localvalue].readyState == 4)
2053                {
2054                }
2055            
2056                if(httpobject[localvalue].status == 200)
2057                {
2058                }
2059            }
2060            catch (e)
2061            {
2062                return;
2063            }
2064            
2065            if(httpobject[localvalue].readyState == 4 && httpobject[localvalue].status == 200)
2066            {
2067                document.getElementById('searchEngineViewAllSubjectsDiv').style.display = 'none';
2068                document.getElementById('searchEngineAllSubjectsDiv').style.display = 'inline-block';
2069                document.getElementById('searchEngineAllSubjectsDiv').innerHTML = httpobject[localvalue].responseText;
2070
2071            }
2072        
2073        
2074        };      
2075        
2076        var url = '/queries/querySearchEngineNavigationAllSubjects.php';    
2077
2078        httpobject[localvalue].open('post',url,true);
2079        httpobject[localvalue].setRequestHeader('content-type', 'application/x-www-form-urlencoded');
2080        httpobject[localvalue].send(postString);        
2081        
2082        requestcount += 1;      
2083    
2084    }
2085
2086	function searchEngineNavigationShowAllSubjectsWhiteLabelWebsites(urlFilterProductType, urlFilterMedium)
2087    {
2088        var localvalue = requestcount;
2089
2090        var postString = "&urlFilterProductType=" + urlFilterProductType + "&urlFilterMedium=" + urlFilterMedium;
2091
2092        document.getElementById('searchEngineAllSubjectsDiv').style.display = "inline-block";
2093        document.getElementById('searchEngineAllSubjectsDiv').innerHTML = "<img src='/assets/images/Searching.gif'>";
2094
2095        httpobject[localvalue] = newHttpReq();          
2096        httpobject[localvalue].onreadystatechange = function(){
2097        
2098            try 
2099            {
2100                if(httpobject[localvalue].readyState == 4)
2101                {
2102                }
2103            
2104                if(httpobject[localvalue].status == 200)
2105                {
2106                }
2107            }
2108            catch (e)
2109            {
2110                return;
2111            }
2112            
2113            if(httpobject[localvalue].readyState == 4 && httpobject[localvalue].status == 200)
2114            {
2115                document.getElementById('searchEngineViewAllSubjectsDiv').style.display = 'none';
2116                document.getElementById('searchEngineAllSubjectsDiv').style.display = 'inline-block';
2117                document.getElementById('searchEngineAllSubjectsDiv').innerHTML = httpobject[localvalue].responseText;
2118
2119            }
2120        
2121        
2122        };      
2123        
2124        var url = '/queries/querySearchEngineNavigationAllSubjectsWhiteLabelWebsites.php';    
2125
2126        httpobject[localvalue].open('post',url,true);
2127        httpobject[localvalue].setRequestHeader('content-type', 'application/x-www-form-urlencoded');
2128        httpobject[localvalue].send(postString);        
2129        
2130        requestcount += 1;      
2131    
2132    }
2133
2134    function toggleSearchEngineNavigationMenu(targetState,targetAction = null)
2135    {
2136        var containers = document.getElementsByClassName('container');
2137        
2138        if(targetState === undefined || targetState == '')
2139        {
2140            if(document.getElementById('searchEngineNavigationDiv').style.display != 'inline-block')
2141            {
2142                targetState = 'showMenu';
2143            }
2144            else
2145            {
2146                targetState = 'hideMenu';
2147            }
2148        }
2149		
2150		if(targetAction === null)
2151		{
2152			targetAction = '';
2153		}
2154		
2155		document.getElementById('searchEngineNavigationDiv').setAttribute('data-action', targetAction);		
2156
2157        if(targetState == 'showMenu')
2158        {
2159            window.scrollTo(0, 0);
2160            
2161            var body = document.body;
2162            var html = document.documentElement;
2163
2164            var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
2165            height = height + 'px';
2166
2167            document.getElementById('searchEngineNavigationDiv').style.display = 'inline-flex';
2168            document.getElementById('searchEngineNavigationDiv').style.height = height;
2169			
2170			if(targetAction == 'showStyles' && document.getElementById('searchEngineNavigationStyleDiv'))
2171			{
2172				document.getElementById('searchEngineNavigationStyleDiv').className = 'searchEngineNavigationElementContainer searchEngineNavigationElementContainerExpanded';
2173			}			
2174            
2175            document.getElementById('searchEngineNavigationBackgroundDiv').style.display = 'inline-block';
2176            document.getElementById('searchEngineNavigationBackgroundDiv').style.width = '100%';
2177            document.getElementById('searchEngineNavigationBackgroundDiv').style.height = '100%';
2178        }
2179        else
2180        {
2181            document.getElementById('searchEngineNavigationDiv').style.display = '';
2182            document.getElementById('searchEngineNavigationDiv').style.height = '';
2183            document.getElementById('searchEngineNavigationBackgroundDiv').style.width = '0%';
2184            document.getElementById('searchEngineNavigationBackgroundDiv').style.display = 'none';      
2185        }
2186    }
2187    
2188    function searchEngineNavigationSearchFocus()
2189    {
2190        var currentClassName = document.getElementById('searchEngineNavigationSearchForm').className;
2191        var additionalClassName = 'searchEngineNavigationSearchFormSelected';
2192        
2193        if(currentClassName.indexOf(additionalClassName) == -1)
2194        {
2195            document.getElementById('searchEngineNavigationSearchForm').className += ' ' + additionalClassName;
2196        }
2197        
2198        document.getElementById('searchEngineNavigationSearchTypeDiv').style.display = 'inline-block';
2199
2200    }
2201    
2202    function selectSearchEngineNavigationSearchType(searchType)
2203    {
2204        var newSearchType = searchType;
2205        var newSearchTypeName = document.getElementById('searchEngineSearchType-' + searchType).innerHTML;
2206        
2207        document.getElementById('searchEngineNavigationSearchType').value = searchType;
2208        document.getElementById('searchEngineNavigationSearchTypeName').innerHTML = newSearchTypeName;
2209        
2210        toggleSearchEngineNavigation('searchEngineNavigationSearchTypeDiv');
2211        document.getElementById('searchEngineNavigationSearchInput').focus();
2212    }
2213    
2214    function captureScrollPosition()
2215    {
2216        var widthclient = parseInt(document.documentElement.clientWidth);
2217        var heightclient = parseInt(document.documentElement.clientHeight);
2218
2219		var sourcePosY;
2220		var sourceObject;
2221		var scrollY = document.documentElement ? document.documentElement.scrollTop : document.body.scrollTop;
2222		
2223		if(scrollY == 0)
2224		{
2225			scrollY = document.body.scrollTop;
2226		}
2227
2228        if(document.getElementById('filtersBottomContainerOuterDiv'))
2229        {
2230            sourcePosY = 0;
2231            sourceObject = document.getElementById('filtersContainerOuterDiv');
2232            var currentClassName = document.getElementById('filtersBottomContainerOuterDiv').className;
2233            
2234            if (sourceObject.offsetParent) 
2235            {
2236                sourcePosY = sourceObject.offsetTop;
2237            
2238                while (sourceObject = sourceObject.offsetParent)
2239                {
2240                    sourcePosY += sourceObject.offsetTop;
2241                }
2242            }
2243
2244            if(scrollY > sourcePosY + 200)
2245            {
2246                if(currentClassName != 'filtersScrollDown')
2247                {
2248                    document.getElementById('filtersBottomContainerOuterDiv').className = 'filtersScrollDown';
2249                }
2250            }
2251            else
2252            {
2253                if(currentClassName != '')
2254                {
2255                    document.getElementById('filtersBottomContainerOuterDiv').className = '';
2256                }
2257            }
2258        }
2259
2260		// Search Engine
2261		if(true && document.getElementById('searchEngineRightDiv') && document.getElementById('searchEngineNavigationContainerDiv'))
2262		{
2263			var positionYTopPagination = 0;
2264			var positionYBottomPagination = 0;
2265			var heightSearchResults = parseInt(getComputedStyle(document.getElementById('searchEngineResultsParentDiv')).getPropertyValue('height'));
2266						
2267			sourceObject = document.getElementById('searchEngineRightDiv');
2268
2269			if (sourceObject.offsetParent) 
2270			{
2271				positionYTopPagination = sourceObject.offsetTop;
2272			
2273				while (sourceObject = sourceObject.offsetParent)
2274				{
2275					positionYTopPagination += sourceObject.offsetTop;
2276				}
2277			}
2278			
2279			var targetClassName = 'locationTop';
2280
2281			if(scrollY > positionYTopPagination && heightSearchResults > heightclient * 1.5)
2282			{
2283				targetClassName = 'locationScroll';
2284			}
2285
2286			document.getElementById('searchEngineNavigationContainerDiv').className = targetClassName;
2287
2288		}
2289		
2290		// Profile Page Search Engine
2291		if(true && document.getElementById('profilePageSearchEngineLeftRightContainerDiv') && document.getElementById('searchEngineNavigationContainerDiv'))
2292		{
2293			var positionYTopPagination = 0;
2294			var positionYBottomPagination = 0;
2295			var heightSearchResults = parseInt(getComputedStyle(document.getElementById('searchEngineResultsParentDiv')).getPropertyValue('height'));
2296
2297			sourceObject = document.getElementById('profilePageSearchEngineLeftRightContainerDiv');
2298
2299			if (sourceObject.offsetParent) 
2300			{
2301				positionYTopPagination = sourceObject.offsetTop;
2302			
2303				while (sourceObject = sourceObject.offsetParent)
2304				{
2305					positionYTopPagination += sourceObject.offsetTop;
2306				}
2307			}
2308			
2309			var targetClassName = 'locationTop';
2310
2311			if(scrollY > positionYTopPagination && heightSearchResults > heightclient * 1.5)
2312			{
2313				targetClassName = 'locationScroll';
2314			}
2315
2316			document.getElementById('searchEngineNavigationContainerDiv').className = targetClassName;
2317
2318		}
2319    }
2320    
2321    function changePage()
2322    {
2323        var targetUrl = document.getElementById('selectPage').options[document.getElementById('selectPage').selectedIndex].value;
2324        window.location = targetUrl;
2325    }
2326    
2327    function returnToTop()
2328    {
2329        $('html, body').animate({scrollTop:0}, 'slow');
2330    }
2331    
2332    function selectDepartment(selectedDepartmentId)
2333    {
2334		if(document.getElementById('searchEngineNavigationDiv'))
2335		{
2336			document.getElementById('searchEngineNavigationDiv').setAttribute('data-selected-department-id', selectedDepartmentId);
2337		}
2338		
2339        var availableDepartmentButtons = document.getElementById('searchEngineNavigationDepartmentDiv').getElementsByClassName('searchEngineNavigationOption');
2340
2341        var newClassName = '';
2342        var currentDepartmentId = '';
2343        var selectedDepartmentName = '';
2344        
2345        for(i = 0; i < availableDepartmentButtons.length; i ++)
2346        {
2347            currentDepartmentId = availableDepartmentButtons[i].getAttribute('data-department-id');
2348
2349            newClassName = 'searchEngineNavigationOption';
2350            
2351            if(currentDepartmentId == selectedDepartmentId)
2352            {
2353                selectedDepartmentName = availableDepartmentButtons[i].getAttribute('data-department-name');
2354                newClassName += ' searchEngineNavigationOptionSelected';
2355            }
2356            
2357            availableDepartmentButtons[i].className = newClassName;
2358           
2359        }
2360        
2361        var availableDepartmentProductGroups = document.getElementById('searchEngineNavigationProductDiv').getElementsByClassName('searchEngineNavigationDepartmentProducts');
2362
2363        for(i = 0; i < availableDepartmentProductGroups.length; i ++)
2364        {
2365            currentDepartmentId = availableDepartmentProductGroups[i].getAttribute('data-department-id');
2366
2367            newClassName = 'searchEngineNavigationDepartmentProducts';
2368            
2369            if(currentDepartmentId == selectedDepartmentId || selectedDepartmentId == 'popular')
2370            {
2371                newClassName += ' searchEngineNavigationDepartmentProductsSelected';
2372                
2373                if(selectedDepartmentId == 'popular')
2374                {
2375                    newClassName += ' searchEngineNavigationDepartmentShowAllProducts';
2376                }
2377                
2378            }
2379                        
2380            availableDepartmentProductGroups[i].className = newClassName;
2381           
2382        }        
2383        
2384        
2385        document.getElementById('searchEngineNavigationSelectedDepartmentName').innerHTML = selectedDepartmentName;
2386        document.getElementById('searchEngineNavigationSelectedProductName').innerHTML = 'All';
2387        
2388        toggleSearchEngineNavigation('searchEngineNavigationDepartmentDiv');
2389        
2390        document.getElementById('searchEngineNavigationProductDiv').className = 'searchEngineNavigationElementContainer searchEngineNavigationElementContainerExpanded';
2391
2392    }
2393    
2394    function detectResize()
2395    {
2396        var desktopMobile = 'desktop';
2397        
2398        //positionPromotionDiv();
2399
2400        if(document.getElementById('searchEngineNavigationDiv'))
2401        {
2402            var navigationPosition = getComputedStyle(document.getElementById('searchEngineNavigationDiv')).getPropertyValue('position');
2403
2404            if(navigationPosition == 'absolute')
2405            {
2406                desktopMobile = 'mobile';
2407            }     
2408          
2409            if(desktopMobile == 'desktop')
2410            {
2411                toggleSearchEngineNavigationMenu('hideMenu');
2412            }
2413        }
2414    }
2415    
2416	function expandStyles()
2417	{
2418		document.getElementById('availableStylesContainerDiv').setAttribute('data-expanded',1);
2419	}	
2420	
2421    //window.onscroll = captureScrollPosition;
2422    window.addEventListener("scroll", captureScrollPosition);
2423    window.addEventListener("resize", detectResize);

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.