');
}
function IncludeGoogleAnalyticsJavaScript()
{
IncludeJavaScript('http://www.google-analytics.com/urchin.js');
document.write(' ');
}
function set_action(new_action) {
var d = document.search;
d.action = new_action;
//getMultiple();
d.submit();
}
function catch_return(evt) {
evt = (evt) ? evt : event;
var charCode = (evt.charCode) ? evt.charCode :
((evt.which) ? evt.which : evt.keyCode);
if (charCode == 13 || charCode == 3) {
set_action('fast_search.php');
}
}
function region_click(clicked_region) {
var d = document.search;
var i;
if (document.getElementById(clicked_region).style.display == "none") {
if(d.region.value == "") {
d.region.value = clicked_region;
} else {
d.region.value += "," + clicked_region;
}
//alert(d.region.value);
document.getElementById("No regions").style.display = "none";
document.getElementById(clicked_region).style.display = "block";
} else {
re_no_comma = new RegExp(clicked_region);
re_comma = new RegExp("," + clicked_region);
d.region.value = d.region.value.replace(re_comma , "");
d.region.value = d.region.value.replace(re_no_comma , "");
//alert(d.region.value);
document.getElementById(clicked_region).style.display = "none";
}
}
function region_focus(clicked_region) {
var d = document.search;
var count;
var display_string;
if(clicked_region == "Mornington") {
count = 0;
if (count == 0) {
display_string = "No rooms in Mornington Peninsula";
} else if (count == 1) {
display_string = "0 room in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "Geelong & Coast") {
count = 0;
if (count == 0) {
display_string = "No rooms in Geelong & Coast";
} else if (count == 1) {
display_string ="0 room in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "Outer West") {
count = 0;
if (count == 0) {
display_string = "No rooms in Outer West";
} else if (count == 1) {
display_string = "0 room in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "Inner East") {
count = 0;
if (count == 0) {
display_string = "No rooms in Inner East";
} else if (count == 1) {
display_string = "0 room in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "East") {
count = 2;
if (count == 0) {
display_string = "No rooms in East";
} else if (count == 1) {
display_string ="2 room in Burwood East, Mount Waverley";
} else {
display_string ="2 rooms in Burwood East, Mount Waverley";
}
} else if(clicked_region == "Dandenong Ranges") {
count = 0;
if (count == 0) {
display_string = "No rooms in Dandenong Ranges";
} else if (count == 1) {
display_string ="0 room in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "Bayside") {
count = 0;
if (count == 0) {
display_string = "No rooms in Bayside";
} else if (count == 1) {
display_string ="0 room in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "Inner South East") {
count = 0;
if (count == 0) {
display_string = "No rooms in Inner South East";
} else if (count == 1) {
display_string ="0 room in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "Outer South East") {
count = 0;
if (count == 0) {
display_string = "No rooms in Outer South East";
} else if (count == 1) {
display_string ="0 room in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "Inner North") {
count = 0;
if (count == 0) {
display_string = "No rooms in Inner North";
} else if (count == 1) {
display_string ="0 room in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "North") {
count = 0;
if (count == 0) {
display_string = "No rooms in North";
} else if (count == 1) {
display_string ="0 room in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "Outer North") {
count = 0;
if (count == 0) {
display_string = "No rooms in Outer North";
} else if (count == 1) {
display_string ="0 room in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "Inner West") {
count = 0;
if (count == 0) {
display_string = "No rooms in Inner West";
} else if (count == 1) {
display_string ="0 room in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "West") {
count = 0;
if (count == 0) {
display_string = "No rooms in West";
} else if (count == 1) {
display_string ="0 rooms in ";
} else {
display_string ="0 rooms in ";
}
} else if(clicked_region == "Melbourne") {
count = 0;
if (count == 0) {
display_string = "No rooms in Melbourne";
} else if (count == 1) {
display_string ="0 rooms in ";
} else {
display_string ="0 rooms in ";
}
}
document.getElementById("found_suburbs").innerHTML = display_string ;
}
function region_blur(clicked_region) {
var d = document.search;
var i;
document.getElementById("found_suburbs").innerHTML = "
";
}
function toUpper(str) {
var pattern = /(\w)(\w*)/; // a letter, and then one, none or more letters
var a = str.split(/\s+/g); // split the sentence into an array of words
for (i = 0 ; i < a.length ; i ++ ) {
var parts = a[i].match(pattern); // just a temp variable to store the fragments in.
var firstLetter = parts[1].toUpperCase();
var restOfWord = parts[2].toLowerCase();
a[i] = firstLetter + restOfWord; // re-assign it back to the array and move on
}
return a.join(' '); // join it back together
}
function getMultiple() { // purge arrays/variables
// init arrays/variables
var arSelected = new Array();
var arSelectedIdx = new Array();
var selectedLst = ""; // loop through the select list
d = document.search;
ob = d.region_select;
arSelected = [];
arSelectedIdx = [];
while (ob.selectedIndex != -1) { // append current selected value into the array
arSelected.push(ob.options[ob.selectedIndex].value); // append current selected
// index into the array
arSelectedIdx.push(ob.selectedIndex); // save the current value into a list variable;
// separate values with commas
if (selectedLst == "") {
selectedLst = selectedLst + ob.options[ob.selectedIndex].value;
} else {
selectedLst = selectedLst + "," + ob.options[ob.selectedIndex].value;
} // set the current selected value to false (for the benefit of this loop)
ob.options[ob.selectedIndex].selected = false;
} // loop through the array containing the selected indexes...
for (idx = 0; idx < arSelectedIdx.length; idx++) { // re-select the items that were
// unselected in the while loop
ob.options[arSelectedIdx[idx]].selected = true;
} // store the current list of selected items into a hidden form variable document.frmSelect.numbers_string.value = selectedLst;
d.region.value = selectedLst;
}
function do_focus() { //this is the stub that takes care of focus
var d = document.search;
if (d.suburb.value=='All Suburbs'){
d.suburb.value='';
}
}
//this is the stub that takes care of focus - THIS IS NOT ACTUALLY USED
function do_keypress() {
catch_return(evt);
}
//-->