function popUp(url,w,h) {
	window.open(url, 'popupWin', 'top=15,left=15,width=' + w + ',height=' + h).focus();
}
function popUpResize(url,w,h) {
	window.open(url, 'popupWin', 'top=15,left=15,resizable,scrollbars,width=' + w + ',height=' + h).focus();
}

function checkSize()  {
	window.resizeTo(document.images[0].width + 10, document.images[0].height + 30); window.focus();
}

function goBack() {
	history.back(-1)
}
	
function alertDelete() {
	return(confirm('Attenzione! La cancellazione non puņ essere annullata, vuoi procedere?'));
}

function checksize2()  {
	if (document.images[0].complete) {
		window.resizeTo(document.images[0].width+10,document.images[0].height+30); window.focus();
	} else {
		setTimeout('check()',250)
		}
}

function setPos() {
	gal = document.getElementById("gallery");
	galCopy = document.getElementById("galleryCopy");
	galW = getElementWidth("gallery");
	galCopyW = getElementWidth("galleryCopy");
	gal.style.left = "0px";
	galCopyOffSet = galW + "px";
	//alert(asd);
	galCopy.style.left = galCopyOffSet;
	startScroll();
}
function startScroll() {
	gal.style.left = parseInt(gal.style.left) - 1 + "px";
	if (gal.style.left == "-" + galW + "px") {
		gal.style.left = galW + "px";
	}
	galCopy.style.left = parseInt(galCopy.style.left) - 1 + "px";
	if (galCopy.style.left == "-" + galW + "px") {
		galCopy.style.left = galW + "px";
	}
	timer = setTimeout("startScroll()", 5)
}
function stopScroll() {
	window.clearTimeout(timer)
}
function getElementWidth(Elem) {
	if(document.getElementById) {
		var elem = document.getElementById(Elem);
	} else if (document.all) {
		var elem = document.all[Elem];
	}
	xPos = elem.offsetWidth;
	return xPos;
}