	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";
	}
	
/*
	by Paul@YellowPencil.com and Scott@YellowPencil.com
	includes TextResizeDetector by Lawrence Carvalho <carvalho@uk.yahoo-inc.com>
	feel free to delete all comments except for the above credit
*/

// The last one is there to show how you can add more columns.  Just delete the ones you're not using.
var divs = new Array('leftpanel', 'copycolumn');

// Initialize Scripts - is this a browser that understands DOM?
function scriptInit() { if (!document.getElementById) { return; } }

// Set up Event Listener
function addEvent(elm, evType, fn, useCapture) { 
	if (elm.addEventListener) { elm.addEventListener(evType, fn, useCapture); return true; } 
	else if (elm.attachEvent) { var r = elm.attachEvent('on' + evType, fn); return r; }
	else { elm['on' + evType] = fn; }
}

// Start Column Script
function setTall() {
	if (document.getElementById) { var maxHeight = 0; for (var i = 0; i < divs.length; i++) {
			if (document.getElementById(divs[i]) != null)
			{ var div = document.getElementById(divs[i]); div.style.height = null; if (div.offsetHeight > maxHeight) maxHeight = div.offsetHeight; }
		}
	for (var i = 0; i < divs.length; i++) {
			if (document.getElementById(divs[i]) != null)
			{ var div = document.getElementById(divs[i]); div.style.height = maxHeight + 'px'; if (div.offsetHeight > maxHeight) { div.style.height = (maxHeight - (div.offsetHeight - maxHeight)) + 'px'; } }
		}
	}
}

// Assign one of the columns to the TextResizeDetector.
function initTall() {
	if (document.getElementById) { for (var i = 0; i < divs.length; i++)
		{ if (document.getElementById(divs[i]) != null) { TextResizeDetector.TARGET_ELEMENT_ID = divs[i]; break; } }
	setTall(); } 
}

// Fire Events
addEvent(window, 'load', initTall, false);
addEvent(window, 'resize', setTall, false);

/*	Detects changes to font sizes when user changes browser settings
	Fires a custom event with the following data:
	iBase  : base font size
	iDelta : difference in pixels from previous setting
	iSize  : size in pixel of text
	author Lawrence Carvalho carvalho@uk.yahoo-inc.com */

// @constructor
TextResizeDetector = function() {
    var el  = null;
	var iIntervalDelay  = 200;
	var iInterval = null;
	var iCurrSize = -1;
	var iBase = -1;
 	var aListeners = [];
 	var createControlElement = function() {
	 	el = document.createElement('span');
		el.id='textResizeControl';
		el.innerHTML='&nbsp;';
		el.style.position="absolute";
		el.style.left="-9999px";
		var elC = document.getElementById(TextResizeDetector.TARGET_ELEMENT_ID);
		// insert before firstChild
		if (elC)
			elC.insertBefore(el,elC.firstChild);
		iBase = iCurrSize = TextResizeDetector.getSize();
 	};

 	function _stopDetector() {
		window.clearInterval(iInterval);
		iInterval=null;
	};
	function _startDetector() {
		if (!iInterval) {
			iInterval = window.setInterval('TextResizeDetector.detect()',iIntervalDelay);
		}
	};

 	 function _detect() {
 		var iNewSize = TextResizeDetector.getSize();

 		if(iNewSize!== iCurrSize) {
			for (var 	i=0;i <aListeners.length;i++) {
				aListnr = aListeners[i];
				var oArgs = {  iBase: iBase,iDelta:((iCurrSize!=-1) ? iNewSize - iCurrSize + 'px' : "0px"),iSize:iCurrSize = iNewSize};
				if (!aListnr.obj) {
					aListnr.fn('textSizeChanged',[oArgs]);
				}
				else  {
					aListnr.fn.apply(aListnr.obj,['textSizeChanged',[oArgs]]);
				}
			}

 		}
 		return iCurrSize;
 	};
	var onAvailable = function() {
		if (!TextResizeDetector.onAvailableCount_i ) {
			TextResizeDetector.onAvailableCount_i =0;
		}

		if (document.getElementById(TextResizeDetector.TARGET_ELEMENT_ID)) {
			TextResizeDetector.init();
			if (TextResizeDetector.USER_INIT_FUNC){
				TextResizeDetector.USER_INIT_FUNC();
			}
			TextResizeDetector.onAvailableCount_i = null;
		}
		else {
			if (TextResizeDetector.onAvailableCount_i<600) {
	  	 	    TextResizeDetector.onAvailableCount_i++;
				setTimeout(onAvailable,200)
			}
		}
	};
	setTimeout(onAvailable,500);

 	return {
		 	init: function() {
		 		createControlElement();
				_startDetector();
 			},

 			addEventListener:function(fn,obj,bScope) {
				aListeners[aListeners.length] = {
					fn: fn,
					obj: obj
				}
				return iBase;
			},

 			detect:function() {
 				return _detect();
 			},

 			getSize:function() {
	 				var iSize;
			 		return el.offsetHeight;
 			},

 			stopDetector:function() {
				return _stopDetector();
			},

 			startDetector:function() {
				return _startDetector();
			}
 	}
 }();

TextResizeDetector.TARGET_ELEMENT_ID = 'doc';
TextResizeDetector.USER_INIT_FUNC = function() {
	var iBase = TextResizeDetector.addEventListener(setTall, null);
};

function escramble(){
 var a,b,c,d,e,f,g,h,i
 a='<a href=\"mai'
 b='admin'
 c='\">'
 a+='lto:'
 b+='@'
 e='</a>'
 f=''
 b+='realestatelink.ca'
 g='<img src=\"'
 h=''
 i='\" alt="Email us." WIDTH="" HEIGHT="" border="0">'

 if (f) d=f
 else if (h) d=g+h+i
 else d=b

 document.write(a+b+c+d+e)
}

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 ;
	}


