<!-- ------------------------------------- CALCULATOR VALIDATOR  -->

function floor(number)
{
  return Math.floor(number*Math.pow(10,2))/Math.pow(10,2);
}

function dosum()
{
  var mi = document.temps.IR.value / 1200;
  var base = 1;
  var mbase = 1 + mi;
  for (i=0; i<document.temps.YR.value * 12; i++)
  {
    base = base * mbase
  }
  document.temps.PI.value = floor(document.temps.LA.value * mi / ( 1 - (1/base)))
  document.temps.MT.value = floor(document.temps.AT.value / 12)
  document.temps.MI.value = floor(document.temps.AI.value / 12)
  var dasum = document.temps.LA.value * mi / ( 1 - (1/base)) +
	document.temps.AT.value / 12 +
	document.temps.AI.value / 12;
  document.temps.MP.value = floor(dasum);
}


	

<!-- ------------------------------------------- IMAGE SWAP SCRIPT  -->

function showPic (whichpic) { 
	if (document.getElementById) {
		//document.getElementById('placeholder').src = whichpic.href; // replaced with code below
		var str = whichpic.href;
		Link = str.replace(/-large/i, '');
		document.getElementById('placeholder').src = Link;
		
		document.getElementById('placeholder-link').href = whichpic.title;
		document.getElementById('placeholder-link').title = whichpic.rel;
		
		Output = whichpic.rel;
		document.getElementById('placeholder-title').innerHTML = Output;
		//if (whichpic.title) { 
		//	document.getElementById('p7TP1').childNodes[0].nodeValue = whichpic.title; 
		//} else { 
		//	document.getElementById('p7TP1').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue; 
		//} 
		return false; 
	} else { 
		return true; 
		//return false;
	} 
}

<!-- End Image Swap Script -->





//  ---------------------------------------- POPUP WINDOWS FOR CONTACT AND MORT CALC ------------------
	<!-- Begin
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left=568,top=50');");
	return false;
	}
// End -->
 


<!-- ----------------------------------------- CSS EXPAND/DROP --->
function toggleLayer(whichLayer)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style2 = document.getElementById(whichLayer).style;
	style2.display = style2.display? "":"block";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style2 = document.layers[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
	}
	
	// -->
	
