// Generado por : Juanjo Aguilella
// Fecha: 01�10�2008

var JSPage = Class.create(); 

JSPage.prototype = { 
	initialize : function() {
		Object.extend(window, this);
		$$("a.serveis").each(function(item){
			Event.observe(item, "click", window.mostrarServei);
		});
	},
	
	ocultarServeis : function(){
		$$("a.serveis").each(function(item){
			item.removeClassName("on");
		});
		$$("div.serveisCont").each(function(item){
			item.hide();
		});
	},
	
	mostrarServei : function(item){
		window.ocultarServeis();
		
		elemento = Event.element(item);
		elemento.addClassName("on");
		$("serveicont" + elemento.getAttribute("idServei")).show();
		
		//Reseteamos el scroll
		scroll_max=0;
		scroll_actual=0;
		scroll_tendencia=0;
		EstaFentCursorScroll=false;
		OffsetScrollY=0;
		correccioOffset=0;

		mouCapaY('scroll', 83);
		document.getElementById('scroll').style.clip = "rect(0px 1000px 360px 0px)";
		mouCapaY('cursor', 83);

		document.getElementById('scroll').style.height='auto';
		scrollSiProcede();
	}
}

Event.observe(window,"load",function(){
	jsPage = new JSPage();
});
