	function imgSwap(oImg){
	   var strOver  = ".out"    // image to be used with mouse over
	   var strOff = ".over"     // normal image
	   var strImg = oImg.src
	   if (strImg.indexOf(strOver) != -1) 
	      oImg.src = strImg.replace(strOver,strOff)
	   else
	      oImg.src = strImg.replace(strOff,strOver)
	}
	
	function ajaxToolTip(post_id) { 
		var url = 'inc/getdateinfo.php';
		var pars = { post_id: post_id };
		var ajax = new Ajax.Updater({success: 'events'},url,{method: 'post', parameters: pars, onFailure: reportError});
		Effect.BlindDown('events', { duration:1.5 });
	}
	
	function reportError(request) {
		$F('events') = "Error";
	}
	
var popUp = null;
	var chasm = screen.availWidth;
	var mount = screen.availHeight;
	var w = 0;
	var h = 0;
	function openWindow(url,w,h) {
	
	popUp = window.open(url,'','scrollbars,width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5));
	}

function go1(){
	if (document.getElementById('select1').value != "none") {
		location = document.getElementById('select1').value
	}
}

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

function Factor(IntRate) {
// ppy Payments per Year
// cpy Compounding periods per Year
// ppc Payments per Compounding period
   var ppc ; // assuming monthly payments, semi-annual compounding (Canadian)
   var ppy = 12 ;
   var cpy = 2 ;
   ppc = ppy / cpy;
   var Fac = cpy * 100.;
   Fac = Math.pow((1. + IntRate/ Fac),(1. / ppc)) - 1.;
   return(Fac);
   } // end Factor()

function Payment(Principal,Fac, AmortPer) {
   // assuming monthly payments, semi-annual compounding (Canadian)
   var ppy = 12 ;
   var cpy = 2 ;
   var ppc = ppy / cpy;
   var m4 = -(cpy * ppc * AmortPer);
   var m5 = 1.- Math.pow((1. + Fac),m4);
   var Pay = Principal * Fac / m5;
   return(Pay);
  }

function ownCalc(){
	var TLoan = floor(document.getElementById('Loan').value) ;
	var TnoYears = floor(document.getElementById('noYears').value) ;
	var TintRate = floor(document.getElementById('intRate').value) ;
	var factor = Factor(TintRate);
	var TmoPayt = floor(Payment(TLoan,factor, TnoYears)) ;
	var TmoTax = floor(document.getElementById('yrTax').value / 12) ;
	var TmoIns = floor(document.getElementById('yrIns').value / 12) ;
	var TmoCost = floor(TmoPayt + TmoTax + TmoIns) ;
	document.getElementById('moPayt').value = TmoPayt ;
	document.getElementById('moTax').value = TmoTax ;
	document.getElementById('moIns').value = TmoIns ;
	document.getElementById('moCost').value = TmoCost ;
	}

//checking for client events on the view page
function noContact() {

FN=document.getElementById('FIRST_NAME').value;
EM=document.getElementById('EMAIL').value;
PH=document.getElementById('PHONE').value;

if (FN.length<2) {
	alert("Please enter your first name.");
	document.getElementById('FIRST_NAME').focus();
	return false;
    }
if (EM.length<2) {
	alert("Please enter a valid email address.");
	document.getElementById('EMAIL').focus();
	return false;
    }
if (PH.length<2) {
	alert("Please enter a phone number.");
	document.getElementById('PHONE').focus();
	return false;
    }
}
