function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	if (imageType == "swf"){
	newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
	newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('</embed></object>');	}else{
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">'); 	}
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function isValidEmail(str) {
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	return filter.test(str)
}

function checkSubmit(obf) {
	if(!obf.privacy.checked) {
		alert("Devi accettare la clausola legata alla tua privacy");
		return false;
	} else {
		if(!isValidEmail(obf.email.value)) {
			alert("Devi inserire un indirizzo email corretto");
			return false;
		} else {
			return true;
		}
	}
}

function checkSubmit2(obf) {
	var reqText = "";
	for(var i=0;i<obf.elements.length;i++) {
		var one = obf.elements[i];
		if(one.name == "privacy" && one.checked == false) {
			alert("Devi accettare la clausola legata alla tua privacy");
			return false;
		}
		if(one.name == "email" && !isValidEmail(obf.email.value)) {
			alert("Devi inserire un indirizzo email corretto");
			return false;
		}
		if(one.className == "required" && one.value == "") reqText += "\n"+one.name;
	}
	if(reqText != "") {
		alert("Devi compilare anche questi campi: "+reqText);
		return false;
	}
}

function generalPopup(Page,Key,Val,Width,Height,Title,posLeft,posTop) {
	var newWindow = window.open(""+Page+"?"+Key+"="+Val, Title.toString(), "width="+Width+",height="+Height+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.focus();
	newWindow.onblur = newWindow.close;
}

function png_reset(o) {
	for(var i=0;i<o.elements.length;i++) {
		var myE = o.elements[i];
		if(myE.type != "text") continue;
		myE.value = "";
	}
}

// Scrolling orizzontale
/*var scrollableElementId = "tableItems";*/

function doTheScroll() {
	var oT = document.getElementById(scrollableElementId);
	var cP = (oT.style.left == "") ? 0 : parseInt(oT.style.left) ;
	cP = cP + document.amt;
	if(oT.clientWidth + cP  < oT.parentNode.offsetLeft || cP > oT.parentNode.clientWidth - oT.parentNode.offsetLeft) return;
	oT.style.left = cP+"px";
}
function startScroll(amt) {
	document.amt = amt;
	document.myInterval = window.setInterval(doTheScroll, 30);
	return true;
}
function stopScroll() {
	clearInterval(document.myInterval);
	return true;
}

