function apply_filters(){ var v = new RegExp(); v.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$"); if (v.test(document.getElementById("filter_interests").value)) { window.location = unescape(document.getElementById("filter_interests").value); return; } if(document.getElementById("filter_country")) c=document.getElementById("filter_country").value; if(document.getElementById("filter_bedrooms")) bed=document.getElementById("filter_bedrooms").value; else bed=''; if(document.getElementById("filter_sleeps")) bath=document.getElementById("filter_sleeps").value; else bath=''; if(document.getElementById("filter_rates")) rate=document.getElementById("filter_rates").value; else rate=''; if(document.getElementById("filter_interests")) interests=document.getElementById("filter_interests").value; else interests=''; if(c==0) { if(!interests) window.location = 'http://www.findrentals.com/regions/37_1/' + c + '/' + bed + '/' + bath + '/' + rate + '/'; else window.location = 'http://www.findrentals.com/' + interests + '/regions/37_1/' + c + '/' + bed + '/' + bath + '/' + rate + '/'; return; } else { if(document.getElementById("subregion_selected")) { if(!interests) window.location = 'http://www.findrentals.com/regions/' + c + '_1/' + '/' + bed + '/' + bath + '/' + rate + '/'; else window.location = 'http://www.findrentals.com/' + interests + '/regions/' + c + '_1/' + '/' + bed + '/' + bath + '/' + rate + '/'; return; } if(document.getElementById("state_selected")) { if(!interests) window.location = 'http://www.findrentals.com/state/' + c + '_1/' + '/' + bed + '/' + bath + '/' + rate + '/'; else window.location = 'http://www.findrentals.com/' + interests + '/state/' + c + '_1/' + '/' + bed + '/' + bath + '/' + rate + '/'; return; } } if(!interests) window.location = 'http://www.findrentals.com/city/' + c + '_1//' + bed + '/' + bath + '/' + rate + '/'; else window.location = 'http://www.findrentals.com/' + interests + '/city/' + c + '_1//' + bed + '/' + bath + '/' + rate + '/'; }