window.addEvent('domready', function() {
									 
// CORTINES IMATGES inici
	if ($('kwick-box')) {
		var kwicks = $$('#kwick .kwick');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 300, transition: Fx.Transitions.easeOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 512]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 205) obj[j] = {'width': [w, 205]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('kwick').addEvent('mouseleave', function(e){
			var obj = {};
			kwicks.each(function(other, j){
				obj[j] = {'width': [other.getStyle('width').toInt(), 307]};
			});
			fx.start(obj);
		});
	}
	
	
	// ACORDEONS desplegables format
	if ($('accordion')) {
		var accordion = new Accordion('h3.atStart', 'div.atStart', {
			opacity: true,
			onActive: function(toggler, element){
				toggler.setStyle('font-weight', 'bold');
				toggler.setStyle('font-size', '24px');
				toggler.setStyle('color', '#fff');
				toggler.setStyle('background', '#254063 url(imatges/imagotip-blanc-24x30px.png) 10px 5px no-repeat');
				toggler.setStyle('cursor', 'default');
				
			},
		 
			onBackground: function(toggler, element){
				toggler.setStyle('font-weight', 'normal');
				toggler.setStyle('font-size', '24px');
				toggler.setStyle('color', '#eee');
				toggler.setStyle('background', '#333 url(imatges/imagotip-blanc-24x30px.png) 10px 5px no-repeat');
				toggler.setStyle('cursor', 'pointer');
			}
		}, $('accordion'));
	}

	
});

<!-- Imatges aleatories banner inici -->
var theImages = new Array()
theImages[0] = 'imatges/site_banner-1.jpg'
theImages[1] = 'imatges/site_banner-2.jpg'
theImages[2] = 'imatges/site_banner-3.jpg'
theImages[3] = 'imatges/site_banner-4.jpg'
theImages[4] = 'imatges/site_banner-5.jpg'
theImages[5] = 'imatges/site_banner-6.jpg'
theImages[6] = 'imatges/site_banner-7.jpg'
theImages[7] = 'imatges/site_banner-8.jpg'
theImages[8] = 'imatges/site_banner-9.jpg'
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

