startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;

// counts characters on the expo guide listing form
function charCounter(id, targetId, maxLength)
{
	var element = document.getElementById(id);
	var target = document.getElementById(targetId);
	
	var length = element.value.length;
	
	if(length > maxLength)
	{
		element.value = element.value.substring(0, maxLength);	
		target.innerHTML = 0;
	}
	else
		target.innerHTML = (maxLength - length);
		
}


// Adds additional rows for more expo booths to be added
// Add company page
fileUpPos = 0;
function showBoothBlank(tableId)
{
	fileUpPos++;
	
	var table = document.getElementById(tableId);
	var lastRow = table.rows.length - 1;
	
	var newRow1 = table.insertRow(lastRow);
	var leftCell1 = newRow1.insertCell(0);
	var rightCell1 = newRow1.insertCell(1);
	
	var formInput = document.createElement('input');
	formInput.type = 'text';
	formInput.size = '1';
	formInput.name = 'boothNumbers[]';
	formInput.maxlength = '10';
	
	leftCell1.appendChild(document.createTextNode('Booth ' + (fileUpPos + 1) +':'));
	rightCell1.appendChild(formInput);
	
}

// function to confirm an action
function confirmAction(action, content)
{
	var returnResult = false;	
	
	if(confirm("Are you sure you want to " + action + " " + content))
		returnResult = true;
	
	return returnResult;
}