
//this displays div if it's hidden and hides it if it's displayed
function showHideDiv(divName) {
	if (document.getElementById(divName).style.display=="block") {
		document.getElementById(divName).style.display="none";		
	} else {
		document.getElementById(divName).style.display="block";

	}
}

// shows div
function showDiv(divName) {
		document.getElementById(divName).style.display="block";
		if ((document.getElementById('topLink')  != "undefined" )&&(navigator.appName!="Microsoft Internet Explorer")&&(divName=='homeMenu1'||divName=='homeMenu2')) {
			document.getElementById('topLink').style.display="none";
		} 				
}

// hides div
function hideDiv(divName) {
		document.getElementById(divName).style.display="none";
		if (( document.getElementById('topLink') != "undefined" )&&(navigator.appName!="Microsoft Internet Explorer")&&(divName=='homeMenu1'||divName=='homeMenu2')) {
			document.getElementById('topLink').style.display="block";
		} 				
}

submitted=0;

function submitForm(formName) {

	if (submitted==0) {
		submitted=1;
		document.getElementById(formName).submit();
	}

}

function subscribeNewsletter(subForm) {
	// clear the fields if they still have the default values
	if (subForm.firstName.value == 'First name') {
		subForm.firstName.value = '';	
	}
	if (subForm.lastName.value == 'Last name') {
		subForm.lastName.value = '';	
	}
	if (subForm.email.value == 'Email address') {
		subForm.email.value = '';	
	}
	if (subForm.postcode.value == 'postcode') {
		subForm.postcode.value = '';	
	}
	
	// submit the form
	if (formCheckComplete(subForm)) { 
		subForm.submit();
	} else {
		subForm.firstName.value = 'First name';	
		subForm.lastName.value = 'Last name';	
		subForm.email.value = 'Email address';	
		subForm.postcode.value = 'postcode';	
	}
}

function expressInterest(eoiForm) {
	// clear the fields if they still have the default values
	if (eoiForm.firstName.value == 'First name') {
		eoiForm.firstName.value = '';	
	}
	if (eoiForm.lastName.value == 'Last name') {
		eoiForm.lastName.value = '';	
	}
	if (eoiForm.email.value == 'Email address') {
		eoiForm.email.value = '';	
	}
	if (eoiForm.phone.value == 'phone') {
		eoiForm.phone.value = '';	
	}
	if (eoiForm.message.value == 'message') {
		eoiForm.message.value = '';	
	}
	
	// submit the form
	if (formCheckComplete(eoiForm)) { 
		eoiForm.submit();
	} else {
		eoiForm.firstName.value = 'First name';	
		eoiForm.lastName.value = 'Last name';	
		eoiForm.email.value = 'Email address';	
		eoiForm.phone.value = 'phone';
		eoiForm.message.value = 'message';	
	}
}

function applyJob(jobForm) {
	if (jobForm.appName.value == 'Name') {
		jobForm.appName.value = '';	
	}
	if (jobForm.address1.value == 'Address') {
		jobForm.address1.value = '';	
	}
	if (jobForm.address2.value == 'Address') {
		jobForm.address2.value = '';	
	}
	if (jobForm.suburb.value == 'Suburb') {
		jobForm.suburb.value = '';	
	}
	if (jobForm.state.value == 'State') {
		jobForm.state.value = '';	
	}
	if (jobForm.postcode.value == 'Post Code') {
		jobForm.postcode.value = '';	
	}
	if (jobForm.phone.value == 'Phone No.') {
		jobForm.phone.value = '';	
	}
	if (jobForm.email.value == 'Email') {
		jobForm.email.value = '';	
	}
	// submit the form
	if (formCheckComplete(jobForm)) { 
		jobForm.submit();
	} else {
		if (jobForm.appName.value == '') {
			jobForm.appName.value = 'Name';	
		}
		if (jobForm.address1.value == '') {
			jobForm.address1.value = 'Address';	
		}
		if (jobForm.address2.value == '') {
			jobForm.address2.value = 'Address';	
		}
		if (jobForm.suburb.value == '') {
			jobForm.suburb.value = 'Suburb';	
		}
		if (jobForm.state.value == '') {
			jobForm.state.value = 'State';	
		}
		if (jobForm.postcode.value == '') {
			jobForm.postcode.value = 'Post Code';	
		}
		if (jobForm.phone.value == '') {
			jobForm.phone.value = 'Phone No.';	
		}
		if (jobForm.email.value == '') {
			jobForm.email.value = 'Email';	
		}
	}
}

function checkPropertyForm(propertyForm) {
	if (propertyForm.searchText.value == ' Keywords') {
		propertyForm.searchText.value = '';
	}
	propertyForm.submit();
}

function searchAgainDisplay() {
	if (document.getElementById('searchAgainLarge').style.display == 'none') {
		document.getElementById('searchAgainLarge').style.display = '';
		document.getElementById('searchAgainSmall').style.display = 'none';
	} else {
		document.getElementById('searchAgainLarge').style.display = 'none';
		document.getElementById('searchAgainSmall').style.display = '';
	}
}

function jobSearch(jobForm) {
	if (jobForm.searchText.value == ' Keyword') {
		jobForm.searchText.value = '';
	}
	jobForm.submit();
}

function volunteerSearch(volunteerForm) {
	if (volunteerForm.searchText.value == ' Keyword') {
		volunteerForm.searchText.value = '';
	}
	volunteerForm.submit();
}

function bequestEnquiry(beqForm) {
	if (beqForm.firstname.value == 'First Name') {
		beqForm.firstname.value = '';	
	}
	if (beqForm.lastname.value == 'Last Name') {
		beqForm.lastname.value = '';	
	}
	if (beqForm.suburb.value == 'Suburb') {
		beqForm.suburb.value = '';	
	}
	if (beqForm.state.value == 'State') {
		beqForm.state.value = '';	
	}
	if (beqForm.postcode.value == 'Post Code') {
		beqForm.postcode.value = '';	
	}
	if (beqForm.phone.value == 'Phone No.') {
		beqForm.phone.value = '';	
	}
	if (beqForm.email.value == 'Email') {
		beqForm.email.value = '';	
	}
	if (beqForm.message.value == 'Enquiry') {
		beqForm.message.value = '';	
	}
	if (formCheckComplete(beqForm)) { 
		beqForm.submit();
	} else {
		if (beqForm.firstname.value == '') {
			beqForm.firstname.value = 'First Name';	
		}
		if (beqForm.lastname.value == '') {
			beqForm.lastname.value = 'Last Name';	
		}
		if (beqForm.suburb.value == '') {
			beqForm.suburb.value = 'Suburb';	
		}
		if (beqForm.state.value == '') {
			beqForm.state.value = 'State';	
		}
		if (beqForm.postcode.value == '') {
			beqForm.postcode.value = 'Post Code';	
		}
		if (beqForm.phone.value == '') {
			beqForm.phone.value = 'Phone No.';	
		}
		if (beqForm.email.value == '') {
			beqForm.email.value = 'Email';	
		}
		if (beqForm.message.value == '') {
			beqForm.message.value = 'Enquiry';	
		}
	}
}

function listingOver(listingDiv,newBG,listNumber) {
	listingDiv.style.backgroundImage = newBG;
	document.getElementById('listHeading'+listNumber).style.textDecoration = 'underline';
	document.getElementById('listLink'+listNumber).style.color = 'white';
	document.getElementById('listArrow'+listNumber).src = '/images/whiteArrow.jpg';
}

function listingOut(listingDiv,newBG,listNumber) {
	listingDiv.style.backgroundImage = newBG;
	document.getElementById('listHeading'+listNumber).style.textDecoration = 'none';
	document.getElementById('listLink'+listNumber).style.color = '#1E3B79';
	document.getElementById('listArrow'+listNumber).src = '/images/blueArrow.gif';
}

function prevDark(prevImage) {
		prevImage.src = '/images/prevDark.gif';
}

function prevLight(prevImage) {
		prevImage.src = '/images/prevLight.gif';
}

function nextDark(nextImage) {
		nextImage.src = '/images/nextDark.gif';
}

function nextLight(nextImage) {
		nextImage.src = '/images/nextLight.gif';
}

