function removeOption(removeId){
	var urlDiv = document.getElementById('optionsDiv');
	var toRemove = document.getElementById(removeId);
	urlDiv.removeChild(toRemove);
	return false;
}

function addOptionDom(){
	//get the id of the new input text box
	var maxOptionId = document.getElementById("maxOptionId");
	var optionId = parseInt(maxOptionId.value) + 1;			
	var id = "options(op"+optionId + ")";
	
	//get the div with all the text input boxes
	var optionsDiv = document.getElementById("optionsDiv");
	
	//create a div in which to place the input text box
	//and the remove link
	//<div id='file1'>
	var newOptionDiv = document.createElement('div');
	newOptionDiv.setAttribute('id', id);
	
	//create a input text box for the new url
	//<input type='Text' size='50' name='url1'> 
	var newInputText = document.createElement('input');
	newInputText.setAttribute('type', 'Text');
	newInputText.setAttribute('size', '50');
	newInputText.setAttribute('name', id);			
	newOptionDiv.appendChild(newInputText);
	//create the link to remove the url
	//<a href='javascript:removeOption("")>remove</a>
	var newRemoveLink = document.createElement('a');
	newRemoveLink.setAttribute('href', 'javascript:removeOption("'+id+'")');
//	newRemoveLink.setAttribute('href', 'hhhhh');
	newRemoveLink.setAttribute('onclick', 'return removeOption("'+id+'")');			
	var newRemoveLinkText = document.createTextNode("remove");
	newRemoveLink.appendChild(newRemoveLinkText);		
	
	//create a separator between the text box and the remove link
	var separator = document.createTextNode(" ");
	newOptionDiv.appendChild(separator);
	newOptionDiv.appendChild(newRemoveLink);			
	
	optionsDiv.appendChild(newOptionDiv);

	maxOptionId.value = optionId;
	return false;			
}

		
function removeURL(removeId){
	var urlDiv = document.getElementById('urls');
	var toRemove = document.getElementById(removeId);
	urlDiv.removeChild(toRemove);
}

function addURLDom(){
	//get the id of the new input text box
	var maxURLId = document.getElementById("maxURLId");
	var urlId = parseInt(maxURLId.value) + 1;			
	var id = "url(url" + urlId + ")";
	
	//get the div with all the text input boxes
	var urlDiv = document.getElementById("urls");
	
	//create a div in which to place the input text box
	//and the remove link
	//<div id='file1'>
	var newURLDiv = document.createElement('div');
	newURLDiv.setAttribute('id', id);
	
	//create a input text box for the new url
	//<input type='Text' size='50' name='url1'> 
	var newInputText = document.createElement('input');
	newInputText.setAttribute('type', 'Text');
	newInputText.type = 'Text';
//	newInputText.setAttribute('style', 'general');
	newInputText.setAttribute('name', id);			
	newInputText.name=id
	newURLDiv.appendChild(newInputText);

	//create the link to remove the url
	//<a href='javascript:removeFile("file1")>remove</a>
	var newRemoveLink = document.createElement('a');
	newRemoveLink.setAttribute('href', 'javascript:removeURL("'+id+'")');			
//	newRemoveLink.setAttribute('onclick', 'removeURL("'+id+'")');			
	var newRemoveLinkText = document.createTextNode("remove");
	newRemoveLink.appendChild(newRemoveLinkText);		
	
	//create a separator between the text box and the remove link
	var separator = document.createTextNode(" ");
	newURLDiv.appendChild(separator);
	newURLDiv.appendChild(newRemoveLink);			
	
	urlDiv.appendChild(newURLDiv);			
	maxURLId.value = urlId;	
	return false;		
} 