var dom = document.getElementById ? true:false;
var ns4 = document.layers ? true:false;
var ns = navigator.appName.indexOf("Netscape")!=-1 ? true:false;
var ie4 = document.all ? true:false;
var mac = navigator.appVersion.indexOf('Mac')!=-1 ? true:false;
var marge_x = 292, marge_y = 45;
if (ie4) {
	marge_x += 8;
}

function calcularMides() {
	if (window.innerHeight) {
		pYy = window.innerHeight-marge_y;
		pXx = (window.innerWidth/2)+marge_x;
	} else {
		pYy = document.body.clientHeight-marge_y;
		pXx = (document.body.clientWidth/2)+marge_x;
	}
	if ( (ie4)&&(mac) ) {
		document.all['divCSSection'].style.left = pXx+"px";
		document.all['divCSSection'].style.top = document.body.offsetHeight-marge_y+"px";
	}
}

function JSFX_FloatTopDiv() {
	var startX = 0,	startY = 0;
	var d = document;
	var el;
	function ml(id) {
		el = dom ? d.getElementById(id):ie4?d.all[id]:d.layers[id];
		if (ns4) {
			el.style = el;
		}
		el.sP = function(x,y) {
			this.style.left = x+"px";
			this.style.top = y+"px";
		}
		el.x = startX;
		el.y = startY;
		return el;
	}
	var compte = 0;
	window.stayVis = function() {compte += 1;
		if (window.innerHeight) {
			pYy = window.innerHeight-marge_y;
			pXx = (window.innerWidth/2)+marge_x;
		} else {
			pYy = document.body.clientHeight-marge_y;
			pXx = (document.body.clientWidth/2)+marge_x;
		}
		var pY = window.pageYOffset ? window.pageYOffset : document.body.scrollTop;
		//var pY = window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop-332;
		
		pY += pYy;
		ftlObj.y += (pY+startY-ftlObj.y)/3;
		ftlObj.x = pXx;
		//ftlObj.x += (pXx-ftlObj.x)/3;
		
		//document.getElementById("eps").value = pY;
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayVis()", 50);
	}
	ftlObj = ml("divCSSection");
	stayVis();
}

if ( (mac)&&(ie4) ) {
	void(null);
} else {
	calcularMides();
	setTimeout("JSFX_FloatTopDiv();",3000);
}

function mostrarCatalogos() {
	window.location = link_catalegs;
}

function mostrarMarcas() {
	window.location = link_marques;
}

function mostrarDondeEstamos() {
	window.location = link_donde_estamos;
}

function mostrarTrabajaConNosotros() {
	window.location = link_trabaja_con_nosotros;
}

function mostrarCifecEco() {
	window.location = link_cifec_eco;
}

function mostrarProductesPromocio() {
	window.location = link_productes_promocio;
}

function mostrarDadesPersonals() {
	window.location = link_dades_personals;
}

function mostrarSocios() {
	window.location = link_socis;
}
