
function homeDisplay(divId) 
{
	document.getElementById('calc').style.display 			= (divId == "calc" ? "block" : "none");
	document.getElementById('about').style.display 			= (divId == "about" ? "block" : "none");
	document.getElementById('people').style.display 		= (divId == "people" ? "block" : "none");
	document.getElementById('btn3').style.display 			= (divId == "people" ? "none" : "block");
	document.getElementById('btn3on').style.display 		= (divId == "people" ? "block" : "none");
	document.getElementById('btn2').style.display 			= (divId == "about" ? "none" : "block");
	document.getElementById('btn2on').style.display 		= (divId == "about" ? "block" : "none");
	document.getElementById('btn1').style.display 			= (divId == "calc" ? "none" : "block");
	document.getElementById('btn1on').style.display 		= (divId == "calc" ? "block" : "none");
}

function loginDisplay()
{
	document.getElementById('logIn').style.display = "block";
	logIn.toggle();
}

function loginCheck() 
{
	var flag;
	var uname = document.getElementById('username').value;
	var pword = document.getElementById('password').value;
	
	if(uname.length <= 0) 	{ flag = true; } 
	if(pword.length <= 0) 	{ flag = true; } 
	
	if(flag) 				{ loginDisplay(); }
	else					{ document.getElementById('loginForm').submit(); } 
}

function toggleDiv(divId,numDiv,iD)
{
	for(i=0;i<numDiv;i++)
	{
		document.getElementById(iD + i).style.display = (divId == i ? "block" : "none");
	}
}

function moveMarker(divId, numDiv, iD)
{
	for(i=0;i<numDiv;i++)
	{
		classvalue = (divId == i) ? 'on' : 'off';
		document.getElementById(iD + i).className = classvalue;
	}	
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0

	if(selObj.options[selObj.selectedIndex].value != "" )
	{
		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		if (restore) selObj.selectedIndex=0;
	}
}

function popwin(w,h,t,l, destfile)
{
	var loc = 'width=' + w + ',height=' + h + ',top=' + t + ',left=' + l;
	calc_handle = window.open(destfile,"calc",",,,status,,scrollbars,resizable," + loc);
	if(parseInt(navigator.appVersion) >= 4)
	{
		calc_handle.window.focus();
	}
}

function doNext(original, destination)
{
	if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
		document.getElementById(destination).focus()
}

/**
 * Populates a select field with all 50 states.
 * @pram Reference to the select element
 * @pram Whether to use full name or abbv for the value (Default: abbv)
 * @return null
 */
function populateStates(stateFrm, full){
	if(full==null)
		full=false;
	stateFrm = ClearOptionsFast(stateFrm);
	for(var i in states){
		var elOptNew = document.createElement('option');
		elOptNew.text = states[i];
		if(full===false)
			elOptNew.value = i;
		else
			elOptNew.value = states[i];
		try {
			stateFrm.add(elOptNew, null); // standards compliant; doesn't work in IE
		}
		catch(ex) {
			stateFrm.add(elOptNew); // IE only
		}
	}
}

/** 
 * Fast javascript function to clear all the options in an HTML select element
 * References to the old <select> object will become invalidated!
 * @pram Reference to select element
 * @return Reference to the new select object
 */
function ClearOptionsFast(id)
{
	var selectObj = id;
	var selectParentNode = selectObj.parentNode;
	var newSelectObj = selectObj.cloneNode(false); // Make a shallow copy
	selectParentNode.replaceChild(newSelectObj, selectObj);
	return newSelectObj;
}


var states = new Array()
states['Select'] = "Select State",
states['AL'] ="Alabama",
states['AK'] ="Alaska",  
states['AZ'] ="Arizona",  
states['AR'] ="Arkansas",  
states['CA'] ="California",  
states['CO'] ="Colorado",  
states['CT'] ="Connecticut",  
states['DE'] ="Delaware",  
states['DC'] ="District Of Columbia",  
states['FL'] ="Florida",  
states['GA'] ="Georgia",  
states['HI'] ="Hawaii",  
states['ID'] ="Idaho",  
states['IL'] ="Illinois",  
states['IN'] ="Indiana",  
states['IA'] ="Iowa",  
states['KS'] ="Kansas",  
states['KY'] ="Kentucky",  
states['LA'] ="Louisiana",  
states['ME'] ="Maine",  
states['MD'] ="Maryland",  
states['MA'] ="Massachusetts",  
states['MI'] ="Michigan",  
states['MN'] ="Minnesota",  
states['MS'] ="Mississippi",  
states['MO'] ="Missouri",  
states['MT'] ="Montana",
states['NE'] ="Nebraska",
states['NV'] ="Nevada",
states['NH'] ="New Hampshire",
states['NJ'] ="New Jersey",
states['NM'] ="New Mexico",
states['NY'] ="New York",
states['NC'] ="North Carolina",
states['ND'] ="North Dakota",
states['OH'] ="Ohio",  
states['OK'] ="Oklahoma",  
states['OR'] ="Oregon",  
states['PA'] ="Pennsylvania",  
states['RI'] ="Rhode Island",  
states['SC'] ="South Carolina",  
states['SD'] ="South Dakota",
states['TN'] ="Tennessee",  
states['TX'] ="Texas",  
states['UT'] ="Utah",  
states['VT'] ="Vermont",  
states['VA'] ="Virginia",  
states['WA'] ="Washington",  
states['WV'] ="West Virginia",  
states['WI'] ="Wisconsin",  
states['WY'] ="Wyoming";



