<!--

/***************************************************
BEGIN TESTIMONIALS SECTION
***************************************************/

	// the array of all testimonial snippets - note this will need to contain HTML tags for formatting
	var arr = new Array(51);

	arr[0] = "Building an investment property on the other side of Australia was daunting, but thanks to your efforts it was painless.<br/><br/>&nbsp;&nbsp;&nbsp;- P &amp; L Abbott (4 January 2010)";
	arr[1] = "We would recommend Hayman to anyone who wants a professionally built home.<br/><br/>&nbsp;&nbsp;&nbsp;- R &amp; A Coleman (23 December 2009)";
	arr[2] = "I would like you to pass on our sincere thanks and congratulations to all at Hayman Homes for the outstanding service provided in the construction of this home.<br/><br/>&nbsp;&nbsp;&nbsp;- L &amp; A Hodgkins (14 December 2009)";
	arr[3] = "I would recommend (Hayman Homes) to anyone wanting to build in Queensland.<br/><br/>&nbsp;&nbsp;&nbsp;- K &amp; S Rodda (10 November 2009)";
	arr[4] = "All went so smoothly, quickly and professionally and it has been a privilege to deal with you all.<br/><br/>&nbsp;&nbsp;&nbsp;- L &amp; A Hodgkins (14 December 2009)";
	arr[5] = "You have a great company whom we have enjoyed building our investment property.<br/><br/>&nbsp;&nbsp;&nbsp;- K &amp; S Rodda (10 November 2009)";
	arr[6] = "We would build with Hayman Homes again. I would recommend them to all family and friends building investment properties.<br/><br/>&nbsp;&nbsp;&nbsp;- W Forbes &amp; S Paynter (4 November 2009)";
	arr[7] = "Very happy with the colour scheme. I liked how you could go online and take a look at colour schemes and some display homes.<br/><br/>&nbsp;&nbsp;&nbsp;- C &amp; M Luck (25 September 2009)";
	arr[8] = "I really appreciated being kept up to date with the construction progress and the photos I received.<br/><br/>&nbsp;&nbsp;&nbsp;- G &amp; C Phimphravichith (31 August 2009)";
	arr[9] = "We would recommend Hayman Homes to any other investor looking to build a quality home at a good price.<br/><br/>&nbsp;&nbsp;&nbsp;- C &amp; M Luck (25 September 2009)";
	arr[10] = "Very professional team. Everyone we dealt with was friendly, courteous, and very patient with first time builders.<br/><br/>&nbsp;&nbsp;&nbsp;- M &amp; C Harris (31 August 2009)";
	arr[11] = "Thankyou for making our first investment property building experience a pleasant and easy one.<br/><br/>&nbsp;&nbsp;&nbsp;- C &amp; M Luck (25 September 2009)";
	arr[12] = "The team at Hayman Homes looked after us from start to finish...<br/><br/>&nbsp;&nbsp;&nbsp;- M &amp; C Harris (31 August 2009)";
	arr[13] = "...we are very happy with the way Hayman Homes has helped us and communicated with us during construction.<br/><br/>&nbsp;&nbsp;&nbsp;- Graham A Carter and Patricia A Carter (10 August 2009)";
	arr[14] = "We would be more than happy to use Hayman Homes again; we would recommend them highly.<br/><br/>&nbsp;&nbsp;&nbsp;- M &amp; C Harris (31 August 2009)";
	arr[15] = "The team at Hayman Homes all provided excellent service.<br/><br/>&nbsp;&nbsp;&nbsp;- Gregory &amp; Kathryn Carpenter (12 July 2009)";
	arr[16] = "We will have no hesitation in recommending you to others.<br/><br/>&nbsp;&nbsp;&nbsp;- Graham A Carter and Patricia A Carter (10 August 2009)";
	arr[17] = "I would not hesitate to build with Hayman Homes.<br/><br/>&nbsp;&nbsp;&nbsp;- Gregory &amp; Kathryn Carpenter (12 July 2009)";
	arr[18] = "We have been very happy with the finish and quality of our investment home...<br/><br/>&nbsp;&nbsp;&nbsp;- Paul &amp; Maria Isaac (20 June 2009)";
	arr[19] = "Thankyou for your professional quality service.<br/><br/>&nbsp;&nbsp;&nbsp;- Gregory &amp; Kathryn Carpenter (12 July 2009)";
	arr[20] = "We are very impressed with the professionalism, attention to detail, communication and personal approach in our dealings with Hayman Homes...<br/><br/>&nbsp;&nbsp;&nbsp;- Paul &amp; Maria Isaac (20 June 2009)";
	arr[21] = "...I absolutely would recommend Hayman Homes to anyone and I will do so. The professionalism throughout the whole company is outstanding. Thankyou for the experience...<br/><br/>&nbsp;&nbsp;&nbsp;- P Malley (24 March 2009)";
	arr[22] = "Fantastic company to deal with.<br/><br/>&nbsp;&nbsp;&nbsp;- David &amp; Coby Ball (23 February 2009)";
	arr[23] = "Every query was dealt with efficiently, all calls were returned and nothing seemed too much to ask...<br/><br/>&nbsp;&nbsp;&nbsp;- P Malley (24 March 2009)";
	arr[24] = "...Would recommend to anyone wishing a top quality home built in quick time and no fuss.<br/><br/>&nbsp;&nbsp;&nbsp;- R D Coleman &amp; A M Coleman (24 December 2008)";
	arr[25] = "...it was immemsely re-assuring to have someone we felt was sincere and had integrity in their business dealings...<br/><br/>&nbsp;&nbsp;&nbsp;- Teresa &amp; Wayne Hackney (8 December 2008)";
	arr[26] = "...the quality was beyond our expectations.<br/><br/>&nbsp;&nbsp;&nbsp;- Margot Scott (4 August 2008)";
	arr[27] = "...our building inspector commended Hayman Homes for their workmanship...<br/><br/>&nbsp;&nbsp;&nbsp;- Teresa &amp; Wayne Hackney (8 December 2008)";
	arr[28] = "The finishing was excellent...<br/><br/>&nbsp;&nbsp;&nbsp;- Margot Scott (4 August 2008)";
	arr[29] = "...we wouldn't hesitate to recommend your company for any house or home constructions...<br/><br/>&nbsp;&nbsp;&nbsp;- Teresa &amp; Wayne Hackney (8 December 2008)";
	arr[30] = "...My customer experience in all my dealings with your staff have been fantastic. I realise Hayman Homes take pride in the quality of client services they provide...<br/><br/>&nbsp;&nbsp;&nbsp;- J A Palmero (22 July 2008)";
	arr[31] = "...The house looks fantastic; please pass on our heart felt thanks for a job well done to the staff and builders...<br/><br/>&nbsp;&nbsp;&nbsp;- Lance &amp; Belinda Clark (22 July 2008)";
	arr[32] = "...The project was completed on time and without delay. Thank you very much and all the best for the future! <br/><br/>&nbsp;&nbsp;&nbsp;- J A Palmero (22 July 2008)";
	arr[33] = "...I would highly recommend your company to anyone interested in having a house built.<br/><br/>&nbsp;&nbsp;&nbsp;- Lance &amp; Belinda Clark (22 July 2008)";
	arr[34] = "You went above and beyond the call of duty to get things done...<br/><br/>&nbsp;&nbsp;&nbsp;- S &amp; L Hodsdon (4 April 2008)";
	arr[35] = "Hayman Homes have recently built a new home for us which we are very pleased with. Throughout the whole process, the company was very easy to deal with...<br/><br/>&nbsp;&nbsp;&nbsp;- Chas &amp; Nikki Thompson (10 March 2008)";
	arr[36] = "...You did a great job! We were impressed with the high calibre of your staff - professional and friendly. They truly are customer focused...<br/><br/>&nbsp;&nbsp;&nbsp;- I Bates (27 February 2006)";
	arr[37] = "...In all respects, the HH team was responsive and their communication timely, clear and helpful...<br/><br/>&nbsp;&nbsp;&nbsp;- Chas &amp; Nikki Thompson (10 March 2008)";
	arr[38] = "...Your company's commitment to exceed customer expectations (and actually delivering on that promise) leaves us speechless and grateful...<br/><br/>&nbsp;&nbsp;&nbsp;- I Bates (27 February 2006)";
	arr[39] = "...I was impressed with the finish and quality of the house...<br/><br/>&nbsp;&nbsp;&nbsp;- Graeme Dwight (3 November 2005)";
	arr[40] = "...This was the most hassle-free and smoothest I have ever experienced in building houses...<br/><br/>&nbsp;&nbsp;&nbsp;- Dr John &amp; Mrs Cheryl Ann Coppola (12 September 2005)";
	arr[41] = "...The process has been incredibly smooth and we are extremely grateful to everyone that has been involved...<br/><br/>&nbsp;&nbsp;&nbsp;- Jeff &amp; Donna Scheel (18 April 2005)";
	arr[42] = "...I can recommend Hayman Homes 100% to build your home and or investment property...<br/><br/>&nbsp;&nbsp;&nbsp;- Dr John &amp; Mrs Cheryl Ann Coppola (12 September 2005)";
	arr[43] = "...the construction of the house has been of a very high standard and the various workmen we have met on site have all been friendly, courteous and helpful...<br/><br/>&nbsp;&nbsp;&nbsp;- Jeff &amp; Donna Scheel (18 April 2005)";
	arr[44] = "We thank you for an outstanding job done on our property...<br/><br/>&nbsp;&nbsp;&nbsp;- Alain &amp; Suzanne Langevin (13 September 2004)";
	arr[45] = "Just a note to say thank you for a wonderful job on our investment property and also for your kindness in going the extra mile...<br/><br/>&nbsp;&nbsp;&nbsp;- S &amp; D Rodighiero (7 September 2004)";
	arr[46] = "...We appreciate the fact that Hayman Homes responded so well to our requests...<br/><br/>&nbsp;&nbsp;&nbsp;- P &amp; J Northey (16 August 2004)";
	arr[47] = "...A reputable property agent and engineer who represents us conducted the final inspection on our behalf. In his feedback to us he said that he was very impressed with the finished product...<br/><br/>&nbsp;&nbsp;&nbsp;- Geoff &amp; Adell Delaney";
	arr[48] = "...we will only be too happy to recommend Hayman Homes in the future.<br/><br/>&nbsp;&nbsp;&nbsp;- P &amp; J Northey (16 August 2004)";
	arr[49] = "...we would be more than happy to chose Hayman Homes again when we build...<br/><br/>&nbsp;&nbsp;&nbsp;- Geoff &amp; Adell Delaney";
	arr[50] = "...your work is sincerely appreciated!<br/><br/>&nbsp;&nbsp;&nbsp;- Melissa Currey";

	var currentIndex = 0;

	// this function is run by the body onLoad event
	function getRandomTestimonial()
	{
		currentIndex = Math.floor(Math.random() * arr.length);
		setTestimonialIndex(currentIndex);
		document.getElementById("pNavButtons").style.visibility = "visible";
	}

	// called when they click on the Previous button
	function scrollBack()
	{
		currentIndex--;
		if (currentIndex < 0)
		{
			currentIndex = arr.length - 1;
		}
		setTestimonialIndex(currentIndex);
	}

	// called when they click on the Next button
	function scrollForward()
	{
		currentIndex++;
		if (currentIndex >= arr.length)
		{
			currentIndex = 0;
		}
		setTestimonialIndex(currentIndex);
	}

	// changes the content of the "pTestimonial" element
	function setTestimonialIndex(theNum)
	{
		var theText = arr[theNum];
		document.getElementById("pTestimonial").innerHTML = theText + "<!-- -->"; // the comment at the end is to stop IE6 being retarded
	}

/***************************************************
END TESTIMONIALS SECTION
***************************************************/

/***************************************************
BEGIN FORM VALIDATION SECTION
***************************************************/

	function Trim(trim_value)
	{
		if(trim_value.length < 1)
		{
			return "";
		}
		trim_value = RTrim(trim_value);
		trim_value = LTrim(trim_value);
		if(trim_value == "")
		{
			return "";
		}
		else
		{
			return trim_value;
		}
	}

	function RTrim(trim_value)
	{
		var w_space = String.fromCharCode(32);
		var v_length = trim_value.length;
		var strTemp = "";
		if(v_length < 0)
		{
			return "";
		}
		var iTemp = v_length -1;
		while(iTemp > -1)
		{
			if(trim_value.charAt(iTemp) == w_space)
			{
			}
			else
			{
				strTemp = trim_value.substring(0,iTemp +1);
				break;
			}
			iTemp = iTemp-1;
		}
		return strTemp;
	}

	function LTrim(trim_value)
	{
		var w_space = String.fromCharCode(32);
		if(v_length < 1)
		{
			return "";
		}
		var v_length = trim_value.length;
		var strTemp = "";
		var iTemp = 0;
		while(iTemp < v_length)
		{
			if(trim_value.charAt(iTemp) == w_space)
			{
			}
			else
			{
				strTemp = trim_value.substring(iTemp,v_length);
				break;
			}
			iTemp = iTemp + 1;
		}
		return strTemp;
	}

	function isValidEmail(email)
	{
		var valid = email.search( /^[^@]+@([-a-zA-Z0-9]+\.)+[-a-zA-Z0-9]{2,5}/ );
		if( valid == 0 )
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	function doSubmit()
	{
		var errMsg = "";
		var focusElement = null;
		var nameElement = document.forms[0].elements[0];
		var phoneElement = document.forms[0].elements[1];
		var emailElement = document.forms[0].elements[2];
		nameElement.value = Trim(nameElement.value);
		phoneElement.value = Trim(phoneElement.value);
		emailElement.value = Trim(emailElement.value);
		var v_name = nameElement.value;
		var v_phone = phoneElement.value;
		var v_email = emailElement.value;
		if (v_name.length < 1)
		{
			errMsg += " * Please enter your name.\n";
			focusElement = nameElement;
		}
		if ((v_phone.length < 1) && (v_email.length < 1))
		{
			errMsg += " * Please enter your phone number and/or email address, so that we can respond to your enquiry.\n";
			if (focusElement == null)
			{
				focusElement = phoneElement;
			}
		}
		if ((v_email.length > 0) && (!isValidEmail(v_email)))
		{
			errMsg += " * Please enter a valid email address.\n";
			if (focusElement == null)
			{
				focusElement = emailElement;
			}
		}
		if (errMsg.length > 0)
		{
			alert(errMsg);
		}
		else
		{
			document.forms[0].submit();
		}
	}

/***************************************************
END FORM VALIDATION SECTION
***************************************************/

function setHackneyTitleText(imageElement)
{
	var titleStr = "Dear Steve and Hayman Homes staff, We would like to take this opportunity to thank you for looking after us during the building of our house at Ipswich. After a difficult start (with our previous builders going into receivership), it was immensely reassuring to have someone we felt was sincere and had integrity in their business dealings. The continual communication from Hayman Homes at every stage of the development of our rental property further reinforced this. We would like to acknowledge Gary Eccleston for his construction management – our building inspector commended Hayman Homes for their workmanship and his 1 concern (re - fencing) was dealt with promptly and allowed for a smooth transition period for our tenants to move in. We would also like to acknowledge Hannah and her administrative staff for their prompt replies to our e-mails and phone calls and their flexibility in completing paperwork with us during the final stages when we weren't easily accessible. (Next G wasn't very friendly in many parts of Western Australia!!) Finally, we wouldn't hesitate to recommend your company for any house or home constructions. Yours sincerely, Teresa and Wayne Hackney.";
	if (navigator.userAgent.toLowerCase().indexOf("msie") > -1)
	{
		titleStr = "Dear Steve and Hayman Homes staff," + String.fromCharCode(10) + String.fromCharCode(10);
		titleStr += "We would like to take this opportunity to thank you for looking after us during the building of our house at Ipswich." + String.fromCharCode(10) + String.fromCharCode(10);
		titleStr += "After a difficult start (with our previous builders going into receivership), it was immensely reassuring to have someone we felt was sincere and had integrity in their business dealings. The continual communication from Hayman Homes at every stage of the development of our rental property further reinforced this...";
	}
	imageElement.title = titleStr;
}

function setHref(link)
{
	link.href = "mailto:sales@haymanhomes.com.au";
	return true;
}

function adjustDivHeight()
{
	var leftHeight = parseInt(document.getElementById("left").clientHeight);
	var rightHeight = parseInt(document.getElementById("right").clientHeight);
	if (leftHeight != rightHeight)
	{
		document.getElementById("right").style.height = leftHeight + "px";
		var innerDivHeight = document.getElementById("bRightColumnBox").style.height;
		if (innerDivHeight.length < 1)
		{
			innerDivHeight = "" + document.getElementById("bRightColumnBox").clientHeight;
		}
		innerDivHeight = parseInt(innerDivHeight.replace(/px/gi, ""));
		innerDivHeight = innerDivHeight + leftHeight - rightHeight;
		document.getElementById("bRightColumnBox").style.height = innerDivHeight + "px";
	}
	return true;
}

function pauseComp(millis)
{
	var date = new Date();
	var curDate = null;

	do
	{
		curDate = new Date();
	}
	while(curDate - date < millis);
}

function setWarningsVisible(showDivInfo, showDivBusyAnim, showDivJSWarning, showDivNoFlashWarning, showDivOldFlashWarning, showDivCheckAgain, showDivGetFlash, showDivContinue, showDivAllOkay)
{
	document.getElementById("divInfo").style.display = showDivInfo ? "block" : "none";
	document.getElementById("divBusyAnim").style.display = showDivBusyAnim ? "block" : "none";
	document.getElementById("divJSWarning").style.display = showDivJSWarning ? "block" : "none";
	document.getElementById("divNoFlashWarning").style.display = showDivNoFlashWarning ? "block" : "none";
	document.getElementById("divOldFlashWarning").style.display = showDivOldFlashWarning ? "block" : "none";
	document.getElementById("divCheckAgain").style.display = showDivCheckAgain ? "block" : "none";
	document.getElementById("checkAgainButton").style.display = showDivCheckAgain ? "block" : "none";
	document.getElementById("divGetFlash").style.display = showDivGetFlash ? "block" : "none";
	document.getElementById("divContinue").style.display = showDivContinue ? "block" : "none";
	document.getElementById("divAllOkay").style.display = showDivAllOkay ? "block" : "none";
}

function checkJSAndFlash()
{
	// first hide the JS warning - if we're here then JS is enabled
	document.getElementById("divJSWarning").style.display = "none";

	var cookieVal = getCookie("Flash_check_okay");
	if (cookieVal != null && cookieVal == "True")
	{
		document.location.href = "index2.htm";
	}

	// pause to let the user see what's going on
	var t = setTimeout("checkJSAndFlash2()", 1000);
}

function checkJSAndFlash2()
{
	// show the "check again" button
	document.getElementById("divCheckAgain").style.display = "block";

	// now check Flash
	var playerVersion = swfobject.getFlashPlayerVersion(); // returns a JavaScript object

	if (playerVersion != null && playerVersion.major > 0)
	{
		// check if it's at least Flash 8
		if (playerVersion.major > 7)
		{
			// all okay - show OK div and hide others
			setWarningsVisible(false, false, false, false, false, false, false, false, true);
			// set cookie
			setCookie("Flash_check_okay", "True", 30, "/", "", "");
			// pause to let the user see what's going on
			// redirect
			var t = setTimeout("document.location.href = 'index2.htm'", 1000);
		}
		else
		{
			// flash too old
			document.getElementById("flashVer").innerHTML = "" + playerVersion.major + "." + playerVersion.minor + "." + playerVersion.release;
			setWarningsVisible(false, false, false, false, true, true, true, true, false);
		}
	}
	else
	{
		// flash not installed
		setWarningsVisible(false, false, false, true, false, true, true, true, false);
	}
}

function popupFancyBox()
{
	var popupShown = getCookie("Popup_shown_today");
	if ((popupShown == null) || (popupShown != "True"))
	{
		$("a.fancybox").trigger("click");
		setCookie("Popup_shown_today", "True", 1, "/", "", "");
	}
}

// -->