PageSourceSearch

https://www.actuchomage.org/templates/ja_teline_ii/js/ja.script.js

js actuchomage.org collected 2026-10-02 10:37:42 UTC 6,242 bytes, 236 lines download raw bytes

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

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.