function addAttachmentElement1() {

var container = document.getElementById('attachment_container1');
var counter = document.getElementById('attachment_counter1').value;
counter++;

document.getElementById('attachment_counter1').value = counter;
var attachment_div = document.createElement('div');
attachment_div.setAttribute('id','attachment1_'+counter);
attachment_div.setAttribute('class','attachment');

	var attachment_label = document.createElement('label');
	//attachment_label.innerHTML = "Select file #"+counter+":&nbsp;";
	
	
	var attachment_input = document.createElement('input');
	attachment_input.setAttribute('type','file');
	attachment_input.setAttribute('size','14');
	attachment_input.setAttribute('id','file1_'+counter);
	attachment_input.setAttribute('name','upload_file['+counter+']');
	attachment_div.appendChild(attachment_input);
	
	var attachment_a2 = document.createElement('a');
	//attachment_a2.setAttribute('href','#');
	//attachment_a2.setAttribute('onclick','removeAttachmentElement1('+counter+');return false;');
		var attachment_img2 = document.createElement('img');
		attachment_img2.setAttribute('id','RemoveButton1_'+counter);
		attachment_img2.setAttribute('src','images/minusButton.png');
		attachment_img2.setAttribute('alt','Remove');
		attachment_img2.setAttribute('border','0');
		attachment_img2.setAttribute('onmousedown',"this.src='images/minusButtonDown.png';");
		attachment_img2.setAttribute('onmouseup',"this.src='images/minusButton.png';");
		attachment_img2.setAttribute('onclick','removeAttachmentElement1('+counter+');return false;');
		attachment_a2.appendChild(attachment_img2);

	attachment_div.appendChild(attachment_a2);
	
container.appendChild(attachment_div);
}

function removeAttachmentElement1(num_id) {
	var container = document.getElementById('attachment_container1');
	container.removeChild( document.getElementById('attachment1_'+num_id) );
}
function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "none";
}
}
}

function toggleTree(id){
if (document.getElementById)
{
obj = document.getElementById(id);
if (obj.innerHTML == "[-]"){
obj.innerHTML = "[+]";
} else {
obj.innerHTML = "[-]";
}
}
}
function selectAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].selected = true ;
}
function unselectAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].selected = false ;
}
function checklist(){
	if(document.form1.selectall.checked==true){
		selectAll(document.form1.sendto);
	}else{
	unselectAll(document.form1.sendto);
	}
	}
	function first() {
	if(document.getElementById("manage").style.display == "none") {
		document.getElementById("manage").style.display = "";
	
		}
	}
	function divToggle(block){
	if (document.getElementById(block).style.display=="block"){
		document.getElementById(block).style.display="none";
	} else {
		document.getElementById(block).style.display="block";
	}

}

function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "none";
}
}
}
