function TL_getDocHeight(){var a=document.body;var b=document.documentElement;return Math.max(a.scrollHeight,b.scrollHeight,a.offsetHeight,b.offsetHeight,a.clientHeight,b.clientHeight)}function TL_getIframeHeight(){var i=document.body;var e=document.documentElement;var g=TL_returnIframeHeight(i.scrollHeight);var h=TL_returnIframeHeight(e.scrollHeight);var a=TL_returnIframeHeight(i.offsetHeight);var c=TL_returnIframeHeight(e.offsetHeight);var b=TL_returnIframeHeight(i.clientHeight);var d=TL_returnIframeHeight(e.clientHeight);var f=TL_returnIframeHeight(window.innerHeight);if(typeof f!="undefined"){return Math.min(g,h,a,c,b,d,f)}else{return Math.min(g,h,a,c,b,d)}}function TL_returnIframeHeight(a){if(a===0){return 900}return(a>900)?900:a}function TL_getYScroll(){var a=0;if(typeof(window.pageYOffset)=="number"){a=window.pageYOffset}else{if(document.body&&document.body.scrollTop){a=document.body.scrollTop}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}}}return a}function TL_setIframeHeight(a){var b=TL_getIframeHeight();b=b-100;if(b<a){b=a}return b}function TL_runTQS(b,c){if(c==""){c="http://uk.tolunaquick.com"}TL_displayPopUpDiv();var d=TL_setIframeHeight(500);var e=d-123;var a=document.createElement("iframe");a.setAttribute("name","TL_TQSFrame");a.setAttribute("id","TL_TQSFrame");a.setAttribute("allowtransparency","true");a.setAttribute("width","873");a.setAttribute("height",d);a.setAttribute("frameborder","0");a.setAttribute("scrolling","no");a.setAttribute("onload","AddCloseDiv()");a.setAttribute("src",c+"/TqsRuntime.aspx?LocationUrl="+getBaseURL()+"&Location=1&Height="+e+"&Src=1&SurveyId="+b);if(navigator.appName.indexOf("Microsoft")!=-1){document.getElementById("TL_contentDiv").innerHTML=a.outerHTML;AddCloseDiv()}else{document.getElementById("TL_contentDiv").appendChild(a)}}function AddCloseDiv(){var a=document.getElementById("TL_closePopUpDiv");if(a==null){a=document.createElement("DIV");a.id="TL_closePopUpDiv";clodeDivLink=document.createElement("a");clodeDivLink.setAttribute("href","#");clodeDivLink.setAttribute("onclick","TL_closePopUpDiv(); return false;");clodeDivLink.setAttribute("title","Close");if(navigator.appName.indexOf("Microsoft")!=-1){a.innerHTML=clodeDivLink.outerHTML}else{a.appendChild(clodeDivLink)}document.getElementById("TL_contentDiv").insertBefore(a,document.getElementById("TL_TQSFrame"))}}function TL_displayPopUpDiv(){var c=document.getElementById("TL_whiteDiv");if(c==null){c=document.createElement("DIV");c.id="TL_whiteDiv";document.getElementsByTagName("BODY")[0].appendChild(c)}c.style.height=TL_getDocHeight()+"px";c.style.display="block";var d=document.getElementById("TL_centerDiv");if(d==null){d=document.createElement("DIV");d.id="TL_centerDiv";document.getElementsByTagName("BODY")[0].appendChild(d)}d.style.height=TL_getDocHeight()+"px";d.style.display="block";var a=document.getElementById("TL_contentDiv");if(a==null){a=document.createElement("DIV");a.id="TL_contentDiv";d.appendChild(a)}var b=20;if(TL_getIframeHeight()<550){b=0}a.style.top=b+TL_getYScroll()+"px";a.style.display="block"}function TL_closePopUpDiv(){var b=document.getElementById("TL_whiteDiv");if(b!=null){b.style.display="none"}var c=document.getElementById("TL_centerDiv");if(c!=null){c.style.display="none"}var a=document.getElementById("TL_contentDiv");if(a!=null){a.style.display="none";if(c!=null){c.innerHTML=""}}if(typeof(window.sRefreshUserProp)!="undefined"&&sRefreshUserProp){UpdateUserObject()}}function getBaseURL(){var a=location.href;var b=a.substring(0,a.indexOf("/",14));if(b.indexOf("http://localhost")!=-1){var a=location.href;var c=location.pathname;var f=a.indexOf(c);var e=a.indexOf("/",f+1);var d=a.substr(0,e);return d}else{return b}}function ValidateUrlAdress(b){var a=/^(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?/;if(b.match(a)){return true}return false};
