// Script Library By: Michael A. Karr - Adventure Web Productions - www.advp.com




// Clear Text Field
function clearField(el) {
  if (el.defaultValue==el.value) el.value = ""
}

// Change IE Status Message
function showStatus(sMsg) {
    window.status = sMsg ;
    return true ;
}

// Phone Field Jump
// onkeyup="checklength('nextfield',chars,this.id);"
function checkLength(nextfield,chars,currfieldID) {
	
  var x = document.getElementById(currfieldID).value.length;
  
  if (x == chars) {
    eval('document.contactForm.' + nextfield + '.focus();');
  }

}

// Clone Nodes
var counter = 0;

function moreFields() {
	counter++;
	var newFields = document.getElementById('readroot').cloneNode(true);
	newFields.id = '';
	newFields.style.display = 'block';
	var newField = newFields.childNodes;
	for (var i=0;i<newField.length;i++) {
		var theName = newField[i].name
		if (theName)
			newField[i].name = theName + '[' + counter + ']';
	}
	var insertHere = document.getElementById('writeroot');
	insertHere.parentNode.insertBefore(newFields,insertHere);
}

// Suckerfish IE Helper Script
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

// Suckerfish IE Helper Script for vertical Nav
sfHoverSide = function() {
	var sfEls = document.getElementById("sideNav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfHoverSide";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfHoverSide\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHoverSide);
