PageSourceSearch

https://reach.abnnewswire.net/jscript/theme-scripts.js

js abnnewswire.net collected 2026-10-02 10:03:17 UTC 9,656 bytes, 291 lines download raw bytes

1
2
3var supports = (function() {
4  var div = document.createElement('div'),
5    vendors = 'Khtml Ms O Moz Webkit'.split(' '),
6    len = vendors.length;
7
8  return function(prop) {
9    if ( prop in div.style ) return true;
10
11    prop = prop.replace(/^[a-z]/, function(val) {
12       return val.toUpperCase();
13    });
14
15    while(len--) {
16       if ( vendors[len] + prop in div.style ) {
17          return true;
18       } 
19    }
20    return false;
21  };
22})();
23
24if ( supports('perspective') ) {
25   jQuery(".the-menu").addClass("transition-active");
26}
27
28
29jQuery(window).scroll(function() {
30  jQuery(".main-menu.sticky").each(function() {
31    var thisel = jQuery(this);
32    var offset = thisel.offset();
33    var offsetz = thisel.children(".wrapper").offset();
34    var addpoint = 0;
35    if(jQuery("body").hasClass("admin-bar")){
36      addpoint = 28;
37    }
38    if(jQuery(window).scrollTop()+addpoint >= offset.top){
39      thisel.css("height", thisel.height()+"px");
40      thisel.children(".wrapper").css("left", offsetz.left+"px").css("position", "fixed").css("top", addpoint+"px");
41    }else{
42      thisel.css("height", "auto");
43      thisel.children(".wrapper").css("position", "inherit").css("top", "0px").css("left", "auto");
44    }
45  });
46});
47
48
49function playhover() {
50
51  jQuery(".hover-effect").each(function() {
52    var thisel = jQuery(this);
53
54    if(thisel.has("img").length > 0 && !thisel.hasClass("delegate")){
55      var fontsize = (parseInt(thisel.children("img").height()) <= 120)?20:(parseInt(thisel.children("img").height())/6);
56      thisel.children("img").wrap("<span class='cover' style='font-size:"+ fontsize +"px;'></span>").parent().prepend("<i></i>");
57      thisel.addClass("delegate");
58    }
59
60  });
61
62}
63
64var anihappening = false;
65
66jQuery(document).ready(function() {
67
68  playhover();
69
70  jQuery(".gallery-widget ul").each(function() {
71    var thisel = jQuery(this);
72    var licount = thisel.children("li").length;
73    thisel.attr("rel", licount);
74  });
75
76  jQuery(".gallery-photo > a.slide-right").click(function() {
77    if(anihappening)return false;
78    var thisel = jQuery(this).parent().children("ul");
79    var phwidth = parseInt(jQuery(this).parent().width());
80    if(((thisel.attr("rel")-1)*phwidth) > Math.abs(parseInt(thisel.css("margin-left")))){
81      anihappening = true;
82      thisel.animate({'margin-left' : '-='+phwidth}, 400, function () {
83        anihappening = false;
84      });
85    }
86    return false;
87  });
88
89  jQuery(".gallery-photo > a.slide-left").click(function() {
90    if(anihappening)return false;
91    var thisel = jQuery(this).parent().children("ul");
92    var phwidth = parseInt(jQuery(this).parent().width());
93    if(Math.abs(parseInt(thisel.css("margin-left"))) > 0){
94      anihappening = true;
95      thisel.animate({'margin-left' : '+='+phwidth}, 400, function () {
96        anihappening = false;
97      });
98    }
99    return false;
100  });
101  
102
103  // Tabbed blocks
104  jQuery(".tabs").each(function() {
105    var thisel = jQuery(this);
106    thisel.children("div").css("min-height", (parseInt(thisel.css("height"))-30)+"px");
107    thisel.children("div").eq(0).addClass("active");
108    thisel.children("ul").children("li").eq(0).addClass("active");
109  });
110
111  jQuery(".tabs > ul > li a").click(function() {
112    var thisel = jQuery(this).parent();
113    thisel.siblings(".active").removeClass("active");
114    thisel.addClass("active");
115    thisel.parent().siblings("div.active").removeClass("active");
116    thisel.parent().siblings("div").eq(thisel.index()).addClass("active");
117    return false;
118  });
119
120
121  // Alert box close
122  jQuery('a[href="#close-alert"]').click(function() {
123    jQuery(this).parent().animate({
124      opacity: 0,
125      padding: "0px 13px",
126      margin: "0px",
127      height: "0px"
128    }, 300, function() {
129      // Animation complete.
130    });
131    return false;
132  });
133
134
135  // Accordion blocks
136  jQuery(".accordion > div > a").click(function() {
137    var thisel = jQuery(this).parent();
138    if(thisel.hasClass("active")){
139      thisel.removeClass("active");
140      return false;
141    }
142    thisel.siblings("div").removeClass("active");
143    thisel.addClass("active");
144    return false;
145  });
146
147  jQuery(".header > .wrapper").prepend('<a href="#" class="mobile-menu icon-text">&#9776;</a>');
148  jQuery("body").prepend('<div class="themenumobile"><strong>Main Menu</strong><ul></ul></div><a href="#" class="escape-mobile-menu"></a>');
149  jQuery(".themenumobile > ul").append(function () {
150     var theend = jQuery(".main-menu .the-menu").html();
151     return theend;
152  });
153
154  jQuery("a.mobile-menu").click(function () {
155    jQuery("body").addClass("menu-active");
156    return false;
157  });
158
159  jQuery("a.escape-mobile-menu").click(function () {
160    jQuery("body").removeClass("menu-active");
161    return false;
162  });
163
164  jQuery(".lightbox").click(function () {
165    jQuery(".lightbox").css('overflow', 'hidden');
166    jQuery("body").css('overflow', 'auto');
167    jQuery(".lightbox .lightcontent").fadeOut('fast');
168    jQuery(".lightbox").fadeOut('slow');
169  }).children().click(function(e) {
170    return false;
171  });
172
173});
174
175
176function lightboxclose(){
177  jQuery(".lightbox").css('overflow', 'hidden');
178  jQuery(".lightbox .lightcontent").fadeOut('fast');
179  jQuery(".lightbox").fadeOut('slow');
180  jQuery("body").css('overflow', 'auto');
181}
182
183
184 (function($)
185   {
186     var methods = 
187       {
188         init : function( options ) 
189         {
190           return this.each(function()
191             {
192               var _this=$(this);
193                   _this.data('marquee',options);
194               var _li=$('>li',_this);
195                   
196                   _this.wrap('<div class="slide_container"></div>')
197                        .height(_this.height())
198                       .hover(function(){if($(this).data('marquee').stop){$(this).stop(true,fal
198se);}},
199                              function(){if($(this).data('marquee').stop){$(this).marquee('slide');}})
200                        .parent()
201                        .css({position:'relative',overflow:'hidden','height':$('>li',_this).height()})
202                        .find('>ul')
203                        .css({width:screen.width*2,position:'absolute'});
204           
205                   for(var i=0;i<Math.ceil((screen.width*3)/_this.width());++i)
206                   {
207                     _this.append(_li.clone());
208                   } 
209             
210               _this.marquee('slide');});
211         },
212      
213         slide:function()
214         {
215           var $this=this;
216           $this.animate({'left':$('>li',$this).width()*-1},
217                         $this.data('marquee').duration,
218                         'swing',
219                         function()
220                         {
221                           $this.css('left',0).append($('>li:first',$this));
222                           $this.delay($this.data('marquee').delay).marquee('slide');
223             
224                         }
225                        );
226                             
227         }
228       };
229   
230     $.fn.marquee = function(m) 
231     {
232       var settings={
233                     'delay':4000,
234                     'duration':2000,
235                     'stop':false
236                    };
237       
238       if(typeof m === 'object' || ! m)
239       {
240         if(m){ 
241         $.extend( settings, m );
242       }
243 
244         return methods.init.apply( this, [settings] );
245       }
246       else
247       {
248         return methods[m].apply( this);
249       }
250     };
251   }
252 )( jQuery );
253 
254
255 jQuery(document).ready(
256   function(){jQuery('.breaking-news ul').marquee({delay:3000});}
257 );
258
259
260
261
262function printArticle() {
263  var html = jQuery(".block-content .shortcode-content").html();
264  var htmltitle = jQuery(".article-title h1").html();
265  if(jQuery(".main-article-content .article-photo img").size() > 0){var htmlphoto = "<img src='"+jQuery(".main-article-content .article-photo img").attr("src")+"' alt='' style='max-width: 600px;'/>";}else{var htmlphoto = "";}
266  if(jQuery(".logo-footer img").size() > 0){var htmllogo = '<div class="logo-image">'+jQuery(".logo-footer").html()+'</div>';var logotext = false;}else{var htmllogo = '<div class="logo-text">'+jQuery(".header-logo h1").html()+'</div>';var logotext = true;}
267  var htmlcopy = jQuery(".footer .wrapper > p").html();
268  var htmlauthor = jQuery(".article-title .author .a-content b").html();
269  var htmldate = jQuery(".article-title .author .a-content > span.meta").html();
270  
271  top.consoleRef=window.open('','articleprint',
272    'width=680,height=800'
273    +',menubar=0'
274    +',toolbar=1'
275    +',status=0'
276    +',scrollbars=1'
277    +',resizable=1');
278  top.consoleRef.document.writeln(
279    '<html><head><title>'+jQuery(document).attr('title')+'</title><link type="text/css" rel="stylesheet" href="css/reset.css" /><link type="text/css" rel="stylesheet" href="css/main-stylesheet.css?'+Date()+'" /><link type="text/css" rel="stylesheet" href="css/print.css?'+Date()+'" /><link type="text/css" rel="stylesheet" href="css/shortcode.css?'+Date()+'" /></head>'
280    +'<body onLoad="self.focus()"><div class="wrapper">'
281    +htmllogo
282    +'<h2>'+htmltitle+'</h2>'
283    +'<div class="smallinfo"><strong>'+htmlauthor+'</strong><span>'+htmldate+'</span><a href="'+jQuery(location).attr('href')+'">'+jQuery(location).attr('href')+'</a></div>'
284    +'<div class="article-main-content shortcode-content">'+htmlphoto+''+html+'</div>'
285    +htmlcopy
286    +'</div></body></html>'
287    );
288  top.consoleRef.document.close();
289}
290
291

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.