// JavaScript Document
function cambiacontenuto(div, inner, w, h, title) {
	if(div&&inner&&w&&h) {
		var e = document.getElementById(div);
		//e.innerHTML = inner;
		e.innerHTML = "";
		e.innerHTML = "<div style='background-image:url(zoom.aspx?imgfile=public\/foto\/"+inner+"&width="+w+"&height="+h+");' id='img_grande'><!--<img src='immagini\/lente.png' border='0' width='335' height='270'>--><a href='zoom.aspx?imgfile=public\/foto\/"+inner+"&width=800&height=600' rel='lightbox' id='img_grande_link' title=\""+title+"\" style='width: 335px; height: 270px;'><img src='immagini\/trasp.gif' border='0' width='335' height='270'><\/a><\/div><input type='hidden' id='link' value='zoom.aspx?imgfile=public\/foto\/"+inner+"&width=800&height=600' \/>";
		var arVersion = navigator.appVersion.split("MSIE")
		var version = parseFloat(arVersion[1])
		
		if ((version >= 5.5) && (document.body.filters)) 
		{
		   for(var i=0; i<document.images.length; i++)
		   {
			  var img = document.images[i]
			  var imgName = img.src.toUpperCase()
			  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
			  {
				 var imgID = (img.id) ? "id='" + img.id + "' " : ""
				 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
				 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
				 var imgStyle = "display:inline-block;" + img.style.cssText 
				 if (img.align == "left") imgStyle = "float:left;" + imgStyle
				 if (img.align == "right") imgStyle = "float:right;" + imgStyle
				 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
				 var strNewHTML = "<span " + imgID + imgClass + imgTitle
				 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
				 + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
				 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
				 img.outerHTML = strNewHTML
				 i = i-1
			  }
		   }
		}

	}
}

function cambiacontenuto_concorso(div, img) {
	if(div&&img) {
		var e = document.getElementById(div);
		//e.innerHTML = inner;
		e.style.backgroundImage = "url("+img+")";
	}
}

function sceglipagamento(id, idpagamento) {
	if(id&&idpagamento){
		location.href='sceglipagamento.asp?ID='+id+'&IDPagamento='+idpagamento;
	}
}

function mostranascondi(nomediv) {
	if(nomediv) {
		if(document.getElementById(nomediv).style.display=='none') {
			document.getElementById(nomediv).style.display='';
		} else {
			document.getElementById(nomediv).style.display='none';
		}
	}
}

function cambiaquantita(q, id) {
	q +=1
	if(q&&id){
		location.href='cambiaquantita.asp?ID='+id+'&q='+q;
	}
}

//funzione per cambiare quantità di stampa di una foto
function cambiaqta (dir, n) {
	if(dir&&n) {
		var q = document.getElementById('riga_'+n).selectedIndex;
		q++;
		location.href='gallery.asp?dir='+dir+'&action=edit&n='+n+'&q='+q;
	}
}

function sceglipuntovendita(idordine, puntovendita) {
	if(idordine){
		location.href='sceglipuntovendita.asp?IDOrdine='+idordine+'&pv='+puntovendita;
	}
}




