function toggleSearch(div) {
	if (div == 'search_student_form_container') {
		document.getElementById('search_student_form_container').className = 'w63_show';
		document.getElementById('li_student').getElementsByTagName('a')[0].id = 'activeTab';

		document.getElementById('search_professional_form_container').className = 'w63_hide';
		document.getElementById('li_professional').getElementsByTagName('a')[0].id = '';

		document.getElementById('search_rooms_form_container').className = 'w63_hide';
		document.getElementById('li_rooms').getElementsByTagName('a')[0].id = '';
	}
	else if (div == 'search_professional_form_container') {
		document.getElementById('search_student_form_container').className = 'w63_hide';
		document.getElementById('li_student').getElementsByTagName('a')[0].id = '';

		document.getElementById('search_professional_form_container').className = 'w63_show';
		document.getElementById('li_professional').getElementsByTagName('a')[0].id = 'activeTab';

		document.getElementById('search_rooms_form_container').className = 'w63_hide';
		document.getElementById('li_rooms').getElementsByTagName('a')[0].id = '';
	}
	else {
		document.getElementById('search_student_form_container').className = 'w63_hide';
		document.getElementById('li_student').getElementsByTagName('a')[0].id = '';

		document.getElementById('search_professional_form_container').className = 'w63_hide';
		document.getElementById('li_professional').getElementsByTagName('a')[0].id = '';

		document.getElementById('search_rooms_form_container').className = 'w63_show';
		document.getElementById('li_rooms').getElementsByTagName('a')[0].id = 'activeTab';
	}
}

formCount = 1;
function addStudentTenantForm() {
	++formCount;

	var newForm = '<hr/><h2>TENANT ' + formCount + ' DETAILS</h2>';

	// Tenant Details
	newForm += '<fieldset class="inlineblock"><legend>Tenant ' + formCount + ' Details</legend>';
	newForm += '<p><label for="tenant' + formCount + '_name">Name:</label><input type="text" name="tenant' + formCount + '_name" id="tenant' + formCount + '_name" value=""/></p>';
	newForm += '<p><label for="tenant' + formCount + '_email">Email:</label><input type="text" name="tenant' + formCount + '_mobile" id="tenant' + formCount + '_mobile" value=""/></p>';
	newForm += '<p><label for="tenant' + formCount + '_mobile">Mobile Number:</label><input type="text" name="tenant' + formCount + '_mobile" id="tenant' + formCount + '_mobile" value=""/></p>';
	newForm += '<p><label for="tenant' + formCount + '_dob">Date of Birth:</label><input type="text" name="tenant' + formCount + '_dob" id="tenant' + formCount + '_dob" value=""/></p>';
	newForm += '<p><label for="tenant' + formCount + '_university">University:</label><input type="text" name="tenant' + formCount + '_university" id="tenant' + formCount + '_university" value=""/></p>';
	newForm += '<p><label for="tenant' + formCount + '_course">Course Studying:</label><input type="text" name="tenant' + formCount + '_course" id="tenant' + formCount + '_course" value=""/></p>';
	newForm += '<p><label for="tenant' + formCount + '_yearOfStudy">Year of Study:</label><input type="text" name="tenant' + formCount + '_yearOfStudy" id="tenant' + formCount + '_yearOfStudy" value=""/></p>';
	newForm += '<p><label for="tenant' + formCount + '_nextOfKin">Next of Kin:</label><input type="text" name="tenant' + formCount + '_nextOfKin" id="tenant' + formCount + '_nextOfKin" value=""/></p>';
	newForm += '<p><label for="tenant' + formCount + '_nextOfKinMobile">Next of Kin Mobile Number:</label><input type="text" name="tenant' + formCount + '_nextOfKinMobile" id="tenant' + formCount + '_nextOfKinMobile" value=""/></p>';
	newForm += '<p><label for="tenant' + formCount + '_pets">Do you have any pets?</label><input type="text" name="tenant' + formCount + '_pets" id="tenant' + formCount + '_pets" value=""/></p>';
	newForm += '</fieldset>';

	// Current Address
	newForm += '<fieldset class="inlineblock"><legend>Current Address: Tenant ' + formCount + '</legend>';
	newForm += '<p><label for="tenant' + formCount + '_currentAddress">Current Address:</label><textarea name="tenant' + formCount + '_currentAddress" id="tenant' + formCount + '_currentAddress" rows="5" cols="20" style="width: 360px; vertical-align: top; margin-bottom: 5px;"></textarea></p>';
	newForm += '<p><label for="tenant' + formCount + '_currentRent">Rent (per calendar month):</label><input type="text" name="tenant' + formCount + '_currentRent" id="tenant' + formCount + '_currentRent" value=""/></p>';
	newForm += '</fieldset>';

	// Current Landlord
	newForm += '<fieldset class="inlineblock"><legend>Current Landlord: Tenant ' + formCount + '</legend>';
	newForm += '<p><label for="tenant' + formCount + '_landlord">Current Landlord / Agent:</label><input type="text" name="tenant' + formCount + '_landlord" id="tenant' + formCount + '_landlord" value=""/></p>';
	newForm += '<p><label for="tenant' + formCount + '_landlordNumber">Contact Number:</label><input type="text" name="tenant' + formCount + '_landlordNumber" id="tenant' + formCount + '_landlordNumber" value=""/></p>';
	newForm += '</fieldset>';

	// Guarantor Details
	newForm += '<fieldset class="inlineblock"><legend>Guarantor Details: Tenant ' + formCount + '</legend>';
	newForm += '<p><label for="tenant' + formCount + '_guarantor">Name of guarantor:</label><input type="text" name="tenant' + formCount + '_guarantor" id="tenant' + formCount + '_guarantor" value=""/></p>';
	newForm += '<p><label for="tenant' + formCount + '_guarantorEmail">Guarantors email address:</label><input type="text" name="tenant' + formCount + '_guarantorEmail" id="tenant' + formCount + '_guarantorEmail" value=""/></p>';
	newForm += '<p><label for="tenant' + formCount + '_guarantorAddress">Guarantors address:</label><textarea name="tenant' + formCount + '_guarantorAddress" id="tenant' + formCount + '_guarantorAddress" rows="5" cols="20" style="width: 360px; vertical-align: top; margin-bottom: 5px;"></textarea></p>';
	newForm += '<p><label for="tenant' + formCount + '_guarantorTel">Guarantor Telephone:</label><input type="text" name="tenant' + formCount + '_guarantorTel" id="tenant' + formCount + '_guarantorTel" value=""/></p>';
	newForm += '</fieldset>';

	document.getElementById('tenant_add').innerHTML += newForm;
}
