function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function mmLoadMenus() {
  if (window.mm_menu_0602155314_0) return;
  window.mm_menu_0602155314_0 = new Menu("root",52,19,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#ffffff","#c2c7c2","#345071","left","middle",4,0,800,-5,7,true,true,true,0,true,true);
  mm_menu_0602155314_0.addMenuItem("History","location='history.shtml'");
   mm_menu_0602155314_0.hideOnMouseOut=true;
   mm_menu_0602155314_0.menuBorder=1;
   mm_menu_0602155314_0.menuLiteBgColor='#ffffff';
   mm_menu_0602155314_0.menuBorderBgColor='#cccccc';
   mm_menu_0602155314_0.bgColor='#ffffff';

  mm_menu_0602155314_0.writeMenus();
} 

function validate() {
	$form = document.forms[0];
	
	if ( !$form.name.value ) {
		alert("Please enter a Name");
		$form.name.focus();
		return false;
	} /*else if ( !$form.email.value ) {
		alert("Please enter an Email");
		$form.email.focus();
		return false;
	}*/
	 var regExp2  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 
	  if (!(regExp2.test($form.email.value)))
	  {
		  alert("Enter a valid Email address.");
		  $form.email.focus();
		  return false;
	  }
	 
	
}

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

ns3up = (browserName == "Netscape" && browserVer >= 3);
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);

function doPic(imgName) {
if (ns3up || ie4up) {
imgOn = ("" + imgName);
document.mainpic.src = imgOn;
   }
}


// returns HTML Tag ID's proper DOM of user's browser
function findDOM(objectID) {
	if ( document.getElementById ) {
		return (document.getElementById(objectID)); 
	} else if ( document.all ) {
		return (document.all[objectID]); 
	} else {
		browserVersion = parseInt(navigator.appVersion);
		if ((navigator.appName.indexOf('Netscape') != -1 ) && (browserVersion == 4)) {
			return (document.layers[objectID]); 
		}
	}
}


var x, tagName, idNum, Div;
var child = 1;
var sibling = 1;
var singer = 1;
var pallbearer = 1;
var person = 1;

function show(div) {
	div = findDOM(div);
	div.style.visibility = 'visible';
	div.style.position = 'static';
}

function hide(div) {
	div = findDOM(div);
	div.style.visibility = 'hidden';
	div.style.position = 'absolute';
}

function addObject(tagName, idNum) {
	var removeButton, addButton;
	var Div = tagName + idNum.toString();
	show(Div);
	if ( idNum == 5 ) {
		addButton = 'add' + tagName;
		hide(addButton);
	} else if ( idNum >= 2 ) {
		removeButton = 'remove' + tagName;
		show(removeButton);
	}
}

function addPB(tagName, idNum) {
	var removeButton, addButton;
	var Div = tagName + idNum.toString();
	show(Div);
	if ( idNum == 8 ) {
		addButton = 'add' + tagName;
		hide(addButton);
	} else if ( idNum >= 2 ) {
		removeButton = 'remove' + tagName;
		show(removeButton);
	}
}

function add(x) {
	if ( x == 'child' && child < 5 ) {
		child = child + 1;
		addObject(x,child);
	} else if ( x == 'sibling' && sibling < 5 ) {
		sibling = sibling + 1;
		addObject(x,sibling);
	} else if ( x == 'singer' && singer < 5 ) {
		singer = singer + 1;
		addObject(x,singer);
	} else if ( x == 'pallbearer' && pallbearer < 8 ) {
		pallbearer = pallbearer + 1;
		addPB(x,pallbearer);
	} else if ( x == 'person' && person < 5 ) {
		person = person + 1;
		addObject(x,person);
	}
}

function removeObject(tagName,idNum) {
	var Div = tagName + idNum.toString();
	hide(Div);
	if ( idNum == 2 ) {
		var removeButton = 'remove' + tagName;
		hide(removeButton);
	} else if ( idNum > 2 ) {
		var addButton = 'add' + tagName;
		show(addButton);
	}
}

function removePB(tagName,idNum) {
	var Div = tagName + idNum.toString();
	hide(Div);
	if ( idNum == 2 ) {
		var removeButton = 'remove' + tagName;
		hide(removeButton);
	} else if ( idNum > 2 ) {
		var addButton = 'add' + tagName;
		show(addButton);
	}
}
	
function remove(x) {
	if ( x == 'child' && child > 1 ) {
		removeObject(x,child);
		child = child - 1;
	} else if ( x == 'sibling' && sibling > 1 ) {
		removeObject(x,sibling);
		sibling = sibling - 1;
	} else if ( x == 'singer' && singer > 1 ) {
		removeObject(x,singer);
		singer = singer - 1;
	} else if ( x == 'pallbearer' && pallbearer > 1 ) {
		removePB(x,pallbearer);
		pallbearer = pallbearer - 1;
	} else if ( x == 'person' && person > 1 ) {
		removeObject(x,person);
		person = person - 1;
	}
}
	
function casketInput(x) {
	var domMetal = findDOM('metalDiv');
	var domWood = findDOM('woodDiv');
	if ( x == "wood" ) {
		show('woodDiv');
		hide('metalDiv');
	} else {
		hide('woodDiv');
		show('metalDiv');
	}
}

function check() {
	var form = document.form1;
	
	if ( !form.fName.value ) {
		alert("Please enter a first name in personal information");
		form.fName.focus();
		return false;
	} else if ( !form.lName.value ) {
		alert("Please enter a last name in personal information");
		form.lName.focus();
		return false;
	} else if ( !form.personalAddress1.value ) {
		alert("Please enter an address in personal information" );
		form.personalAddress1.focus();
		return false;
	} else if ( !form.personalCity.value ) {
		alert( "Please enter a city in personal information" );
		form.personalCity.focus();
		return false;
	} else if ( !form.personalState.value ) {
		alert( "Please enter a state in personal information" );
		form.personalState.focus();
		return false;
	} else if ( !form.personalZip.value ) {
		alert( "Please enter a zip code in personal information" );
		form.personalZip.focus();
		return false;
	} else if ( !form.personalPhone.value ) {
		alert( "Please enter a phone number" );
		form.personalPhone.focus();
		return false;
	} else if ( !form.personalEmail.value ) {
		alert("Please enter an email address");
		form.personalEmail.focus();
		return false;
	} else return true;
}