//uiFunctions.js
//JavaScript UI functions for 3D-Eye Home v2.0
//Created by: Patrick Chrobak for Eyemaginations
//Created: 12/3/2007


//Swaps out an image with another.  Intended to switch visual states for buttons.
function imgStateChange(imgID,imgOverState)
{
   document.getElementById(imgID).src=imgOverState;
}



//This adds a section to the first part of the newsletter creation process
	function AddSection(){
		var NewRow = document.getElementById("doctors").insertRow(document.getElementById("doctors").rows.length);
		var cell1 = NewRow.insertCell(0);
		var cell2 = NewRow.insertCell(1);
		var test = document.getElementById("doctors").rows.length;
		var test = test +1;
		cell1.innerHTML =  "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=2 face=arial color=black><strong>Doctor "+test+":</strong></font>";
		cell2.innerHTML = "<input type=\"text\" name=\"doctors[ ]\" value=\"\" size=\"50\"/><a href='' onclick='trackRemoveDoctor();return RemoveSection();'/>&nbsp;Remove</a>";
		return false;
	}
function RemoveSection(){
	//This removes a section at the first part of the newsletter creation process
		var SectionsTable = document.getElementById("doctors");
		var LastRow = SectionsTable.rows.length-1;
		if (LastRow < 0){
			alert("There are no more rows to delete. Please add a row before attempting to delete 1");
		}else{
			SectionsTable.deleteRow(LastRow);
		}
		return false;
	}
	
	

