var map; var loader; var mappoint; var localSearch = new GlocalSearch(); var icon = new GIcon(); icon.image = "http://www.google.com/mapfiles/marker.png"; icon.shadow = "http://www.google.com/mapfiles/shadow50.png"; icon.iconSize = new GSize(20, 34); icon.shadowSize = new GSize(37, 34); icon.iconAnchor = new GPoint(10, 34); function usePointFromPostcode(a, b) { localSearch.setSearchCompleteCallback(null, function() { if (localSearch.results[0]) { var c = localSearch.results[0].lat; var e = localSearch.results[0].lng; var d = new GLatLng(c, e); b(d); loader.style.display = "none" } else { alert("Postcode not found!") } }); localSearch.execute(a + ", UK") } function setCenterToPoint(a) { var b = new GMarker(a, icon); map.addOverlay(b); map.setCenter(a, 14); mappoint = a } function mapLoad(b, a) { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById(b)); loader = document.getElementById(a); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(54.622978, -2.592773), 5, G_NORMAL_MAP) } } function addUnLoadEvent(a) { var b = window.onunload; if (typeof window.onunload != "function") { window.onunload = a } else { window.onunload = function() { b(); a() } } } addUnLoadEvent(GUnload); function setupListing() { $("div.tabs").children("div.tab_container").children("div.tab_content").hide(); $("div.tabs").children("ul.tabs").children("li:first").addClass("active").show(); $("div.tabs").children("div.tab_container").children("div.tab_content:first").show(); $("ul.tabs li").click(function() { var a = $(this).parents("ul").parents("div"); a.children("ul.tabs").children("li").removeClass("active"); $(this).addClass("active"); a.children(".tab_container").children(".tab_content").hide(); var b = $(this).find("a").attr("href"); $(b).fadeIn("slow"); return false }); $("div.more").html("Business Information ▼"); $("div.more").click(function() { var e = $(this).parents("div.RoundedBoxInner").find("div.expander"); var d = e.is(":hidden"); $("div.more").html("Business Information ▼"); $("div.expander").hide("fast"); $("div.companies").find("div.company").removeClass("selectedCompany"); if (d) { e.parents("div.RoundedBoxInner").parents("div.company").addClass("selectedCompany"); e.show("fast"); $(this).html("Business Information ▲"); if (!($(this).is(".mapLoaded"))) { $(this).parents("div").children("div.expander").children("div.tabs").children("ul.tabs").children("li:first").addClass("active").show(); $(this).parents("div").children("div.expander").children("div.tabs").children("div.tab_container").children("div.tab_content:first").show(); var c = $(this).parents("div").children("input.postcode").val(); var b = $(this).parents("div").children("div.expander").children("div.tabs").children("div.tab_container").children("div.mapTab").children("div.mapContainer").children("div.mapLoader").attr("id"); var a = $(this).parents("div").children("div.expander").children("div.tabs").children("div.tab_container").children("div.mapTab").children("div.mapContainer").children("div.map").attr("id"); mapLoad(a, b); usePointFromPostcode(c, setCenterToPoint); $(this).addClass("mapLoaded") } } }); $("div.admin").hide(); $("div.company").hover(function() { $(this).find("div.admin").show() }, function() { $(this).find("div.admin").hide() }); $("div.admin").hover(function() { $(this).addClass("adminButton") }, function() { $(this).removeClass("adminButton") }) };