PageSourceSearch

http://greekmilitary.net/pagead2.googlesyndication.com/pagead/show_ads.js

js greekmilitary.net collected 2026-10-02 12:58:41 UTC 11,975 bytes, 397 lines download raw bytes

1(function(){
2// NOTE: This file is intended to be compiled with JSCompiler. If you are
3// getting a compiler error when using a JavaScript built-in, please update
4// google3/contentads/frontend/externs.js
5
6function quoted(str) {
7  return (str != null) ? '"' + str + '"' : '""';
8}
9
10function google_encodeURIComponent(str) {
11  if (typeof(encodeURIComponent) == 'function') {
12    return encodeURIComponent(str);
13  } else {
14    return escape(str);
15  }
16}
17
18function google_write_tracker(d, ad_url, tracker_event) {
19  var qloc = ad_url.indexOf('?');
20  var img_src = 'http://pagead2.googlesyndication.com/pagead/imp.gif?event=';
21  img_src += tracker_event;
22  if (qloc != -1 && qloc + 1 < ad_url.length) {
23    img_src += '&' + ad_url.substring(qloc + 1);
24  }
25  var img_tag = '<img height="1" width="1" border="0" ' +
26                'src=' + quoted(img_src) +
27                ' />';
28  d.write(img_tag);
29}
30
31function google_append_url(param, value) {
32  if (value) {
33    window.google_ad_url += '&' + param + '=' + value;
34  }
35}
36
37function google_append_url_esc(param, value) {
38  if (value) {
39    google_append_url(param, google_encodeURIComponent(value));
40  }
41}
42
43function google_append_color(param, value, random) {
44  if (value && typeof(value) == 'object') {
45    value = value[random % value.length];
46  }
47  google_append_url('color_' + param, value);
48}
49
50function google_get_user_data(w, date) {
51  var screen = w.screen;
52  var javaEnabled = navigator.javaEnabled();
53  var tz = -date.getTimezoneOffset();
54
55  if (screen) {
56    google_append_url("u_h", screen.height);
57    google_append_url("u_w", screen.width);
58    google_append_url("u_ah", screen.availHeight);
59    google_append_url("u_aw", screen.availWidth);
60    google_append_url("u_cd", screen.colorDepth);
61  }
62
63  google_append_url("u_tz", tz);
64  google_append_url("u_his", history.length);
65  google_append_url("u_java", javaEnabled);
66
67  if (navigator.plugins) {
68    google_append_url("u_nplug", navigator.plugins.length);
69  }
70  if (navigator.mimeTypes) {
71    google_append_url("u_nmime", navigator.mimeTypes.length);
72  }
73}
74
75function google_modify_client(client) {
76  client = client.toLowerCase();
77  if (client.substring(0, 3) != 'ca-') {
78     client = 'ca-' + client;
79  }
80  return client;
81}
82
83function google_write_iframe(w, d, ad_url) {
84  ad_url = ad_url.substring(0, 1000);
85  ad_url = ad_url.replace(/%\w?$/, '');
86
87  if (w.google_ad_output == 'js' &&
88      (w.google_ad_request_done || w.google_radlink_request_done)) {
89    d.write('<script language="JavaScript1.1"' +
90            ' src=' + quoted(ad_url) + '></' + 'script>');
91  } else if (w.google_ad_output == 'html') {
92    if (w.name == 'google_ads_frame') {
93      google_write_tracker(d, ad_url, 'reboundredirect');
94    } else {
95      d.write('<iframe' +
96              ' name="google_ads_frame"' +
97              ' width=' + quoted(w.google_ad_width) +
98              ' height=' + quoted(w.google_ad_height) +
99              ' frameborder=' + quoted(w.google_ad_frameborder) +
100              ' src=' + quoted(ad_url) +
101              ' marginwidth="0"' +
102              ' marginheight="0"' +
103              ' vspace="0"' +
104              ' hspace="0"' +
105              ' allowtransparency="true"' +
106              ' scrolling="no">');
107      google_write_tracker(d, ad_url, 'noiframe');
108      d.write('</iframe>');
109    }
110  }
111}
112
113function google_show_ad() {
114  var nullvalue = null;
115  var w = window;
116  var d = document;
117  var date = new Date();
118  var random = date.getTime();
119  var num_slots_by_client = w.google_num_slots_by_client;
120  var num_slots_by_channel = w.google_num_slots_by_channel;
121  var prev_ad_formats = w.google_prev_ad_formats_by_region;
122  var format = w.google_ad_format;
123
124  w.onerror = w.google_org_error_handler;
125
126  if (w.google_ad_region == nullvalue && w.google_ad_section != nullvalue) {
127    w.google_ad_region = w.google_ad_section;
128  }
129
130  var region = (w.google_ad_region == nullvalue) ? '' : w.google_ad_region;
131
132  var is_zero_ad_format = false;
133  if (format) {
134    is_zero_ad_format = ((format).indexOf('_0ads')) > 0;
135  }
136
137  if (is_zero_ad_format) {
138    if (w.google_num_0ad_slots) {
139      w.google_num_0ad_slots = w.google_num_0ad_slots + 1;
140    } else {
141      w.google_num_0ad_slots = 1;
142    }
143
144    if (w.google_num_0ad_slots > 1) {
145      return;
146    }
147  } else {
148    if (w.google_num_ad_slots) {
149      w.google_num_ad_slots = w.google_num_ad_slots + 1;
150    } else {
151      w.google_num_ad_slots = 1;
152    }
153
154    if (w.google_num_slots_to_rotate) {
155      prev_ad_formats[region] = nullvalue;
156      if (w.google_num_slot_to_show == nullvalue) {
157        w.google_num_slot_to_show = random % w.google_num_slots_to_rotate + 1;
158      }
159      if (w.google_num_slot_to_show != w.google_num_ad_slots) {
160        return;
161      }
162    } else if (w.google_num_ad_slots > 3 && region == '') {
163      return;
164    }
165  }
166
167  w.google_ad_url = 'http://pagead2.googlesyndication.com/pagead/
167ads?';
168  w.google_ad_url += 'client=' + 
169                     escape(google_modify_client(w.google_ad_client));
170  google_append_url('dt', date.getTime());
171  google_append_url('hl', w.google_language);
172  if (w.google_country) {
173    google_append_url('gl', w.google_country);
174  } else {
175    google_append_url('gl', w.google_gl);
176  }
177  google_append_url('gr', w.google_region);
178  google_append_url_esc('gcs', w.google_city);
179  google_append_url_esc('hints', w.google_hints);
180  google_append_url('adsafe', w.google_safe);
181  google_append_url('oe', w.google_encoding);
182  google_append_url('lmt', w.google_last_modified_time);
183  google_append_url_esc('alternate_ad_url', 
184                                 w.google_alternate_ad_url);
185  google_append_url('alt_color', w.google_alternate_color);
186  google_append_url("skip", w.google_skip);
187
188  var client = w.google_ad_client;
189  if (!num_slots_by_client[client]) {
190    num_slots_by_client[client] = 1;
191    num_slots_by_client.length += 1;
192  } else {
193    num_slots_by_client[client] += 1;
194  }
195
196  if (prev_ad_formats[region]) {
197    google_append_url_esc('prev_fmts',
198                          prev_ad_formats[region].toLowerCase());
199    if (num_slots_by_client.length > 1) {
200      google_append_url('slot', num_slots_by_client[client]);
201    }
202  }
203
204  if (format) {
205    google_append_url_esc('format', format.toLowerCase());
206    if (prev_ad_formats[region]) {
207      prev_ad_formats[region] = prev_ad_formats[region] + ',' + format;
208    } else {
209      prev_ad_formats[region] = format;
210    }
211  }
212
213  google_append_url('num_ads', w.google_max_num_ads);
214  google_append_url('output', w.google_ad_output);
215  google_append_url('adtest', w.google_adtest);
216
217  if (w.google_ad_channel) {
218    var chnl = w.google_ad_channel.toLowerCase();
219    google_append_url_esc('channel', chnl);
220    var pv_ch = '';
221    var arr = chnl.split('+');
222    for (var i = 0; i < arr.length; i++) {
223      var ch = arr[i];
224      if (!num_slots_by_channel[ch]) {
225        num_slots_by_channel[ch] = 1;
226      } else {
227        pv_ch += ch + '+';
228      }
229    }
230    google_append_url_esc('pv_ch', pv_ch);
231  }
232
233  google_append_url_esc('url', w.google_page_url);
234  google_append_color('bg', w.google_color_bg, random);
235  google_append_color('text', w.google_color_text, random);
236  google_append_color('link', w.google_color_link, random);
237  google_append_color('url', w.google_color_url, random);
238  google_append_color('border', w.google_color_border, random);
239  google_append_color('line', w.google_color_line, random);
240  google_append_url('kw_type', w.google_kw_type);
241  google_append_url_esc('kw', w.google_kw);
242  google_append_url_esc('contents', w.google_contents);
243  google_append_url('num_radlinks', w.google_num_radlinks);
244  google_append_url('max_radlink_len', 
245                    w.google_max_radlink_len);
246  google_append_url('rl_filtering', w.google_rl_filtering);
247  google_append_url('rl_mode', w.google_rl_mode);
248  google_append_url('rt', w.google_rt);
249  google_append_url('ad_type', w.google_ad_type);
250  google_append_url('image_size', w.google_image_size);
251  google_append_url('region', w.google_ad_region);
252  google_append_url('feedback_link', w.google_feedback);
253  google_append_url_esc('ref', w.google_referrer_url);
254  google_append_url_esc('loc', w.google_page_location);
255  google_append_url('bid', w.google_bid);
256
257  if (google_onpage(w, d) && d.body) {
258    var scr_h = d.body.scrollHeight;
259    var clt_h = d.body.clientHeight;
260    if (clt_h && scr_h) {
261      google_append_url_esc('cc', Math.round(clt_h * 100 / scr_h));
262    }
263  }
264
265  google_get_user_data(w, date);
266  google_write_iframe(w, d, w.google_ad_url);
267
268  w.google_ad_frameborder = nullvalue;
269  w.google_ad_format = nullvalue;
270  w.google_page_url = nullvalue;
271  w.google_language = nullvalue;
272  w.google_gl = nullvalue;
273  w.google_country = nullvalue;
274  w.google_region = nullvalue;
275  w.google_city = nullvalue;
276  w.google_hints = nullvalue;
277  w.google_safe = nullvalue;
278  w.google_encoding = nullvalue;
279  w.google_ad_output = nullvalue;
280  w.google_max_num_ads = nullvalue;
281  w.google_ad_channel = nullvalue;
282  w.google_contents = nullvalue;
283  w.google_alternate_ad_url = nullvalue;
284  w.google_alternate_color = nullvalue;
285  w.google_color_bg = nullvalue;
286  w.google_color_text = nullvalue;
287  w.google_color_link = nullvalue;
288  w.google_color_url = nullvalue;
289  w.google_color_border = nullvalue;
290  w.google_color_line = nullvalue;
291  w.google_adtest = nullvalue;
292  w.google_kw_type = nullvalue;
293  w.google_kw = nullvalue;
294  w.google_num_radlinks = nullvalue;
295  w.google_max_radlink_len = nullvalue;
296  w.google_rl_filtering = nullvalue;
297  w.google_rl_mode = nullvalue;
298  w.google_rt = nullvalue;
299  w.google_ad_type = nullvalue;
300  w.google_image_size = nullvalue;
301  w.google_feedback = nullvalue;
302  w.google_skip = nullvalue;
303  w.google_page_location = nullvalue;
304  w.google_referrer_url = nullvalue;
305  w.google_ad_region = nullvalue;
306  w.google_ad_section = nullvalue;
307  w.google_bid = nullvalue;
308}
309
310function google_error_handler(message, url, line) {
311  google_show_ad();
312  return true;
313}
314
315function google_onpage(w, d) {
316  return w.top.location == d.location;
317}
318
319function google_in_adframe(w, d) {
320  var documentElement = d.documentElement;
321
322  if (google_onpage(w, d)) return false;
323
324  if (w.google_ad_width && w.google_ad_height) {
325    var wd = 1;
326    var ht = 1;
327    if (w.innerHeight) {
328      wd = w.innerWidth;
329      ht = w.innerHeight;
330    } else if (documentElement && documentElement.clientHeight) {
331      wd = documentElement.clientWidth;
332      ht = documentElement.clientHeight;
333    } else if (d.body) {
334      wd = d.body.clientWidth;
335      ht = d.body.clientHeight;
336    }
337
338    if (ht > 2 * w.google_ad_height || wd > 2 * w.google_ad_width) {
339      return false;
340    }
341  }
342
343  return true;
344}
345
346function google_init_globals() {
347  var w = window;
348  var d = document;
349  var location = d.location;
350  var referrer = d.referrer;
351  var nullvalue = null;
352
353  w.google_org_error_handler = w.onerror;
354  w.onerror = google_error_handler;
355
356  if (w.google_ad_frameborder == nullvalue) {
357    w.google_ad_frameborder = 0;
358  }
359
360  if (w.google_ad_output == nullvalue) {
361    w.google_ad_output = 'html';
362  }
363
364  if (w.google_ad_format == nullvalue && w.google_ad_output == 'html') {
365    w.google_ad_format = w.google_ad_width + 'x' + w.google_ad_height;
366  }
367
368  if (w.google_page_url == nullvalue) {
369    w.google_page_url = referrer;
370    if (!google_in_adframe(w, d)) {
371      w.google_page_url = location;
372      w.google_last_modified_time = Date.parse(d.lastModified) / 1000;
373      w.google_referrer_url = referrer;
374    }
375  } else {
376    w.google_page_location = referrer;
377    if (!google_in_adframe(w, d)) {
378      w.google_page_location = location;
379    }
380  }
381
382  if (w.google_num_slots_by_channel == nullvalue) {
383    w.google_num_slots_by_channel = new Array();
384  }
385
386  if (w.google_num_slots_by_client == nullvalue) {
387    w.google_num_slots_by_client = new Array();
388  }
389
390  if (w.google_prev_ad_formats_by_region == nullvalue) {
391    w.google_prev_ad_formats_by_region = new Array();
392  }
393} 
394
395google_init_globals();
396google_show_ad();
397})()

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.