function popUp(URL,w,h)
{
	day = new Date();
	id = day.getTime();
	l = Math.floor((screen.width-w)/2);
	t = Math.floor((screen.height-h)/2);
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+w+',height='+h+',left = '+l+',top = '+t+'');");
}

function closeform()
{
	document.getElementById('form').style.display='none';
}

function change(id)
{
 	document.getElementById(id).value = '';
}

function changefoto(id, path, style)
{
 	d = document.getElementById('foto');
 	d.innerHTML = "<a href='javascript:popUp(\"?action=popup&amp;tpl=img&amp;img="+path.replace("thumb","real")+id+"\",800,600)'><img src='"+path+id+"' alt='' style='"+style+"'></a>";
}

function cntr()
{
	if (document.form.taglia.value=="Taglia")
	{
		if (document.form.qnt.value=="" || document.form.qnt.value==0)
		{
			t = document.getElementById("alert");
			t.style.display="block";
		}
		else document.form.submit();
	}
	else
	{
		if (document.form.tagliaf.selectedIndex==0 || document.form.qnt.value=="" || document.form.qnt.value==0)
		{
			t = document.getElementById("alert");
			t.style.display="block";
		}
		else
		{
			t = document.getElementById("misura");
			v = document.getElementById("taglia");
			content = document.form.tagliaf.options[document.form.tagliaf.selectedIndex].value;
			contentv = document.form.tagliaf.options[document.form.tagliaf.selectedIndex].text;
			t.value=content;
			v.value=contentv;
			document.form.submit();
		}
	}
}

function visordine(id)
{
	t = document.getElementById("or_"+id);
	if (t.style.display=="none") t.style.display="";
	else t.style.display="none";
}
