!function(){function e(){z.keyboardSupport&&m("keydown",a)}function t(){if(!Y&&document.body){Y=!0;var t=document.body,o=document.documentElement,n=window.innerHeight,r=t.scrollHeight;if(A=document.compatMode.indexOf("CSS")>=0?o:t,D=t,e(),top!=self)O=!0;else if(te&&r>n&&(t.offsetHeight<=n||o.offsetHeight<=n)){var a=document.createElement("div");a.style.cssText="position:absolute; z-index:-10000; top:0; left:0; right:0; height:"+A.scrollHeight+"px",document.body.appendChild(a);var i;T=function(){i||(i=setTimeout(function(){L||(a.style.height="0",a.style.height=A.scrollHeight+"px",i=null)},500))},setTimeout(T,10),m("resize",T);var l={attributes:!0,childList:!0,characterData:!1};if(M=new W(T),M.observe(t,l),A.offsetHeight<=n){var c=document.createElement("div");c.style.clear="both",t.appendChild(c)}}z.fixedBackground||L||(t.style.backgroundAttachment="scroll",o.style.backgroundAttachment="scroll")}}function o(){M&&M.disconnect(),w(I,r),w("mousedown",i),w("keydown",a),w("resize",T),w("load",t)}function n(e,t,o){if(p(t,o),1!=z.accelerationMax){var n=Date.now(),r=n-q;if(r<z.accelerationDelta){var a=(1+50/r)/2;a>1&&(a=Math.min(a,z.accelerationMax),t*=a,o*=a)}q=Date.now()}if(R.push({x:t,y:o,lastX:t<0?.99:-.99,lastY:o<0?.99:-.99,start:Date.now()}),!j){var i=e===document.body,l=function(n){for(var r=Date.now(),a=0,c=0,u=0;u<R.length;u++){var d=R[u],s=r-d.start,f=s>=z.animationTime,m=f?1:s/z.animationTime;z.pulseAlgorithm&&(m=x(m));var w=d.x*m-d.lastX>>0,h=d.y*m-d.lastY>>0;a+=w,c+=h,d.lastX+=w,d.lastY+=h,f&&(R.splice(u,1),u--)}i?window.scrollBy(a,c):(a&&(e.scrollLeft+=a),c&&(e.scrollTop+=c)),t||o||(R=[]),R.length?_(l,e,1e3/z.frameRate+1):j=!1};_(l,e,0),j=!0}}function r(e){Y||t();var o=e.target;if(e.defaultPrevented||e.ctrlKey)return!0;if(h(D,"embed")||h(o,"embed")&&/\.pdf/i.test(o.src)||h(D,"object")||o.shadowRoot)return!0;var r=-e.wheelDeltaX||e.deltaX||0,a=-e.wheelDeltaY||e.deltaY||0;N&&(e.wheelDeltaX&&y(e.wheelDeltaX,120)&&(r=-120*(e.wheelDeltaX/Math.abs(e.wheelDeltaX))),e.wheelDeltaY&&y(e.wheelDeltaY,120)&&(a=-120*(e.wheelDeltaY/Math.abs(e.wheelDeltaY)))),r||a||(a=-e.wheelDelta||0),1===e.deltaMode&&(r*=40,a*=40);var i=u(o);return i?!!v(a)||(Math.abs(r)>1.2&&(r*=z.stepSize/120),Math.abs(a)>1.2&&(a*=z.stepSize/120),n(i,r,a),e.preventDefault(),void l()):!O||!J||(Object.defineProperty(e,"target",{value:window.frameElement}),parent.wheel(e))}function a(e){var t=e.target,o=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==K.spacebar;document.body.contains(D)||(D=document.activeElement);var r=/^(textarea|select|embed|object)$/i,a=/^(button|submit|radio|checkbox|file|color|image)$/i;if(e.defaultPrevented||r.test(t.nodeName)||h(t,"input")&&!a.test(t.type)||h(D,"video")||g(e)||t.isContentEditable||o)return!0;if((h(t,"button")||h(t,"input")&&a.test(t.type))&&e.keyCode===K.spacebar)return!0;if(h(t,"input")&&"radio"==t.type&&P[e.keyCode])return!0;var i,c=0,d=0,s=u(D);if(!s)return!O||!J||parent.keydown(e);var f=s.clientHeight;switch(s==document.body&&(f=window.innerHeight),e.keyCode){case K.up:d=-z.arrowScroll;break;case K.down:d=z.arrowScroll;break;case K.spacebar:i=e.shiftKey?1:-1,d=-i*f*.9;break;case K.pageup:d=.9*-f;break;case K.pagedown:d=.9*f;break;case K.home:d=-s.scrollTop;break;case K.end:var m=s.scrollHeight-s.scrollTop,w=m-f;d=w>0?w+10:0;break;case K.left:c=-z.arrowScroll;break;case K.right:c=z.arrowScroll;break;default:return!0}n(s,c,d),e.preventDefault(),l()}function i(e){D=e.target}function l(){clearTimeout(E),E=setInterval(function(){F={}},1e3)}function c(e,t){for(var o=e.length;o--;)F[V(e[o])]=t;return t}function u(e){var t=[],o=document.body,n=A.scrollHeight;do{var r=F[V(e)];if(r)return c(t,r);if(t.push(e),n===e.scrollHeight){var a=s(A)&&s(o),i=a||f(A);if(O&&d(A)||!O&&i)return c(t,$())}else if(d(e)&&f(e))return c(t,e)}while(e=e.parentElement)}function d(e){return e.clientHeight+10<e.scrollHeight}function s(e){var t=getComputedStyle(e,"").getPropertyValue("overflow-y");return"hidden"!==t}function f(e){var t=getComputedStyle(e,"").getPropertyValue("overflow-y");return"scroll"===t||"auto"===t}function m(e,t){window.addEventListener(e,t,!1)}function w(e,t){window.removeEventListener(e,t,!1)}function h(e,t){return(e.nodeName||"").toLowerCase()===t.toLowerCase()}function p(e,t){e=e>0?1:-1,t=t>0?1:-1,X.x===e&&X.y===t||(X.x=e,X.y=t,R=[],q=0)}function v(e){if(e)return B.length||(B=[e,e,e]),e=Math.abs(e),B.push(e),B.shift(),clearTimeout(C),C=setTimeout(function(){try{localStorage.SS_deltaBuffer=B.join(",")}catch(e){}},1e3),!b(120)&&!b(100)}function y(e,t){return Math.floor(e/t)==e/t}function b(e){return y(B[0],e)&&y(B[1],e)&&y(B[2],e)}function g(e){var t=e.target,o=!1;if(document.URL.indexOf("www.youtube.com/watch")!=-1)do if(o=t.classList&&t.classList.contains("html5-video-controls"))break;while(t=t.parentNode);return o}function S(e){var t,o,n;return e*=z.pulseScale,e<1?t=e-(1-Math.exp(-e)):(o=Math.exp(-1),e-=1,n=1-Math.exp(-e),t=o+n*(1-o)),t*z.pulseNormalize}function x(e){return e>=1?1:e<=0?0:(1==z.pulseNormalize&&(z.pulseNormalize/=S(1)),S(e))}function k(e){for(var t in e)H.hasOwnProperty(t)&&(z[t]=e[t])}var D,M,T,E,C,H={frameRate:150,animationTime:500,stepSize:100,pulseAlgorithm:!0,pulseScale:4,pulseNormalize:1,accelerationDelta:50,accelerationMax:3,keyboardSupport:!0,arrowScroll:50,fixedBackground:!0,excluded:""},z=H,L=!1,O=!1,X={x:0,y:0},Y=!1,A=document.documentElement,B=[],N=/^Mac/.test(navigator.platform),K={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},P={37:1,38:1,39:1,40:1},R=[],j=!1,q=Date.now(),V=function(){var e=0;return function(t){return t.uniqueID||(t.uniqueID=e++)}}(),F={};if(window.localStorage&&localStorage.SS_deltaBuffer)try{B=localStorage.SS_deltaBuffer.split(",")}catch(e){}var I,_=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e,t,o){window.setTimeout(e,o||1e3/60)}}(),W=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,$=function(){var e;return function(){if(!e){var t=document.createElement("div");t.style.cssText="height:10000px;width:1px;",document.body.appendChild(t);var o=document.body.scrollTop;document.documentElement.scrollTop;window.scrollBy(0,3),e=document.body.scrollTop!=o?document.body:document.documentElement,window.scrollBy(0,-3),document.body.removeChild(t)}return e}}(),U=window.navigator.userAgent,G=/Edge/.test(U),J=/chrome/i.test(U)&&!G,Q=/safari/i.test(U)&&!G,Z=/mobile/i.test(U),ee=/Windows NT 6.1/i.test(U)&&/rv:11/i.test(U),te=Q&&(/Version\/8/i.test(U)||/Version\/9/i.test(U)),oe=(J||Q||ee)&&!Z;"onwheel"in document.createElement("div")?I="wheel":"onmousewheel"in document.createElement("div")&&(I="mousewheel"),I&&oe&&(m(I,r),m("mousedown",i),m("load",t)),k.destroy=o,window.SmoothScrollOptions&&k(window.SmoothScrollOptions),"function"==typeof define&&define.amd?define(function(){return k}):"object"==typeof exports?module.exports=k:window.SmoothScroll=k}(); function El(el){return document.getElementById(el);} function filter_ajax(ajax_url,company_number,page){ var url_query=''; for(var x=0;x<document.getElementsByName(ajax_url).length; x++){ var item=document.getElementsByName(ajax_url)[x]; if(item.type=='checkbox' && item.checked){ url_query+='&'+item.getAttribute('x-name')+'[]='+item.value; } } var httpRequest = new XMLHttpRequest(); httpRequest.onreadystatechange = function(){  if (this.readyState == 4 && this.status == 200) { El(ajax_url).innerHTML=this.responseText;  } }; httpRequest.open('GET', ajax_url+'.php?ajax_url='+ajax_url+'&page='+page+'&company_number='+company_number+url_query); httpRequest.send(); if(page){scrollToEl(ajax_url,-80);} return false; } function scrollToEl(el,adjust){ var rect = El(el).getBoundingClientRect(); var top=rect.top+adjust; var content_top=scrollTop(); for (var i=1;i<=20;i++) { var new_position=content_top+(top/20)*i; setTimeout('window.scrollTo(0,'+new_position+');',(i*10)); } } function windowInnerHeight(){ return window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight || 0; } function scrollTop(){ return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; } function scrollHeight() { return Math.max(  document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight); } /*company filters*/ function closeAllMenu(){ document.getElementById("mobileMenu").style.display = "none"; document.getElementById("mobileMenuBg").style.visibility = "hidden"; } function showMenu(){ document.getElementById("mobileMenu").style.display = "block"; document.getElementById("mobileMenuBg").style.visibility = "visible"; } function showSidebar(){ document.getElementById("mobileMenuBg").style.visibility = "visible"; document.getElementById("mobileMenu").style.display = "none"; } function show_FilterBar(el){ if(El(el).style.visibility=='visible'){hide_FilterBar(el);return;} El(el).style.visibility = 'visible'; } function hide_FilterBar(el){ El(el).style.visibility = 'hidden'; } /*search suggest*/ var search_suggest_query,search_suggest_highlight_number=0; function search_suggest_keyup(q){ if(q==''){search_suggest_blur();return;} if(q==search_suggest_query){return;} search_suggest_query=q; var httpRequest = new XMLHttpRequest(); httpRequest.onreadystatechange = function(){  if (this.readyState == 4 && this.status == 200) { search_suggest_update(q,this.responseText);  } }; httpRequest.open('GET','/insight/ajax_search_suggest.php?q='+encodeURI(q)); httpRequest.send(); } function search_suggest_update(q,html){ if(q!=search_suggest_query){return;} El('search_suggest_results').innerHTML=html; El('search_suggest_results').style.display='block'; search_suggest_highlight_number=0; } function search_suggest_arrow_key(e){ if(document.getElementsByName('search_suggest_links').length==0){return;} e = e || window.event; if (e.keyCode == 38) { var inc=-1; } if (e.keyCode == 40) { var inc=1; } if(e.keyCode == 13){ var divs = document.getElementsByName('search_suggest_links'); for(var i=0;i<divs.length;i++){ if(divs[i].className=='suggest-highlight'){ location.href=divs[i].href;return false; } } } if(inc){ search_suggest_remove_highlight(); if(!El('suggest_'+(search_suggest_highlight_number+inc))){ search_suggest_highlight_number=(inc==1?0:document.getElementsByName('search_suggest_links').length+1); } search_suggest_highlight_number=search_suggest_highlight_number+inc; El('suggest_'+(search_suggest_highlight_number)).className='suggest-highlight'; } } function search_suggest_remove_highlight(){ var divs = document.getElementsByName('search_suggest_links'); for(var i=0;i<divs.length;i++){ divs[i].className = ''; } } function search_suggest_blur(){ El('search_suggest_results').style.display='none'; El('search_suggest_results').innerHTML=''; } /* plan & free account pop up */ function require_plan(ad){ log_behaviour('','','require plan popup','click',ad); if(ad=='explorer'){ popup_div('<div class=\"access-popup\"> <div class=\"col-image\"></div> <div class=\"col-text\"> <h1>Upgrade to Endole Pro</h1> <span>Upgrade today and full access to every feature:</span> <ul> <li>Create filters to find potential companies that fits your search criteria.</li> <li>Unlock telephone numbers, email address, and website details. </li> <li>Export targeted B2B lists to spreadsheet for CRM integration. </li> <li>Save filters to quickly access your lists.</li> <li>Get specialised training with a Dedicated Account Manager.</li> </ul> <span>Over 93,000 users already trust us. Experience premium business intelligence with Endole now.</span> <a class=\"orange-button\" style=\"font-size:14px;font-weight:bold\" href=\"https://www.endole.co.uk/products/explorer/pricing/?from=explorer_paging\">LEARN MORE &amp; UPGRADE</a> <a class=\"grey-button\" onclick=\"return popup_div(1)\" href=\"#\">NOT NOW, MAYBE LATER</a> </div> </div>',800,500); } return false; } function require_account(ad){ log_behaviour('','','require free account popup','click',ad); /*	if(ad=='insight'){ popup_div('<div class=\"ca-popup\"> <div class=\"ca-image\"></div><div class=\"ca-text\"> <h1>Sorry, this is a members only feature.</h1> Sign up now and utilise one of UK\'s largest business information platforms by gaining access to even more advanced features, including: <ul> <li>Browse through detailed insights on over 6 million companies and 30 million directors.</li> <li>View and download from over 120 million Official Documents.</li> <li>Add companies-of-interest to your Endole Manager for ongoing monitoring.</li> <li>Enable members only features including Recent Search History.</li> <li>Remove limits and get even more access to real-time information.</li> </ul> <a class=\"orange-button\" href=\"/\"\">SIGN UP FOR FREE</a><a class=\"grey-button\" href=\"#\" onclick=\"return popup_div(1)\">NO THANKS</a> </div>',550,550); } if(ad=='explorer'){ popup_div('<div class=\"ca-popup\"> <div class=\"ca-image\"></div><div class=\"ca-text\"> <h1>Sorry, this is a members only feature.</h1> Sign up now and utilise one of UK\'s largest business information platforms by gaining access to even more advanced features, including: <ul> <li>Access 50+ advanced search filters to create targeted company lists.</li> <li>Match more companies to your search criteria with access to every UK Company.</li> <li>Continue B2B list-building with Save, Filters and Export capabilities.</li> <li>Enable members only features including Saved Explorer Filters.</li> <li>Learn even more about companies-of-interest with access to Endole Insights.</li> </ul> <a class=\"orange-button\" href=\"/\"\">SIGN UP FOR FREE</a><a class=\"grey-button\" href=\"#\" onclick=\"return popup_div(1)\">NO THANKS</a> </div>',550,550); } */ var new_el = document.createElement('div'); new_el.id='require_account_div'; new_el.className='explorer-overlay hide-iframe'; new_el.onclick=require_account_close; var current_href=window.location.href; if(parent.window.location.href){current_href=parent.window.location.href;} new_el.innerHTML = '<iframe style="width:100%;max-width:440px;height:100%;max-height:520px" scrolling="no" src="/sign-in/?popup=1&continue='+encodeURI(current_href)+'"></iframe>'; document.getElementsByTagName('body')[0].appendChild(new_el); setTimeout("El('require_account_div').className='explorer-overlay show-iframe';",10); return false; } function require_account_close(){ El('require_account_div').className='explorer-overlay hide-iframe';  setTimeout("El('require_account_div').style.display='none'",201); setTimeout("document.getElementsByTagName('body')[0].removeChild(El('require_account_div'))",250); return false; } function popup_div(html,w,h){ if(html==1){ document.body.removeChild(El('popup_div')); return false;} var popup_div = document.createElement("div"); popup_div.id = 'popup_div'; document.body.appendChild(popup_div); if (w > windowInnerHeight()) { w = windowInnerHeight() - 20; } if (h > windowInnerHeight()) { h = windowInnerHeight() - 20; } El('popup_div').innerHTML = '<div class="popup_parent" onclick="return popup_div(1)"></div><div class="popup_child" style="width:'+w+'px;height:'+h+'px">'+html+'</div>'; } /* plan pay popup */ function plan_pay_popup(close,total,remaining,card_onclick,pay_href){ if(close==1){ document.body.removeChild(El('plan_pay_div')); return false;} var popup_div = document.createElement("div"); popup_div.id = 'plan_pay_div'; document.body.appendChild(popup_div); if(remaining<parseInt(total.replace(/,/g, '').split(' ')[0])){ El('plan_pay_div').innerHTML = '<div class="popup_parent" onclick="return plan_pay_popup(1)"></div><div id="play-plan-child" class="plan-pay"><div><img src="/img/pay_popup.png"></div><div><div onclick="return plan_pay_popup(1)" class="close">X</div><h2>Pay using your Endole Plan</h2><span class="desc">You have insufficient allowance to pay using your Endole Plan. Your remaining allowance of '+addCommas(remaining)+' will reset on your plan renewal date. In the meantime, you may <a href="#" onclick="'+card_onclick+'" class="card"> purchase using a card</a>.</span><span class="total">Total: <span id="total_cost">'+total+'</span></span></div></div>'; return false; } El('plan_pay_div').innerHTML = '<div class="popup_parent" onclick="return plan_pay_popup(1)"></div><div id="play-plan-child" class="plan-pay"><div><img src="/img/pay_popup.png"></div><div><div onclick="return plan_pay_popup(1)" class="close">X</div><h2>Generate using your Endole Account</h2><span class="desc">You have '+addCommas(remaining)+' remaining in your plan until your plan renewal date. Alternatively, you may <a href="#" onclick="'+card_onclick+'" class="card"> purchase using a card</a>.</span><span class="total">Total: <span id="total_cost">'+total+'</span></span><a href="'+pay_href+'" onclick="this.innerHTML=\'PROCESSING...\'" class="orange-button">GENERATE REPORT</a></div></div>'; if(total.indexOf('Credit Risk')!==-1){ El('plan_pay_div').innerHTML = '<div class="popup_parent" onclick="return plan_pay_popup(1)"></div><div id="play-plan-child" class="plan-pay"><div><img src="/img/pay_popup.png"></div><div><div onclick="return plan_pay_popup(1)" class="close">X</div><h2>Generate using your Endole Account</h2><span class="desc">Reports are in real-time and can take up to a minute to generate.</span><a href="'+pay_href+'" onclick="this.innerHTML=\'PROCESSING...\'" class="orange-button">GENERATE REPORT</a></div></div>'; } if(El('plan_pay_div').innerHTML.indexOf("explorer_export")>-1){ El('plan_pay_div').innerHTML=El('plan_pay_div').innerHTML.replace('GENERATE REPORT','EXPORT').replace('Generate','Export'); } return false; } function addCommas(intNum) { return (intNum + '').replace(/(\d)(?=(\d{3})+$)/g, '$1,'); } function log_behaviour(c,p,ca,ac,i){ if(!c){c=document.location.href;} if(!p){p=document.referrer;} var httpRequest = new XMLHttpRequest(); httpRequest.open('GET', 'https://suite.endole.co.uk/?c='+encodeURI(c)+'&p='+encodeURI(p)+'&ca='+encodeURI(ca)+'&ac='+encodeURI(ac)+'&i='+encodeURI(i)); httpRequest.send(); } function addEventHandler(el,eventType,handler) { if (el.addEventListener){ el.addEventListener (eventType,handler,false); } else if (el.attachEvent) {  el.attachEvent ('on'+eventType,handler); } } /*preloader*/ function preloader_activate(){ return; if(window.location.href.indexOf("/explorer/") > -1) { return; } if(window.location.href.indexOf("/reports/") > -1) { return; } var Els = document.getElementsByTagName('a'); for(var i = 0; i < Els.length; i++) { if(Els[i].href.indexOf('/insight/company/')!=-1 && Els[i].href.indexOf('#')==-1 && Els[i].href.indexOf('.php')==-1){ addEventHandler(Els[i],'mouseover',function(){preloader_onmouseover(this,0);}); } } } function preloader_onmouseover(el){ if(el.getAttribute('preloader')==1){return;} el.setAttribute('preloader',1); console.log(el.href); var httpRequest = new XMLHttpRequest(); httpRequest.open('GET', el.href); httpRequest.send(); } /* quickview */ var quickview_http,quickview_timer; function quickview_activate(){ var Els = document.getElementsByTagName('a'); for(var i = 0; i < Els.length; i++){ if((Els[i].href.indexOf('/insight/company/')!=-1 || Els[i].href.indexOf('/insight/people/')!=-1) && Els[i].href.indexOf('?')==-1 && Els[i].href.indexOf('#')==-1 && Els[i].href.indexOf('.pdf')==-1){ addEventHandler(Els[i],'mouseover',function(){quickview_onmouseover(this,0);}); addEventHandler(Els[i],'mouseout',function(){quickview_onmouseout();}); } } } function quickview_onmouseover(el,timer){ if(timer==0){quickview_timer=setTimeout(function(){quickview_onmouseover(el,1);},500);return;} if(quickview_http){quickview_http.abort();} quickview_http = new XMLHttpRequest(); quickview_http.onreadystatechange = function(){  if (this.readyState == 4 && this.status == 200) { quickview_insert(el,this.responseText);  } }; quickview_http.open('GET', '/quickview?u='+el.href); quickview_http.send(); } function quickview_onmouseout(){ if(El('quickview')){document.getElementsByTagName('body')[0].removeChild(El('quickview'));} if(quickview_http){quickview_http.abort();} clearTimeout(quickview_timer); } function quickview_insert(el,d){ var offsetTop = el.getBoundingClientRect().top- document.body.getBoundingClientRect().top; var offsetLeft = el.getBoundingClientRect().left- document.body.getBoundingClientRect().left; var elWidth=el.getBoundingClientRect().width; var elLeft=el.getBoundingClientRect().left; var new_el = document.createElement('div'); new_el.id='quickview'; new_el.innerHTML = d; document.getElementsByTagName('body')[0].appendChild(new_el); var newElTop=offsetTop-25; var newElLeft=offsetLeft+elWidth+10; var newElWidth=new_el.getBoundingClientRect().width; var newElHeight=new_el.getBoundingClientRect().height; var newElBottom=(newElTop+newElHeight); var newElRight=(newElLeft+newElWidth); var bodyBottom=(document.body.getBoundingClientRect().height-document.body.getBoundingClientRect().top); var bodyRight=(document.body.getBoundingClientRect().width-document.body.getBoundingClientRect().left); if(newElBottom>bodyBottom){ newElTop=newElTop+(bodyBottom-newElBottom);  } if(newElRight>bodyRight){ newElLeft=elLeft-newElWidth-10;  } new_el.style.top=newElTop+'px'; new_el.style.left=newElLeft+'px'; } /*watchlist*/ function watchlist_add(c){ log_behaviour('','','add to watch list','click','overview tab - overview'); var new_el = document.createElement('div'); new_el.id='watchlist_div'; new_el.className='explorer-overlay hide-iframe'; new_el.onclick=watchlist_close; new_el.innerHTML = '<iframe style="width:300px;height:220px" scrolling="no" src="/insight/watch-list/add-to-watchlist.php?company_number='+c+'"></iframe>'; document.getElementsByTagName('body')[0].appendChild(new_el); setTimeout("El('watchlist_div').className='explorer-overlay show-iframe';",10); return false; } function watchlist_close(){ El('watchlist_div').className='explorer-overlay hide-iframe';  setTimeout("El('watchlist_div').style.display='none'",201); setTimeout("document.getElementsByTagName('body')[0].removeChild(El('watchlist_div'))",250); if(window.location.href.indexOf("/company/") > -1) { setCookie('watchlist_closed',1,1); } if(window.location.href.indexOf("/people/") > -1) { setCookie('watchlist_director_closed',1,1); } return false; } /*help popup--no longer in use*/ function help_popup(){ if(El('help_div')){return false;} var new_el = document.createElement('div'); new_el.id='help_div'; new_el.className='help-popup'; new_el.innerHTML = '<div onmousedown="draggable_mousedown(\'help_div\',this)" onmouseup="draggable_mouseup()" class="title"><span onclick="return help_load_ajax(\'list_questions=1&url=\'+encodeURI(window.location.href),1);" id=help_back class="cw-back-icon" style="display:none"></span> Help<span onclick="return help_popup_close();" class="cw-close-icon"></span></div> <div class="help-body" id=help_ajax><div>...</div></div>'; document.getElementsByTagName('body')[0].appendChild(new_el); help_load_ajax('list_questions=1&url='+encodeURI(window.location.href),1); return false; } function help_popup_close(){ El('help_div').className='help-popup help-popup-close'; setTimeout("document.getElementsByTagName('body')[0].removeChild(El('help_div'))",270); return false; } function help_load_ajax(url,hide_back){ if(!El('help_div')){return;} /*El('help_ajax').style.opacity='0.2';*/ var httpRequest = new XMLHttpRequest(); httpRequest.onreadystatechange = function(){ if (this.readyState == 4 && this.status == 200) { El('help_ajax').innerHTML=this.responseText; El('help_ajax').scrollTop=0;El('help_ajax').style.opacity='1';  } }; httpRequest.open('GET','/help/help_popup.php?'+url); if(hide_back==1){El('help_back').style.display='none';}else{El('help_back').style.display='';} httpRequest.send(); return false; } /*draggable*/ var draggable_div,mouse_x,mouse_y,original_left=0,original_top=0; function draggable_mousedown(iframe){ draggable_div=El(iframe); window.addEventListener('mouseup', draggable_mouseup, true); if(draggable_div.contentWindow){ draggable_div.contentWindow.addEventListener('mousemove', parent.draggable_mousemove, true); draggable_div.contentWindow.addEventListener('mouseup', parent.draggable_mouseup, true); } else{ document.addEventListener('mousemove', draggable_mousemove, true); document.addEventListener('mouseup', draggable_mouseup, true); } draggable_div.style.transition='none'; original_left=draggable_div.getBoundingClientRect().left; original_top=draggable_div.getBoundingClientRect().top; draggable_div.style.left=original_left+'px'; draggable_div.style.top=original_top+'px'; draggable_div.style.position='fixed'; draggable_div.style.boxShadow ='0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)'; draggable_div.style.marginTop='0px'; } function draggable_mousemove(e){ e.preventDefault(); if(!mouse_x){mouse_x=e.screenX;mouse_y=e.screenY;} var new_x=original_left+(e.screenX-mouse_x); var new_y=original_top+(e.screenY-mouse_y); draggable_setXY(new_x,new_y); } function draggable_setXY(x,y){ if(x<0){x=0;} if(y<0){y=0;} var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); if((y+draggable_div.getBoundingClientRect().height)>h){ y=h-draggable_div.getBoundingClientRect().height; } if((x+draggable_div.getBoundingClientRect().width)>w){ x=w-draggable_div.getBoundingClientRect().width; } draggable_div.style.left=x+'px'; draggable_div.style.top=y+'px'; } function draggable_mouseup(){ mouse_x=0;mouse_y=0; if(draggable_div.contentWindow){ draggable_div.contentWindow.removeEventListener('mousemove', parent.draggable_mousemove, true); } else{ document.removeEventListener('mousemove', parent.draggable_mousemove, true); } window.removeEventListener('mouseup', draggable_mouseup, true); draggable_div.style.transition=''; draggable_div.style.boxShadow ='0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)'; } /*remove function*/ function close_details_popup(name){ El('details_popup').style.display='none'; El('details_popup').style.visibility='hidden'; setCookie('close_details_popup_'+name,1,1); return false; } /*cookies*/ function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } /*hint*/ /* quickview */ var hint_timer,hint_disable; function hint_activate(){ hint_activate_tag('a'); hint_activate_tag('div'); } function hint_activate_tag(tag){ var Els = document.getElementsByTagName(tag); for(var i = 0; i < Els.length; i++){ if(Els[i].getAttribute('hint')){ addEventHandler(Els[i],'mouseover',function(){hint_mouseover(this,0);}); addEventHandler(Els[i],'mouseout',function(){hint_mouseout();}); addEventHandler(Els[i],'click',function(){hint_disable=this;hint_mouseout();}); } } } function hint_mouseover(el,timer){ clearTimeout(hint_timer); if(hint_disable==el){return;} hint_disable=''; if(timer==0){hint_timer=setTimeout(function(){hint_mouseover(el,1);},500);return;} var text=el.getAttribute('hint'); var new_el = document.createElement('div'); new_el.id='hint_div'; new_el.innerHTML=''+text; document.getElementsByTagName('body')[0].appendChild(new_el); var elBottom=el.getBoundingClientRect().bottom-document.body.getBoundingClientRect().top; var elWidth=el.getBoundingClientRect().width; var elLeft=el.getBoundingClientRect().left; var newElWidth=new_el.getBoundingClientRect().width; var newElHeight=new_el.getBoundingClientRect().height; var newElTop=elBottom+8; var newElLeft=elLeft+(elWidth/2)-(newElWidth/2); var newElRight=(newElLeft+newElWidth); var bodyRight=(document.body.getBoundingClientRect().width-document.body.getBoundingClientRect().left); if(newElRight>bodyRight){ newElLeft=bodyRight-newElWidth-2;  } new_el.style.top=newElTop+'px'; new_el.style.left=newElLeft+'px'; return false; } function hint_mouseout(){ clearTimeout(hint_timer); if(!El('hint_div')){return;} document.getElementsByTagName('body')[0].removeChild(El('hint_div')); return false; } 