var publicDBID = '80256825005C84E2'; var User_ApplicationId = ""; var User_ProfileId = ""; var userID = 'Anonymous'; var publicppdburl = '/portal/publicportal.nsf/'; function openPub(pubID) { openPortalPage('PubDetails','body-right','/__'+publicDBID+'.nsf/(webPubByPropertyRef)/'+pubID+'?OpenDocument'); } function sendToAFriend(pubID) { openPortalPage('SendToAFriend','body-right','/__'+publicDBID+'.nsf/webSendToAFriend?OpenForm&id='+pubID); } function register() { setCookie('registerredirect',publicppdburl+'openProfile?OpenPage'); openPortalPage('Register'); } function openProfile() { if (User_ProfileId == '') login(publicppdburl+'openProfile?OpenPage') else window.location = resolvePortalPage('EmailAndTextUpdates','body-right',publicppdburl+'/0/'+User_ProfileId+'?EditDocument'); } function openApplication() { var qs = ""; if (arguments.length == 1) { qs = arguments[0]; } if(User_ApplicationId && User_ApplicationId != "") { openPortalPage('Application','body-right','/__'+publicDBID+'.nsf/(webAllApplicants)/'+User_ApplicationId+'?EditDocument&'+qs); } else { if (User_ProfileId == '') { login(publicppdburl+'openApplication?OpenPage&'+qs); } else { openPortalPage('Application','body-right','/__'+publicDBID+'.nsf/Application?Openform&'+qs); } } } function oldapplyForPub(pubId) { if (User_ApplicationId && User_ApplicationId != "") { openPortalPage('Application','body-right','/__'+publicDBID+'.nsf/(webAllApplicants)/'+User_ApplicationId+'?EditDocument&pubkey='+pubId); } else { if (User_ProfileId == '') { login(resolvePortalPage('Application','body-right',publicppdburl+'applyForPub?Openpage&pubkey='+pubId)); } else { openPortalPage('Application','body-right','/__'+publicDBID+'.nsf/Application?Openform&pubkey='+pubId); } } } function applyForPub(pubId) { if (User_ApplicationId && User_ApplicationId != "") { openPortalPage('Application','body-right','/__'+publicDBID+'.nsf/webPubApply?CreateDocument&pubkey='+pubId); } else { if (User_ProfileId == '') { login(resolvePortalPage('Application','body-right',publicppdburl+'applyForPub?Openpage&pubkey='+pubId)); } else { openPortalPage('Application','body-right','/__'+publicDBID+'.nsf/webPubApply?CreateDocument&pubkey='+pubId); } } } function moveMap(lat, lng, zoom, q) { if($("map")) { if (_map == undefined || !_map || _map == null) { _map = new PMap($("map")); } _map.getMap().setCenter(new GLatLng(lat, lng), zoom); $value("query", q ? q : ""); if(q && q != "") { updateUserLastSearch() } refreshResults(); } else { openPortalPage("SearchResults?lat=" + lat + "&lng=" + lng + "&zoom=" + zoom + (q ? "&q=" + escape(q) : "")); } } function updateUserLastSearch() { var req = GXmlHttp.create(); req.open("POST", publicppdburl + "/webUpdateUserLastSearch?OpenAgent", true); req.send("&query=" + $value("query") + "&login_username=" + escape(getCookie('login_username'))); } function showPubsForPeriod(p) { openPortalPage("SearchResults?lat=54.876606&lng=-3.427734&zoom=5&360qs=" + escape("&period=" + p)); return; if($("map")) { if (_map == undefined || !_map || _map == null) { _map = new PMap($("map")); } $("ow-period-" + p).checked = true; filter(); refreshResults(); } else { openPortalPage("SearchResults?lat=54.876606&lng=-3.427734&zoom=5&360qs=" + escape("&period=" + p)); } } function showFreeOfTiePubs() { openPortalPage("SearchResults?lat=54.876606&lng=-3.427734&zoom=5&360qs=" + escape("&leases=16")); return; if($("map")) { if (_map == undefined || !_map || _map == null) { _map = new PMap($("map")); } filter(); refreshResults(); } else { openPortalPage("SearchResults?lat=54.876606&lng=-3.427734&zoom=5&360qs=" + escape("&leases=16")); } } function writePubTypes(typeFilter) { var htmlString = ""; var i = 0; if (typeFilter & 1) { i += 1; htmlString += (', Bar snacks');} if (typeFilter & 2) { i += 2; htmlString += (', Business/Commerce');} if (typeFilter & 4) { i += 4; htmlString += (', Community');} if (typeFilter & 8) { i += 8; htmlString += (', Entertainment');} if (typeFilter & 16) { i += 16; htmlString += (', Estate');} if (typeFilter & 32) { i += 32; htmlString += (', Family');} if (typeFilter & 64) { i += 64; htmlString += (', Food Led');} if (typeFilter & 128) { i += 128; htmlString += (', Games Led');} if (typeFilter & 256) { i += 256; htmlString += (', Letting Accommodation');} if (typeFilter & 512) { i += 512; htmlString += (', No Food');} if (typeFilter & 1024) { i += 1024; htmlString += (', Music Led');} if (typeFilter & 2048) { i += 2048; htmlString += (', Rural');} if (typeFilter & 4096) { i += 4096; htmlString += (', Suburban');} if (typeFilter & 8192) { i += 8192; htmlString += (', Town Centre');} if (typeFilter & 16384) { i += 16384; htmlString += (', Young Person\'s Venue');} if (i == 32767) { htmlString = ', All'}; document.write(htmlString.substring(2)); } function writeLeaseTypes(leaseFilter) { var htmlString = ""; var i = 0; if (leaseFilter & 1) { i += 1; htmlString += (', Franchise');} if (leaseFilter & 2) { i += 2; htmlString += (', Short Term');} if (leaseFilter & 4) { i += 4; htmlString += (', Long Term');} if (leaseFilter & 8) { i += 8; htmlString += (', Assignments');} if (leaseFilter & 16) { i += 16; htmlString += (', Free of Tie');} if (i == 31) { htmlString = ', All'}; document.write(htmlString.substring(2)); } function mapSearch() { if ( $('query').value == '') { alert('Please enter a location to search for before clicking search.'); return; } if ($("map")) { search(); } else { window.location.href=portalURL+'SearchResults?q=' + $('query').value; } } function query_onkeypress(e) { if((window.event ? e.keyCode : e.which) == 13) mapSearch(); }