
var _attaches = 0;

function addAttachment(wheretoadd,newccount){
	_attaches++;
	var attachments = document.getElementById(wheretoadd);
	document.getElementById(newccount).value = _attaches;
	
	attachments.innerHTML += "<input type='file' name='file_" + _attaches + "' id='file_" + _attaches + "' /><br />";
	// now that we have the file box there ... let's add height to the content
	
	var content = document.getElementById('content');
	content.style.height = 'auto';
	var cont_height = content.offsetHeight;		
	
	content.style.height = cont_height + 20;	
}

function CheckFolders(folder, existing_folders){
	for(i=0;i<existing_folders.length;i++){
		if(folder.value == existing_folders[i].value){
			alert('Sorry, the folder name of "'+folder.value+'" has already been used.\nPlease try again.');
			folder.focus();
		}
	}
}

function changeClass(id,way){
	cn = (way == 'on') ? 'highlight' : '';
	
	document.getElementById(id).className = cn;
	
}