//<![CDATA[
function entraMenu() {
	cap_detect = getCapa('noticies')
	if(cap_detect!= null) {
		show('noticies')
		show('empresa')
		show('productes')
		w = getCapa('noticies_roll')
		w.style.top = "12px";
		y = getCapa('empresa_roll')
		y.style.top = "12px";
		z = getCapa('productes_roll')
		z.style.top = "12px";
		new Effect.Move('noticies_roll', { x: 0, y: 0, mode: 'absolute', duration:0.4, delay: 0.1});
		new Effect.Move('empresa_roll', { x: 0, y: 0, mode: 'absolute', duration:0.4, delay: 0.3});
		new Effect.Move('productes_roll', { x: 0, y: 0, mode: 'absolute', duration:0.4, delay: 0.5});
	}
}
function entraEmpresa() {
	desSelecciona('productes_roll');
	hide('subproductes');
	show('subempresa');
	seccio='empresa';
	new Effect.Grow('historia', {direction: 'center', duration: 1.0});
	new Effect.Grow('metode', {direction: 'center', duration: 1.0, delay: 0.2});
	new Effect.Grow('entorn', {direction: 'center', duration: 1.0, delay: 0.4});
}
function entraProductes() {
	desSelecciona('empresa_roll');
	hide('subempresa');
	show('subproductes');
	seccio='productes';
	new Effect.Grow('llonganissa', {direction: 'center', duration: 1.0});
	new Effect.Grow('fuet', {direction: 'center', duration: 1.0, delay: 0.2});
	new Effect.Grow('xoricos', {direction: 'center', duration: 1.0, delay: 0.4});
	new Effect.Grow('geganta', {direction: 'center', duration: 1.0, delay: 0.6});
	new Effect.Grow('llescats', {direction: 'center', duration: 1.0, delay: 0.8});
}

// FA VISIBLES ELS MENUS QUAN NO HI HA EFECTE
function show(ide) {
	x = getCapa(ide)
	x.style.display = "block"
}
function hide(ide) {
	x = getCapa(ide)
	x.style.display = "none"
}
function selecciona(idSec){
	x = getCapa(idSec)
	x.style.top = "-12px"
}
function desSelecciona(idSec){
	x = getCapa(idSec)
	x.style.top = "0px"
}
function mostraMenu() {
	show('noticies')
	show('empresa')
	show('productes')
	// roll imatge de la seccio
	selecciona(seccio+"_roll")
}
function mostraEmpresa() {
	show('subempresa')
	show('historia')
	show('metode')
	show('entorn')
}
function mostraProductes() {
	show('subproductes')
	show('llonganissa')
	show('fuet')
	show('xoricos')
	show('geganta')
	show('llescats')
}

// AFUANTA VISIBLES ELS ROLLOVERS DEL MENU
function visible(id) {
	if (document.getElementById) {
		x = document.getElementById(id);
	} else if (document.all) {
		x = document.all[id];
	}
	x.style.opacity = 1
}
function fixNoticies(){
	visible('noticies_roll')
}
function fixEmpresa(){
	visible('empresa_roll')
}
function fixProductes(){
	visible('productes_roll')
}
function actualitzaBkg(){
	var fonsid = Cookie.get("cduran_bkg");
	var x = getCapa("cduran_bkg");
	//alert(fonsid+" : "+x.style.backgroundImage)
	x.style.backgroundImage = "url(img/bckgrnd"+fonsid+".jpg)";
}
// ]]>