PageSourceSearch

https://www.sicgras.si/templates/ja_purity_ii/js/ja.script.js

js sicgras.si collected 2026-10-06 13:06:27 UTC 6,736 bytes, 256 lines download raw bytes

1/*
2#------------------------------------------------------------------------
3  JA Purity II for Joomla 1.5
4#------------------------------------------------------------------------
5#Copyright (C) 2004-2009 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
6#@license - GNU/GPL, http://www.gnu.org/copyleft/gpl.html
7#Author: J.O.O.M Solutions Co., Ltd
8#Websites: http://www.joomlart.com - http://www.joomlancers.com
9#------------------------------------------------------------------------
10*/
11
12
13//Call noconflict if detect jquery
14//Apply jquery.noConflict if jquery is enabled
15if(typeof(jQuery) != "undefined" && $===jQuery){
16	jQuery.noConflict();
17}
18
19function switchFontSize (ckname,val){
20	var bd = $E('body');
21	switch (val) {
22		case 'inc':
23			if (CurrentFontSize+1 < 7) {
24				bd.removeClass('fs'+CurrentFontSize);
25				CurrentFontSize++;
26				bd.addClass('fs'+CurrentFontSize);
27			}		
28		break;
29		case 'dec':
30			if (CurrentFontSize-1 > 0) {
31				bd.removeClass('fs'+CurrentFontSize);
32				CurrentFontSize--;
33				bd.addClass('fs'+CurrentFontSize);
34			}		
35		break;
36		default:
37			bd.removeClass('fs'+CurrentFontSize);
38			CurrentFontSize = val;
39			bd.addClass('fs'+CurrentFontSize);		
40	}
41	Cookie.set(ckname, CurrentFontSize,{duration:365});
42}
43
44function switchTool (ckname, val) {
45	createCookie(ckname, val, 365);
46	window.location.reload();
47}
48
49function createCookie(name,value,days) {
50  if (days) {
51    var date = new Date();
52    date.setTime(date.getTime()+(days*24*60*60*1000));
53    var expires = "; expires="+date.toGMTString();
54  }
55  else expires = "";
56  document.cookie = name+"="+value+expires+"; path=/";
57}
58
59String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };
60
61//addEvent - attach a function to an event
62function jaAddEvent(obj, evType, fn){ 
63 if (obj.addEventListener){ 
64   obj.addEventListener(evType, fn, false); 
65   return true; 
66 } else if (obj.attachEvent){ 
67   var r = obj.attachEvent("on"+evType, fn); 
68   return r; 
69 } else { 
70   return false; 
71 } 
72}
73
74function equalHeight(){
75	if($('ja-botsl')) 
76		//makeEqualHeight ($$('#ja-botsl .moduletable*'));
77		makeEqualHeight ($$(getElementsByClass('moduletable.*', $('ja-botsl'))));
78/*
79  //Equal for headline
80	$hlfirst = $('jazin-hlfirst');
81	$hlnext = $('jazin-hlnext');
82	if($hlfirst && $hlnext) {
83    h1 = $hlfirst.getCoordinates().height;
84    h2 = $hlnext.getCoordinates().height;
85    
86    if(h1<h2) {
87      $hlfirst.setStyle('height', h2);
88    }
89  }
90  
91  //Equal for main column
92  $main = $('jazin');
93  if($main) {
94    makeEqualHeight($main.getChildren());
95  }
96*/  
97
98}
99
100function makeEqualHeight(divs) {
101	if(!divs || divs.length < 2) return;
102	var maxh = 0;
103	divs.each(function(el, i){
104		var ch = el.getCoordinates().height;
105		maxh = (maxh < ch) ? ch : maxh;		
106	},this);
107	divs.each(function(el, i){
108		el.setStyle('height', maxh-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt());		
109	},this);
110}
111
112function getDeepestDiv (div) {
113	while (div.getChildren().length==1 && (div.getChildren()[0].tagName == 'DIV'))
114	{
115		div = div.getChildren()[0];
116	}
117	return div;
118}
119
120function preloadImages () {
121	var imgs = new Array();
122	for (var i = 0; i < arguments.length; i++) {
123		var imgsrc = arguments[i];
124		imgs[i] = new Image();
125		imgs[i].src = imgsrc;
126	}
127}
128
129function makeTransBg(el, bgimgdf, sizingMethod, type, offset){
130	var objs = el;
131	if(!objs) return;
132	if ($type(objs) != 'array') objs = [objs];
133	if(!sizingMethod) sizingMethod = 'crop';
134	if(!offset) offset = 0;
135	var blankimg = siteurl + 'images/blank.png';
136	objs.each(function(obj) {
137		var bgimg = bgimgdf;
138		if (obj.tagName == 'IMG') {
139			//This is an image
140			if (!bgimg) bgimg = obj.src;
141			if (!(/\.png$/i).test(bgimg) || (/blank\.png$/i).test(bgimg)) return;
142
143			obj.setStyle('height',obj.offsetHeight);
144			obj.setStyle('width',obj.offsetWidth);
145			obj.src = blankimg;
146			obj.setStyle ('visibility', 'visible');
147			obj.setStyle('filter', "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+bgimg+", sizingMethod='"+sizingMethod+"')");
148		}else{
149			//Background
150			if (!bgimg) bgimg = obj.getStyle('backgroundImage');
151			var pattern = new RegExp('url\s*[\(\"\']*([^\'\"\)]*)[\'\"\)]*');
152			if ((m = pattern.exec(bgimg))) bgimg = m[1];
153			if (!(/\.png$/i).test(bgimg) || (/blank\.png$/i).test(bgimg)) return;
154			if (!type)
155			{
156				obj.setStyles({'background': 'none'});
157
158				if(obj.getStyle('position')!='absolute' && obj.getStyle('position')!='relative') {
159					obj.setStyle('position', 'relative');
160				}
161
162				obj.getChildren().each(function(el){
163					if(el.getStyle('position')!='absolute' && el.getStyle('position')!='relative') 
164					{
165						el.setStyle('position', 'relative');
166					}
167					el.setStyle('z-index',2);
168				});
169				//Create background layer:
170				var bgdiv = new Element('IMG');
171				bgdiv.src = blankimg;
172				bgdiv.width = obj.offsetWidth - offset;
173				bgdiv.height = obj.offsetHeight - offset;
174				bgdiv.setStyles({
175					'position': 'absolute',
176					'top': 0,
177					'left': -obj.getStyle('padding-left').toInt()
178				});
179
180				bgdiv.className = 'TransBG';
181
182				bgdiv.setStyle('filter', "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+bgimg+", sizingMethod='"+sizingMethod+"')");
183				bgdiv.inject(obj, 'top');
184				//alert(obj.innerHTML + '\n' + bgdiv.innerHTML);
185			} else {
186				obj.setStyle('filter', "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+bgimg+", sizingMethod='"+sizingMethod+"')");
187			}
188		}
189	}.bind(this));
190}
191
192function isIE6() {
193	version=0
194	if (navigator.appVersion.indexOf("MSIE")!=-1){
195		temp=navigator.appVersion.split("MSIE")
196		version=parseFloat(temp[1])
197	}
198	return (version && (version < 7));
199}
200
201function getElementsByClass(searchClass,node,tag) {
202	var classElements = new Array();
203	var j = 0;
204	if ( node == null )
205		node = document;
206	if ( tag == null )
207		tag = '*';
208	var els = node.getElementsByTagName(tag);
209	var elsLen = els.length;
210	var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
211	for (var i = 0; i < elsLen; i++) {
212		if ( pattern.test(els[i].className) ) {
213			classElements[j] = els[i];
214			j++;
215		}
216	}
217	//alert(searchClass + j);
218	return classElements;
219}
220
221//Add span to module title
222jaAddFirstItemToTopmenu = function() {
223	li = $E('#ja-footer ul li');
224	if(li) {
225		li.addClass('ja-firstitem');
226	}
227}
228
229
230function addMouseOver (className) {
231	objs = getElementsByClass (className, document, 'DIV');
232	if (objs){
233		for (i=0; i<objs.length; i++){
234			objs[i].onmouseover=function() {
235				this.className+=" hover";
236			}
237			objs[i].onmouseout=function() {
238				this.className=this.className.replace(new RegExp(" hover\\b"), "");
239			}
240
241		}
242	}
243}
244
245jaIE6hover = function(){
246	addMouseOver('jazin-box');
247	addMouseOver('ja-headtool');
248}
249
250window.addEvent ('load', function() {
251	equalHeight();
252	jaAddFirstItemToTopmenu();
253	jaIE6hover();
254});
255
256

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.