function pageLoad(){PageLoadFunctions.Execute()}function onLoad(){$(".grid tr.gridRow, .grid tr.gridAltItem").unbind("keypress",onGridItemKeypress);$(".grid tr.gridRow, .grid tr.gridAltItem").keypress(onGridItemKeypress);$('a[data-toggle="tab"]').on("shown.bs.tab",onTabShown);$(".tabs a").unbind("click",onTabClick);$(".tabs a").click(onTabClick)}function onTabShown(){var i,n,r,t;localStorage.setItem(getTabKey(),$(this).attr("href"));i=$(".tab-pane.active").find("#map_canvas");i.length>0&&(n=GoogleMaps.map,n.center&&(r=n.getCenter(),t=n.getZoom(),google.maps.event.trigger(n,"resize"),n.setZoom(t===0?4:t),n.setCenter(r)))}function onTabClick(n){n.preventDefault();$(this).tab("show")}function getTabKey(){return getPageName()+"_selectedTab"}function getPageName(){var n=location.pathname.split("/").slice(-1),t=n[0].split(".").slice(0,1);return t[0]}function showTabPane(n){localStorage.setItem(getTabKey(),"#"+n)}function hideTab(n){$('.tabs [href="#'+n+'"]').tab().hide()}function clearTabCache(){localStorage.clear()}function onGridItemKeypress(n){var t=n.keyCode?n.keyCode:n.which;t==13&&this.click()}function map(n){this.img=new Image(99,94);this.src=n;this.img.src=n}function ChangeStateFromMap(n){n==null&&(n=0);($get("ddlCourseLocation").options[n].selected=!0)&&($("img[name=StateMap]")[0].src=maps[n].src);$get("ddlCourseLocation").focus()}function ChangeState(n){StateIndex=n.selectedIndex;(n.options[StateIndex].selected=!0)&&($("img[name=StateMap]")[0].src=maps[StateIndex].src);n.focus()}function getUrl(n){return window.location.host=="localhost"?"/CRICOS/"+(n.indexOf("/")==0?n.substring(1):n):n}function loadScript(n,t){var i=document.createElement("script");i.type="text/javascript";i.src=n;document.body.appendChild(i);t!=null&&$(i).load(t)}function MarkerPopup(n,t){var i=new google.maps.InfoWindow({content:"<br/><b>"+t.ProviderName+"<\/b><br/><p/>Contact Address:<br/>"+t.AddressLine1+(t.AddressLine2==""?"":"<br/>"+t.AddressLine2)+(t.AddressLine3==""?"":"<br/>"+t.AddressLine3)+(t.AddressLine4==""?"":"<br/>"+t.AddressLine4)+"<br/>"+t.Locality+" "+t.Postcode+"<p/>Phone: "+t.Phone+"<br/>Fax: "+t.Fax});i.open(GoogleMaps.map,n)}function Tooltip(n){this.map_=n.map;this.title_=n.title;this.latlng_=n.latlng;this.div_=null;this.setMap(this.map_)}function InitialiseTooltips(){Tooltip.prototype=new google.maps.OverlayView;Tooltip.prototype.onAdd=function(){var t=this.getPanes(),n=this.div_;n||(n=this.div_=$("<div><\/div>").addClass("tooltip").appendTo(t.floatPane).get(0),$("<span><\/span>").html(this.title_).appendTo(n))};Tooltip.prototype.onRemove=function(){this.div_&&$(this.div_).fadeOut("slow")};Tooltip.prototype.draw=function(){if(this.div_){var n=this.getProjection().fromLatLngToDivPixel(this.latlng_);n&&(this.div_.style.left=n.x-this.div_.offsetWidth/2+"px",this.div_.style.top=n.y-this.div_.offsetHeight-35+"px")}}}var PageLoadFunctions=function(){var n=[],t=function(t){$.inArray(t,n)<0&&n.push(t)},i=function(){for(var t=0;t<n.length;t++)n[t].call()};return{Add:t,Execute:i}}(),maps,GoogleMaps;$(document).ready(function(){$("#skipNav").click(function(){$("#Content").focus()});var n=localStorage.getItem(getTabKey());n&&$('.tabs [href="'+n+'"]').tab("show")});PageLoadFunctions.Add(onLoad);maps=[new map("../Images/Maps/aust.gif"),new map("../Images/Maps/act.gif"),new map("../Images/Maps/nsw.gif"),new map("../Images/Maps/NT.gif"),new map("../Images/Maps/QLD.gif"),new map("../Images/Maps/SA.gif"),new map("../Images/Maps/TAS.gif"),new map("../Images/Maps/VIC.gif"),new map("../Images/Maps/WA.gif")];GoogleMaps={callback:function(){},map:{},markers:{marker:[],data:{}},marker:function(n,t){this.marker=n;this.data=t},clearOverlays:function(){for(i in this.markers)this.markers[i].marker.setMap(null);this.markers=[]},loadMap:function(n){this.callback=n;var t=$("input[id$='hidGoogleMapsUrl']").val();loadScript(t)},initialise:function(){InitialiseTooltips();this.callback()},createMap:function(n){var t={zoom:4,center:new google.maps.LatLng(-28,135),mapTypeControl:!0,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},navigationControl:!0,navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL},mapTypeId:google.maps.MapTypeId.ROADMAP};this.markers=[];this.map=new google.maps.Map(document.getElementById(n),t)},markerRequest:function(n,t){this.clearOverlays();$.ajax({type:"POST",url:n,data:t,contentType:"application/json; charset=utf-8",dataType:"json",success:this.markerResponse,failure:function(){}})},markerResponse:function(n){var i=new google.maps.LatLngBounds,t=n.d;if($.each(t,function(n,t){var u,r,f;if(this.Latitude==""||this.Longitude==""||this.Latitude>90||this.Latitude<-90||this.Longitude>180||this.Longitude<-180)return!0;u=new google.maps.LatLng(this.Latitude,this.Longitude);r=new google.maps.Marker({map:GoogleMaps.map,position:u,visible:!0});google.maps.event.addListener(r,"click",function(){MarkerPopup(r,t)});google.maps.event.addListener(r,"mouseover",function(){f=new Tooltip({latlng:r.getPosition(),map:GoogleMaps.map,title:t.ProviderName})});google.maps.event.addListener(r,"mouseout",function(){f.setMap(null)});GoogleMaps.markers.push(new GoogleMaps.marker(r,t));i.extend(u)}),GoogleMaps.markers.length==0)return!0;t.length==1?(GoogleMaps.map.setZoom(15),GoogleMaps.map.panTo(GoogleMaps.markers[0].marker.getPosition())):t.length>1&&GoogleMaps.map.fitBounds(i);google.maps.event.trigger(GoogleMaps.map,"resize")}}