PageSourceSearch

https://www.ashqelon.net/Scripts/OldJs/BannerScripts.js?639242374650066645

js ashqelon.net collected 2026-10-02 06:29:01 UTC 10,935 bytes, 255 lines download raw bytes

1
2var DocReady = false;
3
4$(window).on("load", function () {
5    $(window).scroll(function () {
6        var windowBottom = $(this).scrollTop() + $(this).innerHeight();
7        $(".fade-in-banner").each(function () {
8            /* Check the location of each desired element */
9            var objectBottom = $(this).offset().top + $(this).outerHeight();
10
11            /* If the element is completely within bounds of the window, fade it in */
12            if (objectBottom < windowBottom) { //object comes into view (scrolling down)
13                if (!$(this).hasClass("banner-fade-in"))
14                    $(this).addClass("banner-fade-in");
15                //if ($(this).css("opacity") == 0) { $(this).fadeTo(500, 1); }
16            } else { //object goes out of view (scrolling up)
17                // if ($(this).css("opacity") == 1) { $(this).fadeTo(500, 0); }
18            }
19        });
20    }).scroll(); //invoke scroll-handler on page-load
21});
22
23
24function setImage(EmptyBanner_ClientID, srcipt, reload) {
25    if (DocReady) {
26
27        if (reload != false || document["ad" + EmptyBanner_ClientID] == null && document.getElementById(EmptyBanner_ClientID) != null) {
28            document.getElementById(EmptyBanner_ClientID).innerHTML = srcipt;
29            document["ad" + EmptyBanner_ClientID] = true;
30        }
31
32    }
33    else {
34        $(document).ready(function () {
35            setTimeout(function () {
36                DocReady = true;
37
38                if (document["ad" + EmptyBanner_ClientID] == null && document.getElementById(EmptyBanner_ClientID) != null) {
39                    document.getElementById(EmptyBanner_ClientID).innerHTML = srcipt;
40                    document["ad" + EmptyBanner_ClientID] = true;
41                }
42            }, 200);
43        });
44    }
45
46
47    var banner = $("#" + EmptyBanner_ClientID);
48
49    var width = banner.width();
50    var height = 0;//banner.height();
51
52    if (height == 0)
53        height = "inherit";
54
55    if (width == 0)
56        width = "inherit";
57
58    // var overrideStyle = "cursor: pointer;display: block !important;visibility: visible !important;opacity: 1 !important; width:" + width + "px;height:" + height + "px;";
59
60    //banner.attr("style", overrideStyle);
61    banner.css("cursor", "pointer");
62    banner.css("display", "block !important");
63    banner.css("visibility", "visible !important");
64    banner.css("opacity", "1 !important");
65    banner.css("width", width);
66    banner.css("height", height);
67
68    banner.find("div").each(function () {
69        $(this).css("cursor", "pointer");
70        $(this).css("display", "block !important");
71        $(this).css("visibility", "visible !important");
72        $(this).css("opacity", "1 !important");
73        //$(this).css("width", width);
74        //$(this).css("height", height);
75        //if ($(this).attr("src") != null) {
76        //    $(this).attr("src", "http://www.google.co.il/images/srpr/logo11w.png");
77        //}
78    })
79
80}
81function setClickCounter(EmptyBanner_ClientID, banner_id, areaId) {
82
83    $("body").on("click", "#" + EmptyBanner_ClientID, function () {
84        $.ajax("/Website/BannerClick?id=" + banner_id + "&AreaId=" + areaId);
85    });
86
87}
88
89//var mouseOverBannerId = null;
90//var mouseOverAreaID = null;
91
92//function setExternalBannerClickRecording(EmptyBanner_ClientID, banner_id, areaId) {
93//    var isOverGoogleAd = false;
94//    $("#" + EmptyBanner_ClientID)
95//        .mouseover(function () {
96//            console.log("external banner mouseover: " + mouseOverBannerId);
97//            mouseOverBannerId = banner_id;
98//            mouseOverAreaID = areaId;
99//            // isOverGoogleAd = true;
100//        }).click( function () {
101//            console.log("external banner mouseover: " + mouseOverBannerId);
102//            mouseOverBannerId = banner_id;
103//            mouseOverAreaID = areaId;
104//            // isOverGoogleAd = true;
105//        }).mouseout(function () {
106//            console.log("external banner mouseout: " + mouseOverBannerId);
107//            mouseOverBannerId = null;
108//            mouseOverAreaID = null;
109//        });
110//}
111
112//$(window).blur(
113//    function () {
114//        if (mouseOverBannerId != null && mouseOverAreaID != null) {
115//            console.log("external banner clicked: " + mouseOverBannerId);
116//            $.ajax("/Website/BannerClick?id=" + mouseOverBannerId + "&AreaId=" + mouseOverAreaID);
117//        }
118//    }
119//).focus();
120
121
122function setImageBanner(EmptyBanner_ClientID, img_src, banner_id, title, width, height, reload, area_id, type, description) {
123
124    var clickScript = "onclick=\"window.open('/Website/BannerClick?id=" + banner_id + "&AreaId=" + area_id + "');\"";
125
126    if (type == null || type == "Image") {
127        setImage(EmptyBanner_ClientID, "<img src=\"" + img_src + "\" alt=\"\" style=\"curs
127or:pointer;\" " + clickScript + " \>", reload);
128    }
129    else if (type == "ImageWithText") {
130        if (height === 250)
131            setImage(EmptyBanner_ClientID, "<img src=\"" + img_src + "\" alt=\"\" style=\"cursor:pointer;height:200px;width:300px;color:black;object-fit: cover;\" " + clickScript + " \>" +
132                "<div style='font-size:20px;font-weight:bold;text-align:right;color:black;line-height:26px' " + clickScript + ">" + title + "</div>", reload);
133        else if (height === 100)
134            setImage(EmptyBanner_ClientID, "<img src=\"" + img_src + "\" alt=\"\" style=\"cursor:pointer;color:black;height:100px;width:150px;color:black;float:right;margin-left: 10px;object-fit: cover;\" " + clickScript + " \>" +
135                "<div style='font-size:20px;font-weight:bold;text-align:right;color:black;line-height:26px' " + clickScript + ">" + title + "</div>", reload);
136    }
137    else if (type == "Text") {
138        setImage(EmptyBanner_ClientID,
139            "<div style='border:1px solid #dddddd;padding:10px;text-align:right;color:black;height:" + height+"px;" + clickScript + ">" +
140            "<div style='font-size:22px;font-weight:bold;line-height:26px;margin-bottom:20px;margin-top:20px;' >" + title + "</div>" +
141            "<div style='font-size:16px;line-height:18px;margin-bottom:20px;'>" + description + "</div>" +         
142            "<button style='font-size:22px;background-color:#bb1d2c;width:100%;heigth:30px;border:1px solid black;border-radius:5px;padding:5px;color:white;' " + clickScript + ">פתח</button>" +
143       
144            "</div>"
145            , reload);
146    }
147
148    //if (title !== null && title !== "") {
149    //    if (height === 250)
150    //        setImage(EmptyBanner_ClientID, "<img src=\"" + img_src + "\" alt=\"\" style=\"cursor:pointer;height:200px;width:300px;object-fit: cover;\" " + clickScript + " \>" +
151    //            "<div style='font-size:20px;font-weight:bold;text-align:right;line-height:26px' " + clickScript + ">" + title + "</div><div style='font-size:10px;color:red;text-align:right;'>תוכן פרסומי</div>", reload);
152    //    else if (height === 100)
153    //        setImage(EmptyBanner_ClientID, "<img src=\"" + img_src + "\" alt=\"\" style=\"cursor:pointer;height:100px;width:150px;float:right;margin-left: 10px;object-fit: cover;\" " + clickScript + " \>" +
154    //            "<div style='font-size:20px;font-weight:bold;text-align:right;color:black;line-height:26px' " + clickScript + ">" + title + "</div><div style='font-size:10px;color:red;text-align:right;'>תוכן פרסומי</div>", reload);
155    //}
156    //else
157    //    setImage(EmptyBanner_ClientID, "<img src=\"" + img_src + "\" alt=\"\" style=\"cursor:pointer;\" " + clickScript + " \>", reload);
158}
159
160
161function setVideoBanner(EmptyBanner_ClientID, flash_src, width, height, link, reload) {
162    
163    var code = `<a href='${link}' target='_blank'><video playsinline="playsinline" tabindex="-1" role="application" preload="auto" loop="" muted="muted" autoplay="" 
164                style="cursor:pointer;object-fit: cover;width:100%;height:300px;"
165                src="${flash_src}"></video></a>`;
166
167    //if (image != undefined)
168    //    code = code + '<div style="background-image:url(' + image + ')"> ';
169
170    //code = code + '<object height="' + height + '" width="' + width + '"  type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' +
171    //    ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"> ' +
172    //    '<param name="movie" value="' + flash_src + '" />' +
173    //    '<param name="quality" value="high" /> ' +
174    //    '<param name="menu" value="false" />' +
175    //    '<param name="wmode" value="Transparent"/>' +
176    //    '<embed name="adFlash" wmode="Transparent" height="' + height + '" width="' + width + '" src="' + flash_src + '"' +
177    //    ' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed> ';
178
179    //if (image != undefined)
180    //    code = code + '</div> ';
181
182    //code = code + '</object> ';
183
184    setImage(EmptyBanner_ClientID, code, reload);
185}
186
187function ScheduleRotate(Commands) {
188    var Scheduler = new Object();
189    Scheduler.commands = Commands;
190    Scheduler.current = 0;
191    stepScheduleRotate(Scheduler);
192}
193
194function stepScheduleRotate(Scheduler) {
195
196    var comm = Scheduler.commands[Scheduler.current];
197
198    if (comm.length == 0)
199        return;
200
201    comm[0]();
202    Scheduler.current++;
203
204    if (Scheduler.current >= Scheduler.commands.length)
205        Scheduler.current = 0;
206
207    setTimeout(function () { stepScheduleRotate(Scheduler) }, comm[1] * 1000);
208}
209
210function setBannerScript(id, code) {
211    $(document).ready(function () {
212        $(document).html(unescape(code));
213    });
214}
215
216
217function LoadLazyScripts() {
218    $("lazy-script").each(function () {
219        if ($(this).attr("done") != null)
220            return;
221
222        $(this).attr("done", "true");
223        var script;
224        if ($(this).attr("src") != null) {
225            script = document.createElement('script');
226            $(script).attr("src", $(this).attr("src"));
227            this.appendChild(script);
228        }
229        else {
230            var code = $(this).html();
231            $(this).html('');
232
233            script = document.createElement('script');
234            try {
235                script.appendChild(document.createTextNode(code));
236            } catch (e) {
237                script.text = code;
238            }
239
240            this.appendChild(script);
241
242        }
243    });
244}
245
246
247function renameTag($obj, new_tag) {
248    var obj = $obj.get(0);
249    var tag = obj.tagName.toLowerCase();
250    var tag_start = new RegExp('^<' + tag);
251    var tag_end = new RegExp('<\\/' + tag + '>$');
252    var new_html = obj.outerHTML.replace(tag_start, "<" + new_tag).replace(tag_end, '</' + new_tag + '>');
253    $obj.replaceWith(new_html);
254}
255

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.