function visible(name)
	{
	var name;

	if (document.all[name].style.display == "none")
		document.all[name].style.display = "";
       else
		if (document.all[name].style.display == "")
		document.all[name].style.display = "none";
	}

function addFile(btn)
	{
	if(document.getElementById)
		{
		tr = btn;
		while (tr.tagName != 'TR') tr = tr.parentNode;
		var idSuffix = Math.round(Math.random()*1000);
		var newTr = tr.parentNode.insertBefore(tr.cloneNode(true),tr.nextSibling);
		thisChilds = newTr.getElementsByTagName('td');
		for (var i = 0; i < thisChilds.length; i++)
			{
			if (thisChilds[i].className == 'header') thisChilds[i].innerHTML = '';
			}
		checkForLast();
		}
	}

function dropFile(btn)
	{
	if(document.getElementById)
		{
		tr = btn;
		while (tr.tagName != 'TR') tr = tr.parentNode;
		tr.parentNode.removeChild(tr);
		checkForLast();
		}
	}

function checkForLast(){
	p_counts = document.getElementsByName('drop');
	for (i = 0; i < p_counts.length; i++){
		p_counts[i].disabled = (p_counts.length == 1) ? true : false;
	}
	}
	
function wpopup(win)
	{
	var cursor = window.event;
	
	x = cursor.clientX + document.body.scrollLeft+14;
	y = cursor.clientY + document.body.scrollTop-14;
	
	//document.all['wpopup'].style.width = width;
	//document.all['wpopup'].style.height = height;

	document.all['wpopup'].style.top = y;
	document.all['wpopup'].style.left = x;

	document.all['wpopup'].innerHTML = document.all[win].innerHTML;
	
	if (document.all['wpopup'].style.display == '')
		{
		document.all['wpopup'].style.display = 'none';
		}
		else
		{
		document.all['wpopup'].style.display = '';
		}
	}
	
function wpopup_close(name)
	{
	document.all[name].style.display = 'none';
	}



