function PerformQuickSearch(b){var d=b.tagName=="FORM"?b:b.parentNode;var c=d.query.value;var a=false;if(c==""||c==d.query.defaultvalue||c==GetLocalizedString(43)){d.query.value=GetLocalizedString(43);d.query.focus();d.query.select();a=false}else{if(b.tagName=="FORM"){a=true}else{d.submit();a=false}}return a}function SwitchImage(a,b){if(b==0){a.style.backgroundImage="url('/Images/Header/quicktiphover.gif')"}else{a.style.backgroundImage="url('/Images/Header/quicktip.gif')"}}function ClearText(a){if(a.value=="(enter your question here)"||a.value=="(enter answer here, then click the + button)"){a.value=""}}function ClearAreaText(a){if(a.innerHTML=="(enter a description of the question)"){a.innerHTML=""}}function showSignIn(){document.getElementById("sInTd_1").style.display="none";document.getElementById("sInTd_2").style.display="";document.getElementById("sInTd_3").style.display="";document.getElementById("sInTd_4").style.display="";document.getElementById("sInTd_5").style.display=""}function CheckifAll(d){var b=document.getElementById("langChoiceDropDown");var a=d.checked;if(a==false){var c=b.elements[0];if(c!=null){c.checked=false}}}function ChangeAllCB(d){var b=document.getElementById("langChoiceDropDown");var a=d.checked;for(var c=0;c<b.length;c++){if(b.elements[c].id=="-1"){continue}if(b.elements[c].type=="checkbox"){b.elements[c].checked=a}}}function getNewUrl(b){var c=window.location.href;var a=window.location.host;var d=c.substring(0,c.indexOf(a));a=a.split(".");if(a.length>2){c="";a[0]=b;c=a.join(".");c+=window.location.pathname;c=d+c}if(a.length==2){c=b+".";c+=window.location.hostname;c+=window.location.pathname;c=d+c}return c}function ChangeLocalizedSite(a,d,b){var c=getNewUrl(a);if(b!=""){document.location.href=b;return}SetLocaleCookie(d);if(isDev()||isIP()){window.location.reload(false)}else{window.location.href=c}}function RedirectToSiteFromCountryBox(a,d,b){var c=getNewUrl(a);c=AppendQueryStringValue(c,"redirectedNow="+b.value);SetLocaleCookie(d);if(isDev()||isIP()){window.location.reload(false)}else{window.location.href=c}}function AppendQueryStringValue(b,a){if(b.indexOf("?")==-1){return b+"?"+a}else{return b+"&"+a}}function SetLocaleCookie(a){var b=new Date();b.setDate(b.getDate()+365);if(isDev()){document.cookie="LocaleSettings="+a+";expires="+b.toGMTString()+";path=/"}else{document.cookie="LocaleSettings="+a+";expires="+b.toGMTString()+";path=/;domain="+sDomain}}function SubmitLangForm(a){var b=document.getElementById(a);b.submit()}function validatePayPalForm(){var b=document.getElementById("TolunaPassword");var a=document.getElementById("PayPalEmail");b.style.backgroundColor="#fff";a.style.backgroundColor="#fff";document.getElementById("lblErrMessage").innerHTML="";if(!ValidateEmailExp(trim(a.value))){a.style.backgroundColor="#fffb86";a.focus();document.getElementById("lblErrMessage").innerHTML=getError(19);document.getElementById("lblErrMessage").scrollIntoView(true);return false}if(trim(b.value).length==0){b.style.backgroundColor="#fffb86";b.focus();document.getElementById("lblErrMessage").innerHTML=getError(5);document.getElementById("lblErrMessage").scrollIntoView(true);return false}return true}function submitPayPalForm(a){var b=document.getElementById(a);if(validatePayPalForm()){b.submit()}}function CloseInsert(a){document.getElementById("dpinserttr").style.display="none";document.getElementById("iescreener").style.display="none";document.getElementById("MainHomeTable").style.opacity=1;document.getElementById("MainHomeTable").style.filter="none"}function isDev(){var a=window.location.hostname;if(a=="127.0.0.1"){return true}a=a.split(".");if(a.length>=2){return false}else{return true}}function isIP(){var a=window.location.hostname;var b=new RegExp(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/);return(a.match(b))}function QuickSignIn(){document.getElementById("qusername").style.backgroundColor="";document.getElementById("qpassword").style.backgroundColor="";var b=document.getElementById("qusername").value;var a=document.getElementById("qpassword").value;if(!ValidateTextLen(2,255,b)||!ValidateTextExp(loginField,b)||b==document.getElementById("qusername").defaultValue){alert(getError(4));document.getElementById("qusername").style.backgroundColor="#fffb86";document.getElementById("qusername").focus();return false}if(!ValidateTextLen(3,255,a)||!ValidateTextExp(passwordField,a)){alert(getError(5));document.getElementById("qpassword").style.backgroundColor="#fffb86";document.getElementById("qpasswordtemp").focus();return false}document.getElementById("qLogin").submit();return true}function ClearLoginText(a){if(a.value==a.defaultValue){SaveTextBeforeRestoreObject(a);a.value=""}}function QuickSignOut(){document.location.href=document.getElementById("dPollsBaseId").href+"/Logout.aspx"}function toggleTabs(d){var a=d.parentNode.getElementsByTagName("A");var e=0;for(var c=0;c<a.length;c++){a[c].className=a[c].className.replace("active","");a[c].className=trim(a[c].className);if(d===a[c]){e=c}}d.className+=d.className.length>0?" active":"active";var b=getElementsByClassName("tabbedPartDiv",document.getElementById("tabbedDivsHolderDiv"));for(var c=0;c<b.length;c++){b[c].style.display="none"}b[e].style.display="block"}function showQSTour(c,b){sLocation="help";var a=window.open(sLocation,"TourWin","resizable=yes, scrollbars=yes");if(a){a.focus()}}function markRTS(){var b=document.getElementById("spTable");if(b){var c=b.parentNode.parentNode;var a=document.createElement("DIV");a.id="RTSDiv";c.style.position="relative";c.insertBefore(a,b.parentNode)}};