addthis_pub = "a.ingoglia@uplink.it";

function UPL_popup(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function UPL_scrollLayer() {
	document.getElementById("travel2o").style.top = document.body.scrollTop + document.body.clientHeight - 42;
	UPL = window.setTimeout("UPL_scrollLayer()", 1);
}

function UPL_startLayer() {
	if (UPL_getCookie("chiuso") != null) {
		document.getElementById("travel2v").style.visibility = "hidden";
		document.getElementById("travel2o").style.visibility = "hidden";
		document.getElementById("travel2c").style.visibility = "hidden";
	} else {
		if (UPL_getCookie("start") != null) {
			intStart = UPL_getCookie("start");
		}
		if ((screen.width < 1280) || (document.body.clientWidth < 1200)) {
			intStart = 2;
			document.getElementById("upl_ico").style.visibility = "hidden";
		}
		if (intStart == 1) {
			document.getElementById("travel2v").style.visibility = "visible";
			document.getElementById("travel2o").style.visibility = "hidden";
			document.getElementById("travel2c").style.visibility = "hidden";
		} else if (intStart == 2) {
			document.getElementById("travel2v").style.visibility = "hidden";
			document.getElementById("travel2o").style.visibility = "visible";
			document.getElementById("travel2c").style.visibility = "hidden";
		} else if (intStart == 3) {
			document.getElementById("travel2v").style.visibility = "hidden";
			document.getElementById("travel2o").style.visibility = "hidden";
			document.getElementById("travel2c").style.visibility = "visible";
		}
	}
}

function UPL_close() {
	UPL_setCookie("chiuso", 1);
	UPL_startLayer();
}

function UPL_change(c) {
	UPL_setCookie("start", c);
	UPL_startLayer();
}

function UPL_setCookie(nome, valore) {
	valore = escape(valore);
	document.cookie = nome + "=" + valore;
}

function UPL_getCookie(nome) {
	var valore = document.cookie;
	var inizioCookie = valore.indexOf(" " + nome + "=");
	if (inizioCookie == -1) {
		inizioCookie = valore.indexOf(nome + "=");
	}
	if (inizioCookie == -1) {
		valore = null;
	}
	if (inizioCookie >= 0) {
		inizioCookie = valore.indexOf("=", inizioCookie) + 1;
		var fineCookie = valore.indexOf(";", inizioCookie);
		if (fineCookie == -1) {
			fineCookie = valore.length;
		}
		valore = unescape(valore.substring(inizioCookie, fineCookie));
	}
	return valore;
}

