<!-- copyright ICCM 2007 -->





































<!-- script referenced in pages that display the current date -->
var now = new Date();
var days = new Array(
  'Sun','Mon','Tues',
  'Wed','Thurs','Fri','Sat');
var months = new Array(
  'Jan','Feb','Mar','Apr','May',
  'June','July','Aug','Sept','Oct',
  'Nov','Dec');
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
function fourdigits(number)	{
  return (number < 1000) ? number + 1900 : number;}
today =  days[now.getDay()] + ", " +
   months[now.getMonth()] + " " +
   date + ", " +
   (fourdigits(now.getYear()));

<!--change button on hover function-->
function roll(img_name, img_src)
   {
   document[img_name].src = img_src;
   }
   
   
   
<!-- script for onmouseover event -->

function mouseOver()
	{
		document.image1.src="images/special2.gif"
	}
	
function mouseOut()
	{
		document.image1.src="images/special.gif"
	}<!-- empty form field script -->
function validate(theform) {
if (theform.email.value == "" && theform.phone.value == "") { alert("You must enter either your email address or phone No."); return false; }
return true;
}

<!--pre load images in html body tag-->
	function preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	    var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
	    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}





//Class: Calc - mortgage calculator
 

	function Calc() {};
	
	Calc.expandedMenuItem = null;
	Calc.selectedHeaderTab = null;
	
	// Displays the mortgage calculator via the css classes
	Calc.tabDisplay = function(id, avoidLoop) {
		if(Calc.selectedHeaderTab == id && !avoidLoop)
			return;
		
		var obj = Item.get("table-" + id);
		var objContent = Item.get("mortgage-" + id);
		if(obj.className == "selected") {
			Item.displayNone(objContent);
			//Item.hide(objContent);
			Item.classSet(obj, "");
			
			Calc.selectedHeaderTab = null;
		}
		else {
			// Close open tab
			if(Calc.selectedHeaderTab != null && !avoidLoop)
				Calc.tabDisplay(Calc.selectedHeaderTab, true);
				
			Item.displayBlock(objContent);
			//Item.show(objContent);
			Item.classSet(obj, "selected");

			Calc.selectedHeaderTab = id;
		}
		
	};

	//mortgate calculator
	Calc.calculate = function(form) {
		// Get values
		var term = form.term.options[form.term.selectedIndex].value;
		var rate = form.rate.options[form.rate.selectedIndex].value;
		var loan = form.loan.value; //.replace(/[^0-9\.]+/g, '');
		
		if(term == '') {
			alert("Please choose a mortgage term");
			return false;
		}
		if(rate == '') {
			alert("Please choose interest rate");
			return false;
		}
		if(loan == '' || isNaN(loan)) {
			alert("Please enter a loan amount");
			return false;
		}
		
		var mi = rate / 1200;
		var base = 1;
		var mbase = 1 + mi;
		
		for (i=0; i < term * 12; i++) {
			base = base * mbase;
		}

		form.repayments.value = Math.floor((loan * mi / ( 1 - (1/base)))*Math.pow(10,2))/Math.pow(10,2);
		
		return false;
	};
	
	Calc.addOnLoad = function(func) {
		if(Calc.onloads == null)
			Calc.onloads = new Array();
		Calc.onloads.push(func);
	};
	
	
// Class: Item used to make calculator visible


	function Item() {};
	
	// Static get method
	Item.get = function(idOrObj) {
		if(typeof(idOrObj) == "object")
			return idOrObj;
		if(document.getElementById)
			return document.getElementById(idOrObj);
		else if(document.all)
			return document.all[idOrObj];
		else if(document.layers)
			return document.layers[idOrObj];
		return null;
	};

	// Static class set method
	Item.classSet = function(idOrObj, className) {
		var obj = Item.get(idOrObj);
		if(obj.Item_className == null)
			obj.Item_className = obj.className;
		obj.className = className;
	};
	
	// Class restore method (if prev class name set)
	Item.classRestore = function(idOrObj) {
		var obj = Item.get(idOrObj);
		if(obj.Item_className)
			Item.classSet(obj, obj.Item_className);
	};

	// Check if object has a class
	Item.classCheck = function(idOrObj, className) {
		var obj = Item.get(idOrObj);
		return ((" " + obj.className + " ").indexOf(" " + className + " ") >= 0);
	};
	
	// Static replace sub-class within object classes
	Item.classReplace = function(idOrObj, from, to, appendIfAbsent) {
		var obj = Item.get(idOrObj);

		var newClass = obj.className;
		
		// Find " from " and replace with " to "
		if(from != null && from != "") {
			newClass = (" " + newClass + " ").replace(" " + from + " ", " " + to + " ");
			newClass = newClass.substring(1, newClass.length - 1);
		}
		// Add if "from" class is absent?
		if(((from == null || from == "") || appendIfAbsent) && (" " + newClass + " ").indexOf(" " + to + " ") < 0)
			newClass = (newClass != "" ? newClass + " " : "") + to;
			
		// Set new class
		Item.classSet(obj, newClass);
	};

	
	
	// Static get method
	Item.getStyle = function(idOrObj, property) {
		var obj = Item.get(idOrObj);
		
		if(obj && property != null) {
			var value = null;
			if(window.getComputedStyle)
				value = window.getComputedStyle(obj, null).getPropertyValue(property);
			else if(obj.currentStyle)
				value = eval('obj.currentStyle.' + property);

			if(value != null) {
				if((property == "width" || property == "height") && value.match(/(%|auto)/g))
					value = (property == "width") ? obj.offsetWidth : obj.offsetHeight;
				else if((property == "left" || property == "top") && value.match(/(%|auto)/g))
					value = (property == "left") ? obj.offsetLeft : obj.offsetTop;
				return (value+"").replace(/px/g, "");
			}
		}
		return (obj && obj.style) ? obj.style : null;
	};
	
	

	// Is object displayed
	Item.isDisplayed = function(idOrObj) {
		var display = Item.getStyle(idOrObj, "display");
		return (display != "none");
	};
	// Static display method
	Item.display = function(idOrObj, display) {
		var obj = Item.get(idOrObj);
		if(obj.Item_display == null)
			obj.Item_display = Item.getStyle(idOrObj, "display");
		Item.getStyle(obj).display = display;
	};
	// Display restore method
	Item.displayRestore = function(idOrObj) {
		var obj = Item.get(idOrObj);
		if(obj.Item_display != null)
			Item.display(obj, obj.Item_display); 
	};
	// Display none method
	Item.displayNone = function(idOrObj) { Item.display(idOrObj, "none"); };
	// Display block method
	Item.displayBlock = function(idOrObj) { Item.display(idOrObj, "block"); };
	// Display inline method
	Item.displayInline = function(idOrObj) { Item.display(idOrObj, "inline"); };

	// Is object visisble
	Item.isVisible = function(idOrObj) {
		var visibility = Item.getStyle(idOrObj, "visibility");
		return (visibility != "hidden");
	};
	// Static visibility method
	Item.visibility = function(idOrObj, visibility) {
		var obj = Item.get(idOrObj);
		if(obj.Item_visibility == null)
			obj.Item_visibility = Item.get(idOrObj).visibility;
		Item.getStyle(obj).visibility = visibility;
	};
	// Restore visibility
	Item.restoreVisibility = function(idOrObj) {
		var obj = Item.get(idOrObj);
		if(obj.Item_display != null)
			Item.visibility(obj, obj.Item_visibility);
	};
	// Show method
	Item.show = function(idOrObj) { Item.visibility(idOrObj, "visible"); };
	// Hide method
	Item.hide = function(idOrObj) { Item.visibility(idOrObj, "hidden"); };

//end of Class Item
