(function() { var widgetWrapper = document.getElementById('springest-search-widget') , regions = [{"id":158,"value":"aberdeen","name":"Aberdeen"},{"id":95,"value":"armagh","name":"Armagh"},{"id":159,"value":"bangor","name":"Bangor"},{"id":160,"value":"bath","name":"Bath"},{"id":96,"value":"belfast","name":"Belfast"},{"id":97,"value":"birmingham","name":"Birmingham"},{"id":165,"value":"bournemouth","name":"Bournemouth"},{"id":98,"value":"bradford","name":"Bradford"},{"id":99,"value":"brighton","name":"Brighton"},{"id":100,"value":"bristol","name":"Bristol"},{"id":101,"value":"cambridge","name":"Cambridge"},{"id":102,"value":"canterbury","name":"Canterbury"},{"id":103,"value":"cardiff","name":"Cardiff"},{"id":104,"value":"carlisle","name":"Carlisle"},{"id":164,"value":"chelmsford","name":"Chelmsford"},{"id":105,"value":"chester","name":"Chester"},{"id":106,"value":"chichester","name":"Chichester"},{"id":107,"value":"coventry","name":"Coventry"},{"id":108,"value":"derby","name":"Derby"},{"id":109,"value":"dundee","name":"Dundee"},{"id":110,"value":"durham","name":"Durham"},{"id":111,"value":"edinburgh","name":"Edinburgh"},{"id":112,"value":"ely","name":"Ely"},{"id":113,"value":"exeter","name":"Exeter"},{"id":167,"value":"gillingham","name":"Gillingham"},{"id":114,"value":"glasgow","name":"Glasgow"},{"id":115,"value":"gloucester","name":"Gloucester"},{"id":116,"value":"hereford","name":"Hereford"},{"id":117,"value":"inverness","name":"Inverness"},{"id":163,"value":"ipswich","name":"Ipswich"},{"id":118,"value":"kingston","name":"Kingston"},{"id":119,"value":"lancaster","name":"Lancaster"},{"id":120,"value":"leeds","name":"Leeds"},{"id":121,"value":"leicester","name":"Leicester"},{"id":122,"value":"lichfield","name":"Lichfield"},{"id":123,"value":"lincoln","name":"Lincoln"},{"id":124,"value":"lisburn","name":"Lisburn"},{"id":125,"value":"liverpool","name":"Liverpool"},{"id":126,"value":"london","name":"London"},{"id":127,"value":"londonderry","name":"Londonderry"},{"id":128,"value":"manchester","name":"Manchester"},{"id":94,"value":"n-a","name":"N/A"},{"id":129,"value":"newcastle","name":"Newcastle"},{"id":130,"value":"newport","name":"Newport"},{"id":131,"value":"newry","name":"Newry"},{"id":132,"value":"norwich","name":"Norwich"},{"id":133,"value":"nottingham","name":"Nottingham"},{"id":134,"value":"oxford","name":"Oxford"},{"id":135,"value":"peterborough","name":"Peterborough"},{"id":136,"value":"plymouth","name":"Plymouth"},{"id":137,"value":"portsmouth","name":"Portsmouth"},{"id":138,"value":"preston","name":"Preston"},{"id":162,"value":"reading","name":"Reading"},{"id":139,"value":"ripon","name":"Ripon"},{"id":140,"value":"salford","name":"Salford"},{"id":141,"value":"salisbury","name":"Salisbury"},{"id":142,"value":"sheffield","name":"Sheffield"},{"id":143,"value":"southampton","name":"Southampton"},{"id":144,"value":"st-albans","name":"St Albans"},{"id":145,"value":"st-davids","name":"St Davids"},{"id":146,"value":"stirling","name":"Stirling"},{"id":147,"value":"stoke-on-trent","name":"Stoke-on-Trent"},{"id":148,"value":"sunderland","name":"Sunderland"},{"id":161,"value":"surrey","name":"Surrey"},{"id":166,"value":"sussex","name":"Sussex"},{"id":149,"value":"swansea","name":"Swansea"},{"id":150,"value":"truro","name":"Truro"},{"id":151,"value":"wakefield","name":"Wakefield"},{"id":152,"value":"wells","name":"Wells"},{"id":153,"value":"westminster","name":"Westminster"},{"id":154,"value":"winchester","name":"Winchester"},{"id":155,"value":"wolverhampton","name":"Wolverhampton"},{"id":156,"value":"worcester","name":"Worcester"},{"id":157,"value":"york","name":"York"}] , priceRanges = [{"slug":"free","label":"Free"},{"slug":"0-500","label":"£0 to £500"},{"slug":"500-1000","label":"£500 to £1,000"},{"slug":"1000-2000","label":"£1,000 to £2,000"},{"slug":"2000-4000","label":"£2,000 to £4,000"},{"slug":"4000-higher","label":"£4,000 and higher"}] , important = important = /*@cc_on @_jscript_version <= 5.8 ? true : false || @*/ false , ie6 = /*@cc_on @_jscript_version <= 5.6 ? true : false || @*/ false , baseUrl = "//www.springest.co.uk" , tenderUrl = "//www.springest.co.uk/in-company" , searchUrl = "//www.springest.co.uk/search" , trackingParams = ""; if (!widgetWrapper) return; if (widgetWrapper.innerHTML.indexOf(baseUrl) === -1) { if (typeof console != 'undefined' && typeof console.error != 'undefined') { console.error('Please use the exact embed code as found on ' + baseUrl); } return; } var widgetTitle = widgetWrapper.innerHTML , widgetTitleChunks = widgetTitle.split('.') , widgetRealTitle = widgetTitleChunks[0] , widgetLink = widgetWrapper.getElementsByTagName('a')[0].getAttribute('href') , isSubjectSearch = false , isIncompanySearch = false , elements = createHtml(widgetWrapper); function css(styles) { return important ? styles.replace(/\!important/g, '') : styles; } function setCss() { if (arguments.length == 3) { var obj = {}; obj[arguments[1]] = arguments[2]; } else { var obj = arguments[1]; } var elm = arguments[0], val; for (var prop in obj) if (obj.hasOwnProperty(prop)) { val = obj[prop]; if (prop == 'float') { elm.style['cssFloat'] = val; elm.style['styleFloat'] = val; prop = 'cssFloat'; if (!important && typeof elm.style.setProperty != 'undefined') { elm.style.setProperty('float', val, 'important'); } } if (important && prop.indexOf('-') != -1) { prop = prop.replace(/(\-[a-z])/g, function(match) { return match.substring(1).toUpperCase(); }) } elm.style[prop] = val; if (!important && typeof elm.style.setProperty != 'undefined') { elm.style.setProperty(prop, val, 'important'); } } }; function createHtml(widgetWrapper) { var wrapperElm = document.createElement('div'); wrapperElm.id = 'springest-search-widget-wrapper'; wrapperElm.style.cssText = css("bottom:0 !important; clear:none !important; color:#000 !important; display:block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:15px !important; margin-left:15px !important; margin-right:15px !important; margin-top:15px !important; overflow:hidden !important; padding-bottom:23px !important; padding-left:23px !important; padding-right:23px !important; padding-top:23px !important; position:relative !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; background-color:#F1F3F5 !important; border-radius:4px !important; margin:15px !important; padding:23px !important; "); widgetWrapper.parentNode.insertBefore(wrapperElm, widgetWrapper); widgetWrapper.parentNode.removeChild(widgetWrapper); var titleElm = document.createElement('strong'); titleElm.innerHTML = widgetRealTitle; titleElm.style.cssText = css("bottom:0 !important; clear:none !important; color:#000000 !important; display:block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0 !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; font-size:14px !important; font-weight:bold !important; "); wrapperElm.appendChild(titleElm); var form = document.createElement('form'); form.style.cssText = css("bottom:0 !important; clear:none !important; color:#000 !important; display:block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0 !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:100% !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; "); form.onsubmit = formatForSubmit; wrapperElm.appendChild(form); if (!isSubjectSearch) { var pQuery = document.createElement('p'); pQuery.style.cssText = css("bottom:0 !important; clear:none !important; color:#999 !important; display:block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0.916em !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; font-size:12px !important; padding:0.916em 0 0 !important; "); form.appendChild(pQuery); var searchBoxWidth = isIncompanySearch ? (pQuery.offsetWidth - 150) : (pQuery.offsetWidth - 12); if (searchBoxWidth < 0) { searchBoxWidth = pQuery.offsetWidth - 12; } if (isIncompanySearch) { var queryLabel = document.createElement('label'); queryLabel.setAttribute('for','springest-search-widget-query'); queryLabel.innerHTML = "Subject:"; queryLabel.style.cssText = css("bottom:0 !important; clear:none !important; color:#000 !important; display:inline-block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0 !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; "); setCss(queryLabel, 'width', '138px'); pQuery.appendChild(queryLabel); } var queryInput = document.createElement('input'); queryInput.id = 'springest-search-widget-query'; if (isIncompanySearch) { queryInput.style.cssText = css("bottom:0 !important; clear:none !important; color:#000 !important; display:inline-block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:4px !important; padding-left:5px !important; padding-right:5px !important; padding-top:4px !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; -webkit-transition:border-color 0.3s linear !important; -moz-transition:border-color 0.3s linear !important; -ms-transition:border-color 0.3s linear !important; -o-transition:border-color 0.3s linear !important; background-color:#FFF !important; border-bottom:1px solid #C1C1C1 !important; border-left:1px solid #858585 !important; border-right:1px solid #C1C1C1 !important; border-top:1px solid #858585 !important; box-shadow:inset 1px 1px 1px #CCC !important; font-size:15px !important; outline:none !important; padding:4px 5px !important; transition:border-color 0.3s linear !important; margin-left:12px !important; "); } else { queryInput.style.cssText = css("bottom:0 !important; clear:none !important; color:#000 !important; display:block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:5px !important; padding-left:5px !important; padding-right:5px !important; padding-top:5px !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; -webkit-transition:border-color 0.3s linear !important; -moz-transition:border-color 0.3s linear !important; -ms-transition:border-color 0.3s linear !important; -o-transition:border-color 0.3s linear !important; background-color:#FFF !important; background-image:url(//www.springest.co.uk/images/sprite-icon.png) !important; background-repeat:no-repeat !important; background-position:98% -48px !important; border-bottom:1px solid #C1C1C1 !important; border-left:1px solid #858585 !important; border-right:1px solid #C1C1C1 !important; border-top:1px solid #858585 !important; box-shadow:inset 1px 1px 1px #CCC !important; font-size:15px !important; outline:none !important; padding:5px !important; transition:border-color 0.3s linear !important; "); } setCss(queryInput, 'width', searchBoxWidth + 'px'); queryInput.onfocus = function(){ setCss(queryInput, 'border-color', '#059EE7'); }; queryInput.onblur = function(){ setCss(queryInput, { 'border-bottom-color': '#C1C1C1', 'border-left-color': '#858585', 'border-right-color':'#C1C1C1', 'border-top-color': '#858585' }); }; pQuery.appendChild(queryInput); } var pDropdown = document.createElement('p'); pDropdown.id = 'springest-search-widget-dropdown'; pDropdown.style.cssText = css("bottom:0 !important; clear:none !important; color:#000 !important; display:block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0.916em !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; font-size:12px !important; padding:0.916em 0 0 !important; "); form.appendChild(pDropdown); var regionSelect = document.createElement('select'); regionSelect.style.cssText = css("bottom:0 !important; clear:none !important; color:#000 !important; display:inline !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:3px !important; padding-right:3px !important; padding-top:0 !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:48% !important; word-spacing:normal !important; z-index:auto !important; margin-right:4% !important; padding:0 3px !important; box-sizing:border-box !important; "); regionSelect.id = 'springest-search-widget-region'; var blancOption = document.createElement('option'); blancOption.value = '-'; blancOption.appendChild(document.createTextNode('Region')); regionSelect.appendChild(blancOption); for (var region in regions) if (regions.hasOwnProperty(region)) { var option = document.createElement('option'); option.value = isIncompanySearch ? regions[region].id : regions[region].value; option.appendChild(document.createTextNode(regions[region].name)); regionSelect.appendChild(option); } pDropdown.appendChild(regionSelect); if (! isIncompanySearch) { var priceSelect = document.createElement('select'); priceSelect.style.cssText = css("bottom:0 !important; clear:none !important; color:#000 !important; display:inline !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:3px !important; padding-right:3px !important; padding-top:0 !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:48% !important; word-spacing:normal !important; z-index:auto !important; padding:0 3px !important; box-sizing:border-box !important; "); priceSelect.id = 'springest-search-widget-price'; var defaultOption = document.createElement('option'); defaultOption.appendChild(document.createTextNode('Budget')); defaultOption.value = '-'; priceSelect.appendChild(defaultOption); for (var priceRange in priceRanges) if (priceRanges.hasOwnProperty(priceRange)) { var option = document.createElement('option'); option.value = priceRanges[priceRange].slug; option.appendChild(document.createTextNode(priceRanges[priceRange].label)); priceSelect.appendChild(option); } pDropdown.appendChild(priceSelect); } if (wrapperElm.offsetWidth < 750 && isIncompanySearch) { var clearfix1 = document.createElement('div'); clearfix1.style.cssText = css("bottom:0 !important; clear:both !important; color:#000 !important; display:table !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0 !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; "); clearfix1.textContent = ' '; form.appendChild(clearfix1); } var submit = document.createElement('input'); submit.type = 'submit'; submit.value = 'Search'; submit.style.cssText = css("bottom:0 !important; clear:none !important; color:#333 !important; display:inline !important; float:right !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:6px !important; padding-left:10px !important; padding-right:10px !important; padding-top:4px !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; border-bottom-color:#7F7F7F !important; border-bottom-style:solid !important; border-bottom-width:1px !important; border-left-color:#7F7F7F !important; border-left-style:solid !important; border-left-width:1px !important; border-right-color:#7F7F7F !important; border-right-style:solid !important; border-right-width:1px !important; border-top-color:#7F7F7F !important; border-top-style:solid !important; border-top-width:1px !important; -webkit-transition:background-color 0.3s linear !important; -moz-transition:background-color 0.3s linear !important; -ms-transition:background-color 0.3s linear !important; -o-transition:background-color 0.3s linear !important; text-align:center !important; background-color:#FFFFFF !important; background-image:url(//www.springest.co.uk/images/button-gradient-simple.png) !important; background-repeat:repeat-x !important; background-size:100% 100% !important; border:1px solid #7F7F7F !important; border-radius:4px !important; cursor:pointer !important; font-size:13px !important; margin-bottom:5px !important; padding:4px 10px 6px !important; transition:background-color 0.3s linear !important; zoom:1 !important; "); submit.onmouseover = submit.onfocus = function(){setCss(this,'background-color','#E5E5E5');} submit.onmouseout = submit.onblur = function(){setCss(this,'background-color','#FFFFFF');} if (isIncompanySearch) { var pParticipants = document.createElement('p'); pParticipants.style.cssText = css("bottom:0 !important; clear:none !important; color:#000 !important; display:block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0.916em !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; font-size:12px !important; padding:0.916em 0 0 !important; "); form.appendChild(pParticipants); var participantsLabel = document.createElement('label'); participantsLabel.id = 'springest-search-widget-participants-label'; participantsLabel.setAttribute('for', 'springest-search-widget-participants'); participantsLabel.innerHTML = "No. of participants:" participantsLabel.style.cssText = css("bottom:0 !important; clear:none !important; color:#000 !important; display:inline-block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0 !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; "); setCss(participantsLabel, 'width', '138px'); pParticipants.appendChild(participantsLabel); var participantsInput = document.createElement('input'); participantsInput.id = 'springest-search-widget-participants'; participantsInput.style.cssText = css("bottom:0 !important; clear:none !important; color:#000 !important; display:inline-block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:4px !important; padding-left:5px !important; padding-right:5px !important; padding-top:4px !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; background-color:#FFF !important; border-bottom:1px solid #C1C1C1 !important; border-left:1px solid #858585 !important; border-right:1px solid #C1C1C1 !important; border-top:1px solid #858585 !important; box-shadow:inset 1px 1px 1px #CCC !important; font-size:15px !important; outline:none !important; padding:4px 5px !important; margin-left:12px !important; "); setCss(participantsInput, 'width', '80px'); participantsInput.onfocus = function(){ setCss(participantsInput, 'border-color', '#059EE7'); }; participantsInput.onblur = function(){ setCss(participantsInput, { 'border-bottom-color': '#C1C1C1', 'border-left-color': '#858585', 'border-right-color':'#C1C1C1', 'border-top-color': '#858585' }); }; pParticipants.appendChild(participantsInput); } var pSubmit = document.createElement('p'); pSubmit.style.cssText = css("bottom:0 !important; clear:none !important; color:#999 !important; display:block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:hidden !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0.916em !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:100% !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; font-size:11px !important; line-height:10px !important; padding:0.916em 0 0 !important; "); form.appendChild(pSubmit); if (isIncompanySearch) { pParticipants.appendChild(submit); } else { pSubmit.appendChild(submit); } var spanSubmit = document.createElement('span'); spanSubmit.style.cssText = css("bottom:0 !important; clear:none !important; color:#000 !important; display:inline !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0 !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; line-height:20px !important; white-space:nowrap !important; "); pSubmit.appendChild(spanSubmit); var innerSpan = document.createElement('span'); innerSpan.style.cssText = css("bottom:0 !important; clear:none !important; color:#999 !important; display:inline !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0 !important; position:relative !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:16px !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; "); innerSpan.appendChild(document.createTextNode("In cooperation with ")); spanSubmit.appendChild(innerSpan); var springestLink = document.createElement('a'); springestLink.href = widgetLink; springestLink.appendChild(document.createTextNode('Springest')); springestLink.style.cssText = css('bottom:0 !important; clear:none !important; color:#999 !important; display:inline-block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:35px !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0 !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:65px !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; background-image:url(//www.springest.co.uk/images/widget/logo-springest-sprite.png) !important; background-position:0 -35px !important; margin-left:5px !important; text-indent:-9999em !important; vertical-align:top !important; zoom:1 !important; '); springestLink.onmouseover = springestLink.onfocus = function(){setCss(this,{color:'#333','background-position':'0 0'});} springestLink.onmouseout = springestLink.onblur = function(){setCss(this,{color:'#999','background-position':'0 -35px'});} spanSubmit.appendChild(springestLink); return { wrapperElm: wrapperElm, headerwidgetWrapper: widgetWrapper, formElm: form, pQueryElm: (pQuery || null), queryLabelElm: (queryLabel || null), queryInputElm: (queryInput || null), pDropdownElm: pDropdown, regionSelectElm: regionSelect, priceSelectElm: (priceSelect || null), pSubmitElm: pSubmit, submitElm: submit, spanSubmitElm: spanSubmit, spanSubmitInnerSpanElm: innerSpan, springestLogo: springestLink, pParticipantsElm: (pParticipants || null), participantsLabelElm: (participantsLabel || null), participantsInputElm: (participantsInput || null) }; } function queryError() { var errorMessage = isIncompanySearch ? "Please fill in a subject" : "Please fill in a search term"; var queryElm = document.getElementById('springest-search-widget-query'); setCss(queryElm, 'border', '1px solid #C00'); if (document.getElementById('springest-search-widget-error-query')) return; var errorElm = document.createElement('p'); errorElm.id = 'springest-search-widget-error-query'; errorElm.style.cssText = css("bottom:0 !important; clear:none !important; color:#111 !important; display:block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0 !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; font-style:italic !important; margin-top:5px !important; text-align:center !important; "); errorElm.appendChild(document.createTextNode(errorMessage)); queryElm.parentNode.appendChild(errorElm); queryElm.onchange = queryElm.onkeyup = function(){ setCss(this, 'border', '1px solid #C1C1C1'); } } function participantsError() { var errorMessage = "Please fill in 2 or more"; var participantsElm = document.getElementById('springest-search-widget-participants'); setCss(participantsElm, 'border', '1px solid #C00'); var participantsLabelElm = document.getElementById('springest-search-widget-participants-label'); if (document.getElementById('springest-search-widget-error-participants')) return; var errorElm = document.createElement('p'); errorElm.id = 'springest-search-widget-error-participants'; errorElm.style.cssText = css("bottom:0 !important; clear:none !important; color:#111 !important; display:block !important; float:none !important; font-family:Arial, Helvetica, sans-serif !important; font-size:1em !important; font-style:normal !important; font-variant:normal !important; font-weight:normal !important; height:auto !important; left:0 !important; letter-spacing:normal !important; line-height:normal !important; list-style-image:none !important; list-style-position:outside !important; list-style-type:disc !important; margin-bottom:0 !important; margin-left:0 !important; margin-right:0 !important; margin-top:0 !important; overflow:visible !important; padding-bottom:0 !important; padding-left:0 !important; padding-right:0 !important; padding-top:0 !important; position:static !important; right:0 !important; text-align:left !important; text-decoration:none !important; text-indent:0 !important; text-transform:none !important; top:0 !important; vertical-align:baseline !important; visibility:visible !important; white-space:normal !important; width:auto !important; word-spacing:normal !important; z-index:auto !important; background-color:transparent !important; background-attachment:scroll !important; background-image:none !important; background-position:0 0 !important; background-repeat:repeat !important; border-bottom-color:transparent !important; border-bottom-style:none !important; border-bottom-width:0 !important; border-left-color:transparent !important; border-left-style:none !important; border-left-width:0 !important; border-right-color:transparent !important; border-right-style:none !important; border-right-width:0 !important; border-top-color:transparent !important; border-top-style:none !important; border-top-width:0 !important; font-style:italic !important; margin-top:5px !important; text-align:center !important; "); errorElm.appendChild(document.createTextNode(errorMessage)); participantsElm.parentNode.appendChild(errorElm); if (elements.wrapperElm.offsetWidth > 400) { setCss(errorElm, {'text-align': 'left', 'padding-left': (participantsLabelElm.offsetWidth + 12) + 'px'}); } if (elements.wrapperElm.offsetWidth - (participantsLabelElm.offsetWidth + participantsElm.offsetWidth + 12) > 300) { setCss(errorElm, {'text-align': 'left', padding: 0, left: (23 + participantsLabelElm.offsetWidth + participantsElm.offsetWidth + 24) + 'px', position: 'absolute', 'margin-top': '-21px', right: 'auto', top: 'auto', bottom: 'auto'}); } participantsElm.onchange = participantsElm.onkeyup = function(){ setCss(this, 'border', '1px solid #C1C1C1'); } } function springestResize() { var queryWidth, dropdownWidth , oWidth = elements.wrapperElm.offsetWidth , oHeight = elements.wrapperElm.offsetHeight; if (oWidth == 0) return; if (elements.pQueryElm) { if (oWidth > 750) { queryWidth = oWidth - ((elements.priceSelectElm ? 375 : 425) + elements.pSubmitElm.offsetWidth) dropdownWidth = elements.priceSelectElm ? '300px' : '150px'; setCss(elements.formElm, { 'padding-top': '5px' }); setCss(elements.pQueryElm, { 'float': 'left', 'margin-right': '5px', 'padding-top': '0px', width: queryWidth + 'px' }); setCss(elements.pDropdownElm, { display: 'inline', 'float': 'left', 'line-height': '30px', 'margin-left': '5px', 'padding-top': '0px', width: '300px' }); setCss(elements.pSubmitElm, { 'float': 'left', 'padding-top': '0px', width: 'auto' }); setCss(elements.submitElm, { 'float': 'left', 'margin-left': '10px', 'margin-right': '10px' }); } else if (oWidth > 400) { queryWidth = elements.priceSelectElm ? '49%' : '74%'; dropdownWidth = elements.priceSelectElm ? '49%' : '24%'; setCss(elements.formElm, { 'padding-top': '0px' }); setCss(elements.pQueryElm, { 'float': 'left', 'margin-right': '1%', 'padding-top': '0.916em', width: queryWidth }); setCss(elements.pDropdownElm, { 'float': 'left', 'line-height': '30px', 'margin-left': '1%', 'padding-top': '0.916em', width: dropdownWidth }); setCss(elements.pSubmitElm, { 'float': 'none', 'padding-bottom': '0px', 'padding-top': '0.916em', width: '100%', height: '35px', clear: 'both' }); setCss(elements.submitElm, { 'float': 'right', 'margin-left': '0px', 'margin-right': '0px' }); if (isIncompanySearch && oHeight < 150 && oWidth >= 728) { setCss(elements.pSubmitElm, { left: '-20px', right: 'auto', bottom: 'auto', position: 'absolute', top: '0px', 'text-align': 'right', overflow: 'visible' }); } setCss(elements.spanSubmitElm, { bottom: 'auto', left: 'auto', position: 'static', top: '0px' }); } else { setCss(elements.formElm, { 'padding-top': '0px' }); setCss(elements.pQueryElm, { 'float': 'none', 'margin-right': '0', 'padding-top': '0.916em', width: '100%' }); setCss(elements.pDropdownElm, { 'float': 'none', 'line-height': '1em', 'margin-left': '0', 'padding-top': '0.916em', width: '100%' }); setCss(elements.pSubmitElm, { 'float': 'none', 'padding-bottom': '0px', 'padding-top': '0.916em', width: '100%', overflow: 'visible' }); setCss(elements.submitElm, { 'float': 'right', 'margin-left': '0px', 'margin-right': '0px' }); setCss(elements.spanSubmitElm, { bottom: 'auto', left: 'auto', position: 'static', top: '0px' }); } var queryInputWidth = isIncompanySearch ? (elements.pQueryElm.offsetWidth - (elements.queryLabelElm.offsetWidth + 28)) : (elements.pQueryElm.offsetWidth - 12); if (queryInputWidth < 0) { queryInputWidth = elements.pQueryElm.offsetWidth; } if (isIncompanySearch) { if (oWidth < 400) { var participantsInputWidth = elements.pParticipantsElm.offsetWidth - (elements.participantsLabelElm.offsetWidth + 24); var queryInputWidth = elements.pQueryElm.offsetWidth - 12; if (queryInputWidth < 0) queryInputWidth = 0; if (participantsInputWidth < 0) participantsInputWidth = 0; setCss(elements.queryInputElm, { 'margin-left': '0', 'margin-top': '5px', 'width': queryInputWidth + 'px' }); if (participantsInputWidth > 40) { setCss(elements.participantsInputElm, { 'width': participantsInputWidth + 'px' }); } else { setCss(elements.participantsInputElm, { 'margin-top': '5px', 'margin-left': '0', 'width': (elements.pParticipantsElm.offsetWidth > 0 ? elements.pParticipantsElm.offsetWidth - 12 : elements.pParticipantsElm.offsetWidth) + 'px' }); } if (elements.submitElm.parentNode === elements.pParticipantsElm) { elements.pParticipantsElm.removeChild(elements.submitElm); elements.pSubmitElm.insertBefore(elements.submitElm, elements.spanSubmitElm); } } else { setCss(elements.queryInputElm, { 'margin-left': '12px', 'margin-top': '0', 'width': queryInputWidth + 'px' }); setCss(elements.participantsInputElm, { 'margin-left': '12px', 'margin-top': '0', 'width': '80px' }); if (elements.submitElm.parentNode === elements.pSubmitElm) { elements.pSubmitElm.removeChild(elements.submitElm); elements.pParticipantsElm.insertBefore(elements.submitElm, elements.participantsLabelElm); } } if (oWidth <= 300 && oHeight < 300) { setCss(elements.queryLabelElm, 'display', 'none'); elements.queryInputElm.placeholder = elements.queryLabelElm.textContent.replace(':', ''); if (oHeight < 250) { setCss(elements.pParticipantsElm, 'display', 'none'); } else { setCss(elements.pParticipantsElm, 'display', 'block'); } } else { setCss(elements.queryLabelElm, 'display', 'inline-block'); elements.queryInputElm.placeholder = ''; setCss(elements.pParticipantsElm, 'display', 'block'); } } else { setCss(elements.queryInputElm, 'width', queryInputWidth + 'px'); } } /* No query input */ else { if (oWidth > 525) { setCss(elements.formElm, { 'padding-top': '5px' }); setCss(elements.pDropdownElm, { 'float': 'left', 'line-height': '30px', 'margin-left': '5px', 'padding-top': '0px', width: oWidth - 325 + 'px' }); setCss(elements.pSubmitElm, { 'padding-top': '0px', width: 'auto' }); setCss(elements.submitElm, { 'float': 'left', 'margin-left': '10px', 'margin-right': '10px' }); } else { setCss(elements.formElm, { 'padding-top': '0px' }); setCss(elements.pDropdownElm, { 'float': 'none', 'line-height': '1em', 'margin-left': '0', 'padding-top': '0.916em', width: '100%' }); setCss(elements.pSubmitElm, { 'padding-top': '0.916em', width: '100%', overflow: 'visible' }); setCss(elements.submitElm, { 'float': 'right', 'margin-left': '0px', 'margin-right': '0px' }); } } setCss(elements.spanSubmitElm, {'margin-top': '0'}); if (oWidth < 200 || (isIncompanySearch && oWidth < 250)) { var spanWidth = isIncompanySearch ? (elements.pSubmitElm.offsetWidth - (elements.submitElm.offsetWidth + 10)) + 'px' : '100%' , spanFloat = isIncompanySearch ? 'left' : 'none' , spanClear = isIncompanySearch ? 'none' : 'both'; if (parseInt(spanWidth) < 0) spanWidth = '100%'; setCss(elements.spanSubmitElm, {clear: spanClear, display: 'block', 'float': spanFloat, width: spanWidth}); setCss(elements.spanSubmitInnerSpanElm, {top: '0px'}); setCss(elements.springestLogo, {'float': 'none', top: '0px', display: 'block'}); } else { if (isIncompanySearch && oWidth > 250 && oWidth <= 300) setCss(elements.spanSubmitElm, {'margin-top': '40px'}); if (oWidth < 270 && (! isIncompanySearch && oHeight < 250)) { setCss(elements.spanSubmitElm, {'margin-bottom': '10px', 'white-space': 'normal'}); setCss(elements.spanSubmitInnerSpanElm, 'white-space', 'normal'); setCss(elements.spanSubmitInnerSpanElm, 'top', '17px'); setCss(elements.springestLogo, { 'float': 'none', 'margin-top': '15px', position: 'relative' }); } else { setCss(elements.spanSubmitElm, {'margin-bottom': '10px', 'white-space': 'nowrap'}); setCss(elements.spanSubmitInnerSpanElm, 'white-space', 'nowrap'); setCss(elements.springestLogo, {'float': 'none', 'margin-top': '0px'}); } } if (oWidth < 250 && oHeight < 250) { if (isIncompanySearch) { setCss(elements.spanSubmitElm, 'display', 'none'); } else if (oWidth <= 200 && oHeight <= 200) { setCss(elements.spanSubmitInnerSpanElm, 'display', 'none'); } } if (oWidth < 200) { setCss(elements.regionSelectElm, { 'margin': '0 0 1em 0', width: '100%' }); if (elements.priceSelectElm) setCss(elements.priceSelectElm, 'width', '100%'); } else { var regionSelectWidth = isIncompanySearch ? '100%' : '48%' , regionSelectMargin = isIncompanySearch ? '0' : '0 4% 0 0'; setCss(elements.regionSelectElm, {'margin': regionSelectMargin, width: regionSelectWidth}); if (elements.priceSelectElm) setCss(elements.priceSelectElm, 'width', '48%'); } } if (window.addEventListener) { window.addEventListener('resize', springestResize, false); } else if (window.attachEvent) { window.attachEvent('onresize', springestResize); } setTimeout(springestResize, 50); setTimeout(springestResize, 250); function formatForSubmit(e) { if (e && e.preventDefault) { e.preventDefault(); } else if (window.event && window.event.returnValue) { window.eventReturnValue = false; } var query = document.getElementById('springest-search-widget-query'), region = document.getElementById('springest-search-widget-region'), price = document.getElementById('springest-search-widget-price'), participants = document.getElementById('springest-search-widget-participants'), queryValue = '', regionValue = '', priceValue = '', participantsValue = ''; if (query && query.value.length === 0) { queryError(); return false; } if (participants && participants.value !== '' && parseInt(participants.value) < 2) { participantsError(); return false; } if (query) { queryValue = (isIncompanySearch ? '&incompany_tender[title]=' : '/') + encodeURIComponent(query.value); } if (region && region.value != '-') { regionValue = (isIncompanySearch ? '&incompany_tender[region_id]=' : '/') + region.value; } if (price && price.value != '-') { priceValue = '/' + price.value; } if (isIncompanySearch && participants) { participantsValue = "&incompany_tender[participant_count]=" + participants.value; } var urlToGoTo , suffix = "" , affiliate = false; if (isSubjectSearch) { urlToGoTo = '//www.springest.co.uk/' + isSubjectSearch + regionValue + priceValue + suffix; } else if (isIncompanySearch) { urlToGoTo = tenderUrl + "?widget=true" + queryValue + regionValue + participantsValue; } else { urlToGoTo = searchUrl + queryValue + regionValue + priceValue + suffix; } if (trackingParams.length > 0) { if (urlToGoTo.indexOf('?') !== -1) { urlToGoTo += '&'; } else { urlToGoTo += '?'; } urlToGoTo += trackingParams; } if (affiliate) { urlToGoTo = affiliate.replace('[URL]', encodeURIComponent('http:' + urlToGoTo)); } window.open(urlToGoTo); /* Needed for sloppy browsers this time, normally .preventDefault() would work. */ return false; } })();//