function catchTag(tag){
	deletion = false;
	if (document.getElementById('entryTagInput')){
		var tagInputBox = document.getElementById('entryTagInput');
		currentTagList = tagInputBox.value;
		tagList = currentTagList.split(' ');
		for ($a=0; $a<tagList.length; $a++){
			if (tagList[$a] == " " || tagList[$a] == ""){
				tagList.splice($a,1);
			} else if (tagList[$a] == tag){
				deletion = true;
				tagList.splice($a,1);
			}
		}
		if (!(deletion)){
			tagList.push(tag)
		}
		tagInputBox.value = tagList.join(' ');
	}
}