function toggle(thisname) 
{
 	tr=document.getElementsByTagName('tr')
	
	for (i=0;i<tr.length;i++)
	{
		if (tr[i].getAttribute(thisname))
		{
		   	if ( tr[i].style.display=='none' ) { tr[i].style.display = ''; }
			else { tr[i].style.display = 'none'; }
		}
	}
}

function toggleEdit(thisname) 
{
 	tr=document.getElementsByTagName('span')
	
	for (i=0;i<tr.length;i++)
	{
		if (tr[i].getAttribute(thisname))
		{
		   	if ( tr[i].style.display=='none' ) 
			{ 
			   	tr[i].style.display = '';
			}
			else 
			{ 
			  	tr[i].style.display = 'none';
			}
		}
	}
}

function toggleEditMyAccount(thisname, thatname, turnOn) 
{
 	toggleEdit(thisname)
	toggleEditOff(thatname)
	toggleEditOn(turnOn)
}

function toggleEditOff(thisname) 
{
 	tr=document.getElementsByTagName('span')
				
	for (i=0;i<tr.length;i++)
	{
		if (tr[i].getAttribute(thisname))
		{
		   	if ( tr[i].style.display=='' ) { tr[i].style.display = 'none'; }
			
		}
	}
}

function toggleEditOn(thisname) 
{
 	tr=document.getElementsByTagName('span')
				
	for (i=0;i<tr.length;i++)
	{
		if (tr[i].getAttribute(thisname))
		{
		   	if ( tr[i].style.display=='none' ) { tr[i].style.display = ''; }
			
		}
	}
}

function purchase(meterId, amId, price)
{		 
	var currentURL = 'http://my.murfsys.com/myaccount/makePurchase';
	var okToTransfer = prompt('Please Enter An Amount of Meters To Purchase\nYou Will Be Billed $' + price + ' Per Meter',''); 
	
	if(okToTransfer) 
	{
	 	location.href = currentURL + '/' + meterId + '/' + okToTransfer + '/' + amId;
	}
}



