function subtree(idImg, id)
{
	var ptr = document.getElementById(idImg);
	var idPtr = document.getElementById(id);
	if ((ptr.src).indexOf('images/treeclose.gif') > -1)
	{
		ptr.src = 'images/treeopen.gif';
		idPtr.style.display = 'block';
	}
	else
	{
		ptr.src = 'images/treeclose.gif';
		idPtr.style.display = 'none';
	}
}

function imgResizeWH(imagePtr,wn,hn,wo,ho)
{
	if (imagePtr.style.width!=wn+'px')
	{
		imagePtr.style.width=wn+'px';
		imagePtr.style.height=hn+'px';
	}
	else 
	{
		imagePtr.style.width=wo+'px'; 
		imagePtr.style.height=ho+'px';
	}
}

function calculateTOT(ss)
{
	var tot = document.getElementById('totprice');
	var ssp = document.getElementById('ssprice');
	var tss = document.getElementById('totss');
	ssp.innerHTML = ss;
	var price = (tot.innerHTML-0)+(ssp.innerHTML-0);
	price = Math.round(price*100)/100;
	price += '';
	if (price.indexOf('.')<0)
		price += '.00';
	else if (price.charAt(price.length-2)=='.')
	   price += '0';
	tss.innerHTML = price;
	
	document.getElementById('paypaldiv').style.display='block';
}

function convertoppal()
{ 
  var importo = ""+document.getElementById('totss').innerHTML;
  if (importo == 'undefined') {
    return false;
  }
  document.getElementById('amount').value = importo;
}
