PageSourceSearch

https://hassco.ca/js/common.js

js hassco.ca collected 2026-10-04 02:32:17 UTC 9,094 bytes, 346 lines download raw bytes

1//Carousel
2(function($){
3    $.fn.liteSlider= function(options) {
4
5        var defaults = {
6            content : '.content',
7            width : 500,
8            height : 250,
9            autoplay : false,
10			delay : 7,
11            buttonsClass : '',
12            activeClass : '',
13			controlBt : '',
14			playText : ' Play',
15			pauseText : 'Pause'
16        };
17        
18        var options = $.extend(defaults, options);
19
20        var slideNo = 1;
21        var timer = 0;
22        var playStatus = options.autoplay;
23        var thisClass = ($(this).attr('class'));
24        var theClass = '.' + thisClass;
25        var count = 0;
26        var slides;
27		var currentSlide = 1;
28		var delay = parseInt(options.delay)*1000;
29		
30        $(this).children(options.content).each(function(){
31            slides = ++count;
32        });
33		
34		function wrapContent(ele){
35			ele.wrap('<div class="sliderContentsWrap" />');
36		}
37		
38		function applyCss(ele){
39			$('.sliderContentsWrap').css({
40                padding : 0,
41                /*margin : 0,*/
42                width : options.width,
43                height : options.height,
44                overflow : 'hidden',
45                position : 'relative'
46            });
47            
48            ele.css({
49                padding : 0,
50                margin : 0,
51                width : options.width * slides,
52                height : options.height,
53                position : 'relative'
54            });
55            
56            ele.children(options.content).css({
57                float : 'left',
58                width : options.width,
59                height : options.height
60            });
61		}
62		
63        function resetButtons(){
64            i = 0;
65            $('.' + options.buttonsClass).each(function(){
66                i++;
67                $(this).addClass('bt' + i);
68                $(this).attr('rel', i);
69            });
70        }
71		        
72        function goToSlide(theSlide){
73		
74            var animateLeft = -(options.width) * (parseInt(theSlide)-1); 
75            $('.sliderContentsWrap' + ' ' + theClass)
76                .animate({
77                    left: animateLeft
78                });
79            
80            $('.' + options.buttonsClass).each(function(){
81                $(this).removeClass(options.activeClass);
82                    if($(this).hasClass('bt' + theSlide)){
83                        $(this).addClass(options.activeClass)}
84            });
85			
86			currentSlide = theSlide;
87        }
88		
89		function autoplay(){
90			if(currentSlide < slides){
91				goToSlide(parseInt(currentSlide) + 1);
92			}else{
93				goToSlide(1);
94			}
95		}
96		
97		function playSlide(){
98			clearInterval(timer);
99			timer = setInterval(function(){
100				autoplay();
101			}, delay);
102			
103			$(options.controlBt).text(options.pauseText);
104			playStatus = true;
105		}
106		
107		function pauseSlide(){
108			clearInterval(timer);
109			$(options.controlBt).text(options.playText);
110			playStatus = false;
111		}
112
113		function init(ele){
114			wrapContent(ele);
115			applyCss(ele);
116			resetButtons();
117			
118			if(options.autoplay == true){
119				playSlide()
120			}else{
121				pauseSlide();
122			}
123		}
124		
125        return this.each(function(){
126			init($(this));
127			
128			$('.'+options.buttonsClass).click(function(e){
129				e.preventDefault();
130				playSlide();
131                goToSlide($(this).attr('rel'));
132            });
133			
134			$(options.controlBt).click(function(e){
135				e.preventDefault();
136				if(playStatus == true){
137					pauseSlide()
138				}else{
139					playSlide()
140				} ;
141            });
142			
143        });
144        
145    };
146})(jQuery);
147
148$('.fadein img:gt(0)').hide();
149setInterval(function(){$('.fadein :first-child').fadeOut(2000).next('img').fadeIn(2000).end().appendTo('.fadein');}, 8000);
150
151$(function(){
152	$('.sliderWrap').liteSlider({
153		content : '.sliderContent',
154		width : 947,
155		height : 390,
156		autoplay : true,
157		buttonsClass : 'buttons',
158		activeClass : 'active',
159		controlBt : 'input'
160	});
161});
162
163
164//Tipsy
165(function($) {
166    $.fn.tipsy = function(opts) {
167
168        opts = $.extend({fade: false, gravity: 'n'}, opts || {});
169        var tip = null, cancelHide = false;
170
171        this.hover(function() {
172            
173            $.data(this, 'cancel.tipsy', true);
174
175            var tip = $.data(this, 'active.tipsy');
176            if (!tip) {
177                tip = $('<div class="tipsy"><div class="tipsy-inner">' + $(this).attr('title') + '</div></div>');
178                tip.css({position: 'absolute', zIndex: 100000});
179                $(this).attr('title', '');
180                $.data(this, 'active.tipsy', tip);
181            }
182            
183            var pos = $.extend({}, $(this).offset(), {width: this.offsetWidth, height: this.offsetHeight});
184            tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body);
185            var actualWidth = tip[0].offsetWidth, actualHeight = tip[0].offsetHeight;
186            
187            switch (opts.gravity.charAt(0)) {
188                case 'n':
189                    tip.css({top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-north');
190                    break;
191                case 's':
192                    tip.css({top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-south');
193                    break;
194            }
195
196            if (opts.fade) {
197                tip.css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: 1});
198            } else {
199                tip.css({visibility: 'visible'});
200            }
201
202        }, function() {
203            $.data(this, 'cancel.tipsy', false);
204            var self = this;
205            setTimeout(function() {
206                if ($.data(this, 'cancel.tipsy')) return;
207                var tip = $.data(self, 'active.tipsy');
208                if (opts.fade) {
209                    tip.stop().fadeOut(function() { $(this).remove(); });
210                } else {
211                    tip.remove();
212                }
213            }, 100);
214            
215        });
216
217    };
218})(jQuery);
219
220$(function() { 
221    $("#botFrame a").tipsy({gravity: 's'});
222     
223  });
224
225
226//Fonts
227Cufon.replace('h1, .title', {
228		color: '-linear-gradient(#5da6f9, #2e6db8)',
229		textShadow: '0px 1px #999',
230		fontWeight: '700'
231	});
232	
233Cufon.replace('h2', {
234		color: '#3372bd',
235		textShadow: '0px 1px #FFF',
236		fontWeight: '400'
237	});
238
239Cufon.replace('.showcase h1', {
240		color: '-linear-gradient(#5da6f9, #2e6db8)',
241		textShadow: '0px 1px #333',
242		fontWeight: '700'
243	});
244
245Cufon.replace('.showcase h2', {
246		color: '-linear-gradient(#5da6f9, #2e6db8)',
247		textShadow: '0px 1px #333',
248		fontWeight: '400'
249	});
250Cufon.replace('#title h1', {
251		color: '-linear-gradient(#fdfdfd, #afafaf)',
252		textShadow: '0px 1px #333',
253		fontWeight: '700'
254	});	
255	
256
257	
258//Lightbox
259$(document).ready(function() {
260	$('body').append('<div id="lbBackground" class="hide"></div><div id="lightbox" class="hide"><iframe src="/welcome/blank" id="galleryFrame" name="galleryFrame" scrolling="auto" frameborder="0" class="hide"></iframe><img src="#" alt="" class="hide" id="lbImage" /><a id="close" href="/close"><img src="/images/icons/close.png" alt="close" width="29" height="29" /></a></div>');
261});
262
263$('a.lightbox').click(function(){
264		imgTypes = ['png', 'jpg', 'jpeg', 'gif'];
265		$src = $(this).attr("href");
266		//pageTracker._trackPageview($src);
267		$('#lbBackground').fadeIn();
268		$top = $(this).offset().top;
269		$left = $(this).offset().left;
270		
271		if($(this).attr('rel').length > 0) {
272			$d = $(this).attr('rel').split(",");
273			$width = $d[0]; 
274			$height = $d[1];
275		
276		}else {
277			$height=550;
278			$width=850;
279		}
280		imgRegExp = imgTypes.join('|');
281    	imgRegExp = new RegExp('\.' + imgRegExp + '$', 'i');
282		
283		$fTop = $(document).scrollTop() + (($(window).height() - $height - 60) / 2);
284		if ($src.match(imgRegExp)) {
285			$('#lbImage')
286			.attr('src', $src)
287			.load(function(){
288				var lbImage = new Image();
289				lbImage.src = $src;
290				$height = lbImage.height;
291				$width = lbImage.width;
292				
293				if($(window).width() > $width) {
294					$fLeft = ($(window).width() - $width - 60) / 2;
295				}else{
296					$fLeft = 10;	
297				}
298				$('#lbImage, #lightbox, #close').show(); 
299				$('#lightbox').css({ 
300					top:$top, 
301					left:$left 
302				}).animate({
303					top:$fTop,
304					left:$fLeft,
305					width:$width,
306					height:$height
307				});
308				
309			});
310			
311		}else{	
312			if($(window).width() > $width) {
313				$fLeft = ($(window).width() - $width - 60) / 2;
314			}else{
315				$fLeft = 10;	
316			}
317			$('#galleryFrame').attr({src:$src+'?lb'});
318			$('#galleryFrame, #lightbox, #close').show();
319			$('#galleryFrame').attr({style:'display:inline; width: '+$width+'px; height: ' +$height+'px'});
320			$('#lightbox').css({ 
321				top:$top, 
322				left:$left 
323			}).animate({
324				top:$fTop,
325				left:$fLeft,
326				width:$width,
327				height:$height
328			});
329
330		}
331		lb = true;
332		return false;
333	});
334
335$('#lbBackground, #close').live('click', function(){
336	$('#lightbox').animate({
337		top:$top,
338		left:$left,
339		width:10,
340		height:10
341	}, function(){ $('#lightbox, #close, #galleryFrame, #lbImage').hide(); })
342	$('#lbBackground').fadeOut();
343	$('#galleryFrame').attr({src:'/blank.htm'});
344	lb = false;
345	return false;
346});

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.