SetSearchTextToFocus();CheckQueryStringForSearch();function CheckQueryStringForSearch(){var b=queryString("keywordsAccomm");if(b!=null&&b.length>0&&b!="false"){var a=document.getElementById("searchtxt");if(a!=null){a.value=b;a.style.color="black";a.style.fontStyle="normal"}}}function SetSearchTextToFocus(){var a=document.getElementById("searchtxt");if(a!=null){a.focus();a.value=a.value;a.style.color="#808080";a.style.fontStyle="italic"}}function ClearDefaultSearch(){var a=document.getElementById("searchtxt");if(a!=null){if(a.value=="<Auckland Hotels/Motels>"){a.value="";a.style.color="black";a.style.fontStyle="normal"}}}function QuickSearchFromEnterKey(a){ClearDefaultSearch();if(a.keyCode==13){QuickSearchAcc()}}function ButtonMouseIn(){var a=document.getElementById("A1");if(a!=null){a.src="../../../../Content/Images/Site/go-btn-rollover.png"}}function ButtonMouseOut(){var a=document.getElementById("A1");if(a!=null){a.src="../../../../Content/Images/Site/go-btn-normal.png"}}function QuickSearchAcc(){var b=new Date();b.setDate(b.getDate()+7);if(document.getElementsByName("keywordsAccommQuickSearch").item("keywordsAccommQuickSearch").value.length>0){var a="http://www.roomsdirect.co.nz/accommodation?exl_dn=RoomsDirect&exl_mod=accomm&categoryGrouping=accomm&commencingDayAccomm="+b.getDate().toString()+"&commencingMonthAccomm="+b.getFullYear().toString()+" "+(b.getMonth()+1).toString()+"&adultsAccomm=1&nightsAccomm=0&childrenAccomm=0&concessionsAccomm=0&regionAccomm=&exl_expanded=true&classificationAccomm=&nameAccomm=&keywordsAccomm="+document.getElementsByName("keywordsAccommQuickSearch").item("keywordsAccommQuickSearch").value+"&source=quicksearch";window.location=a}else{alert("Please enter your search")}}function queryString(b){var a=window.location.search;var c=new PageQuery(a);return unescape(c.getValue(b))}function PageQuery(b){if(b.length>1){this.q=b.substring(1,b.length)}else{this.q=null}this.keyValuePairs=new Array();if(b){for(var a=0;a<this.q.split("&").length;a++){this.keyValuePairs[a]=this.q.split("&")[a]}}this.getKeyValuePairs=function(){return this.keyValuePairs};this.getValue=function(d){for(var c=0;c<this.keyValuePairs.length;c++){if(this.keyValuePairs[c].split("=")[0]==d){return this.keyValuePairs[c].split("=")[1]}}return false};this.getParameters=function(){var c=new Array(this.getLength());for(var d=0;d<this.keyValuePairs.length;d++){c[d]=this.keyValuePairs[d].split("=")[0]}return c};this.getLength=function(){return this.keyValuePairs.length}};