function submit_search() { //practitioner search if(document.getElementById('search_category_list') != null) { var form = document.practitioner_form; //change the syntax for search practice for select menu var search_practice = document.getElementById("search_category_list"); var search_practice_val = search_practice.options[search_practice.selectedIndex].value; if(search_practice_val == '') { alert('Please select a therapy'); return false; } else { form.submit(); } } //school search else if(document.getElementById('search_course_list') != null) { var search_type = 'course'; var form = document.school_form; var search_practice = document.getElementById("search_course_list"); var search_practice_val = search_practice.options[search_practice.selectedIndex].value; if(search_practice_val == '') { alert('Please select a course'); return false; } else if(jQuery('.predictive_lookup_associate').val() == '' || jQuery('.predictive_lookup_associate').val() == 'Enter Suburb or Postcode') { alert('Please enter a suburb or valid postcode for the search'); return false; } else { form.submit(); } } //positions vacant search else if(document.getElementsByName('just_postcode_submit') != null) { var form = document.search_rooms; if(jQuery('.predictive_lookup_associate').val() == '' || jQuery('.predictive_lookup_associate').val() == 'Enter Suburb or Postcode') { alert('Please enter a suburb or valid postcode for the search'); return false; } else { form.submit(); } } } jQuery(document).ready(function() { setTimeout(function () { var default_zip_value, currentObj, default_txt, ele_id; var VTKAutoCompleteInstances = new Array(); jQuery('.predictive_lookup_associate').each(function(){ //Check for multiple ID's, and then change them where appropriate. var ele_id = Math.floor(Math.random()*100001) + 'lookup'; jQuery(this).attr('id', ele_id); default_txt = $(this).val(); if(jQuery('#search_category_list').length > 0) { default_zip_value = 'All States'; } else { default_zip_value = 'Enter Suburb or Postcode'; } VTKAutoCompleteInstances.push(new VTKAutoComplete()); currentObj = VTKAutoCompleteInstances[VTKAutoCompleteInstances.length-1]; currentObj.init( { "queryFieldId": jQuery(this).attr('id'), "queryFieldHelpInfo": default_zip_value, "initValue": default_txt, "lookupURLPrefix": "/system/ajax_handlers/vtk.ac.search.zip.server.php?query=", "formName":this.form.name, "formAutoSubmit": false, "FixedWidth": 240, "Alignment": "left", "otherFieldName": "search_where", "otherFieldValue": "where", "hiddenDivId": "ntp_search_zip_suggests" }); currentObj.vtc_ac_after_select_handler = function (value, text){ setTimeout(function () {submit_search();}, 500); } currentObj.vtc_ac_onlick_handler = function (value, text){ //This is used on the NTP room to rent page - NTPAU-246 if ($('#' + ele_id).hasClass('just_postcode_submit')) { //need to strip out postcode, and just submit the suburb text value = value.replace(/[^0-9]/g,''); $('#' + ele_id).val(value); $('#ntp_search_zip_suggests').hide(); } else { $('#' + ele_id).val(value); } } currentObj.vtc_ac_keytab_handler = function () { jQuery('.btn_search').focus(); } currentObj.vtc_ac_keyenter_handler = function () { submit_search(); } }); },0); jQuery('.predictive_lookup_associate').blur(function(event) { if (jQuery('#search_category_list').length <= 0 && (jQuery('.predictive_lookup_associate').val() == '' || jQuery('.predictive_lookup_associate').val() == 'Enter Suburb or Postcode')) { jQuery('.predictive_lookup_associate').css({'color':'#999','font-weight':'normal'}); } }); jQuery(".predictive_lookup_associate").keypress(function(event) { //if pressed enter on the postcode field, go to validate and submit form jQuery(this).css({'color':'#333','font-weight':'bold'}); if (event.which == '13') { submit_search(); } }); /* end of functions */ jQuery('.predictive_lookup_associate').focus(function () { jQuery('.predictive_lookup_associate').select().mouseup(function (e) { e.preventDefault(); jQuery(this).unbind("mouseup"); }); }); jQuery(".stopBubblingUpOnClick").click(function (e){ if (e && e.stopPropagation) //if stopPropagation method supported e.stopPropagation(); else event.cancelBubble=true; }); jQuery(".search_practice").select(function(event) { //if pressed enter on the postcode field, go to validate and submit form if (event.which == '13') { document.practitioner_form.search_zip.focus(); return false; } }); }); function hoverState(site_id, mouse_status, element) { if (element == 'email_enquiry') { if(mouse_status == 'over') { jQuery('#email_enquiry_'+site_id+' span').removeClass('sprite_enquiry').addClass('sprite_enquiry_hover'); } else if(mouse_status == 'out') { jQuery('#email_enquiry_'+site_id+' span').removeClass('sprite_enquiry_hover').addClass('sprite_enquiry'); } } else if(element == 'email_quote') { if(mouse_status == 'over') { jQuery('#email_quote_'+site_id+' span').removeClass('sprite_quote').addClass('sprite_quote_hover'); } else if(mouse_status == 'out') { jQuery('#email_quote_'+site_id+' span').removeClass('sprite_quote_hover').addClass('sprite_quote'); } } } function showDistanceInfoPopup(element_id, popup_id) { var distance_info_message = '

Why does the postcode search show me all the therapists/schools in the country?

'; distance_info_message += '

ntpages.com.au shows all the therapists/schools in the database for the category selected in order of distance from the entered postcode. ntpages.com.au uses a postcode spiral technique to rank the therapists/schools in the search results.

This means that the therapists/schools on the first page will be closest to the postcode entered, and the therapists/schools on the last page will be be the farthest.

'; jQuery("#"+popup_id).remove(); var distance_info_popup = new clsLightPopup(); distance_info_popup.publicFunctions.construct(distance_info_popup, { pageElements:{ container:"#search_results_wrapper", position:"#"+element_id }, height:"auto", width:"400px", offsetLeft:-430, offsetTop:-30, identifier:popup_id, alternative_style_class:" shadow bordered", close_image:"transparent url(/style/default/images/fancy_box/fancy_closebox.png) repeat scroll 0 0", raw_content:distance_info_message }); distance_info_popup.publicFunctions.loadData(distance_info_popup, function(data) { distance_info_popup.publicFunctions.show(distance_info_popup); }); }