var suspectVersion=false;
var theStyleRules;
var forceRerenderElement;
var hiddenIframeElement;
var bigpictures=false;
var bigpicturesInitted=false;
var isNonInteractiveFlag=false;
var isNonInteractiveFlagInitted=false;
var isMeFlag=false;
var isMeFlagInitted=false;
var isMobileFlag=false;
var isMobileFlagInitted=false;
var theScreenWidth;
var theScreenCategory;
var pageTitleElements;
var initPageInterlockCount=0;
var noFailOutFlag=false;
if(typeof thisPagePreferredSize=='undefined')
var thisPagePreferredSize;
var CNAME='preferredsize';
var theScreenCategories={
'SMALL': 1,
'MEDIUM': 2,
'LARGE': 3};
window.onerror=function(){if(isMe())return false;else return true;};
function envvars(){
if((navigator.appName!="Netscape")||(navigator.appVersion.substring(0,1)!="2")){
document.CDKfireworks.referringURL=document.referrer;
document.CDKfireworks.thisURL=location.href;
document.CDKfireworks.browsername=navigator.appName;
}
}
function alfalfa(){
if(isNonInteractive())return false;
var clamp='rso';
var edge='pe';
var gripper='nal';
vetch(edge+clamp+gripper);
return false
}
function clover(){
if(isNonInteractive())return false;
var clamp='ine';
var edge='bus';
var gripper='ss';
vetch(edge+clamp+gripper);
return false;
}
function vetch(mastermind){
if(isNonInteractive())return false;
var scrabble='ite';
var sorry='\056\157'+'rg';
var parcheesi='\151\100\143\153'+'ollars';
var slinky='?sub'+'je';
var checkers='\157\072'+'k';
var edge='ct=ms'+'g fm ';
var backgammon='\155\141\151'+'lt';
var clamp=' we'+'bs';
location=backgammon+checkers+parcheesi+sorry+slinky+edge+mastermind+clamp+scrabble;
return false;
}
function preloadBusiness(){
var cacheandpitch;
cacheandpitch=new Image();
cacheandpitch.src='btn_inflation.gif';
cacheandpitch=new Image();
cacheandpitch.src='btn_inflation_down.gif';
cacheandpitch=new Image();
cacheandpitch.src='btn_ipswichpopulation.gif';
cacheandpitch=new Image();
cacheandpitch.src='btn_ipswichpopulation_down.gif';
cacheandpitch=new Image();
cacheandpitch.src='btn_localdemographicchanges.gif';
cacheandpitch=new Image();
cacheandpitch.src='btn_localdemographicchanges_down.gif';
cacheandpitch=new Image();
cacheandpitch.src='btn_educatingthehighend.gif';
cacheandpitch=new Image();
cacheandpitch.src='btn_educatingthehighend_down.gif';
cacheandpitch=new Image();
cacheandpitch.src='btn_localpropertytaxes.gif';
cacheandpitch=new Image();
cacheandpitch.src='btn_localpropertytaxes_down.gif';
}
function isMe(){
if(!isMeFlagInitted){
isMeFlag=isMeInner();
isMeFlagInitted=true;
}
return isMeFlag;
}
function isMeInner(){
if(location.protocol=='file:')return true;
var H=location.hostname;
if(H.indexOf('.ckollars.')>=0)return true;
if(H.indexOf('.home.')>=0)return true;
if(H.indexOf('local')>=0)return true;
if(H.indexOf('192.168.')>=0)return true;
if(H.indexOf('127.0.')>=0)return true;
if(H=='ralph')return true;
if(H.indexOf('ralph.')>=0)return true;
if(H=='alice')return true;
if(H.indexOf('alice.')>=0)return true;
if(H=='ed')return true;
if(H.indexOf('ed.')>=0)return true;
if(H=='trixie')return true;
if(H.indexOf('trixie.')>=0)return true;
if(H=='cube3')return true;
if(H.indexOf('cube3.')>=0)return true;
return false;
}
function isNonInteractive(){
if(!isNonInteractiveFlagInitted){
isNonInteractiveFlag=isNonInteractiveInner();
if(isNonInteractiveFlag)suspectVersion=true;
isNonInteractiveFlagInitted=true;
}
return isNonInteractiveFlag;
}
function isNonInteractiveInner(){
if(!navigator.userAgent)return true;
var UA=navigator.userAgent;
if(/^\s*$/.test(UA))return true;
if(/s[pb]ider|crawler|slurp/i.test(UA))return true;
if(/([Bb]ots?|lib)\b/.test(UA))return true;
if(/\b[Ll]ib/.test(UA))return true;
if(/[Yy]andex|[Jj]eeves|[Tt]eoma|[Bb]aidu|[Ss]ogou/.test(UA))return true;
if(/Zend|binlar|larbin|ips-agent/.test(UA))return true;
if(/DMOZ|LWP/.test(UA))return true;
if(/\b(curl|Java|MJ12)/i.test(UA))return true;
if(/archive/i.test(UA))return true;
if(/WebCapture/.test(UA))return true;
if(/(naver|soso)\.com/.test(UA))return true;
if(/CC/.test(UA))return true;
if(/SurveyAgent/.test(UA))return true;
if(/HttpClient|Wget\/|(Win95;I)|Validat/.test(UA))return true;
if(/ClickSense|facebook|filamentgroup/.test(UA))return true;
return false;
}
function isMobile(){
if(!isMobileFlagInitted){
isMobileFlag=isMobileInner();
isMobileFlagInitted=true;
}
return isMobileFlag;
}
function isMobileInner(){
if(!navigator.userAgent)return true;
var UA=navigator.userAgent;
if(/^\s*$/.test(UA))return true;
if(/mobile|handheld|cellphone/i.test(UA))return true;
if(/\b(android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge|maemo|midp|mmp|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows(ce|phone)|xda|xiino)\b/i.test(UA))return true;
return false;
}
function nix(myevent,element){
if((! myevent)||((typeof myevent)!='object')){
if(window.event!==undefined){
myevent=window.event;
}
}
if(myevent&&myevent.preventDefault){
myevent.preventDefault();
}
stopBubbleUp(myevent);
return false;
}
function stopBubbleUp(myevent){
if((! myevent)||((typeof myevent)!='object')){
if(window.event){
myevent=window.event;
}
}
if((myevent===null)||(myevent===undefined))return false;
var usableEventFlag=false;
if(typeof myevent.cancelBubble!=='undefined'){
myevent.cancelBubble=true;
usableEventFlag=true;
}
if(myevent.stopPropagation){
myevent.stopPropagation();
usableEventFlag=true;
}
if(! usableEventFlag){
oops('eventobject '+myevent+' is not usable');
return false;
}
return myevent;
}
function dbg(messagetext){
return false;
if(isMe()){
forceRerender();
alert('DEBUG - '+messagetext);
}
}
function oops(messagetext){
var originalSuspectVersion=suspectVersion;
if(! noFailOutFlag)suspectVersion=true;
if(isNonInteractive())return false;
if(isMe()){
if((typeof forceRerender)=='function')forceRerender();
alert('OOPS - '+messagetext+' UA: '+navigator.userAgent);
}else{
if((! noFailOutFlag)&&(! originalSuspectVersion)&&window.location.protocol=='http:'){
window.location.search='?OOPS='+escape(messagetext)+escape(' UA:')+escape(navigator.userAgent);
throw new Error('');
}
}
}
function softOops(messagetext){
if(isNonInteractive())return false;
if(isMe()){
if((typeof forceRerender)=='function')forceRerender();
alert('SOFTOOPS - '+messagetext+' UA: '+navigator.userAgent);
}
}
function idE(element){
var theElementName='';
if(element){
if(element.name)theElementName=':'+element.name;
else if(element.getAttribute&&(element.getAttribute('name')))theElementName=':'+element.getAttribute('name');
else if(element.id)theElementName=':'+element.id;
else if(element.getAttribute&&(element.getAttribute('id')))theElementName=':'+element.getAttribute('id');
else theElementName=':?';
}
return(element+theElementName);
}
function splitEndPart1(){}
function splitBeginPart2(){}
function getCurrentScroll(){
var oldXscroll,oldYScroll;
if(window.pageYOffset){
oldXScroll=window.pageXOffset;
oldYScroll=window.pageYOffset;
}else if(document.documentElement&&document.documentElement.scrollTop){
oldXScroll=document.documentElement.scrollLeft;
oldYScroll=document.documentElement.scrollTop;
}else if(document.body&&document.body.scrollTop){
oldXScroll=document.body.scrollLeft;
oldYScroll=document.body.scrollTop;
}else if(document.body&&document.body.parentNode&&document.body.parentNode.scrollTop){
oldXScroll=document.body.parentNode.scrollLeft;
oldYScroll=document.body.parentNode.scrollTop;
}else if(window.scrollY){
oldXScroll=window.scrollX;
oldYScroll=window.scrollY;
}else if(window.pageYOffset!==undefined){
oldXScroll=window.pageXOffset;
oldYScroll=window.pageYOffset;
}else if(document.documentElement&&(document.documentElement.scrollTop!==undefined)){
oldXScroll=document.documentElement.scrollLeft;
oldYScroll=document.documentElement.scrollTop;
}else if(document.body&&(document.body.scrollTop!==undefined)){
oldXScroll=document.body.scrollLeft;
oldYScroll=document.body.scrollTop;
}else if(document.body&&document.body.parentNode&&(document.body.parentNode.scrollTop!==undefined)){
oldXScroll=document.body.parentNode.scrollLeft;
oldYScroll=document.body.parentNode.scrollTop;
}else if(window.scrollY!==undefined){
oldXScroll=window.scrollX;
oldYScroll=window.scrollY;
}
if(oldYScroll===undefined)oops('could not get current scroll value');
return [oldXScroll,oldYScroll];
}
function setCurrentScroll(newXScroll,newYScroll){
if(((typeof window.scrollTo)=='function')||((typeof window.scrollTo)=='object')){
window.scrollTo(newXScroll,newYScroll);
}else if(((typeof window.scroll)=='function')||((typeof window.scroll)=='object')){
window.scroll(newXScroll,newYScroll);
}
}
function universalGetElementById(id){
if(document.getElementById)
return(document.getElementById(id));
else if(window.getElementById)
return(window.getElementById(id));
else if(document.all)
return(document.all[id]);
else if(document.layers)
return(document[id]);
else
return null;
}
function initStyleGlobals(){
var theSheet;
if(document.styleSheets&&document.styleSheets[0])theSheet=document.styleSheets[0];
else if(document.styleSheets)theSheet=document.styleSheets;
else{
oops('could not get a reference to the style sheet');
return false;
}
if(theSheet.cssRules)theStyleRules=theSheet.cssRules;
else if(theSheet.rules)theStyleRules=theSheet.rules;
if(! theStyleRules){
oops('could not get a reference to the style sheet rules');
return false;
}
return true;
}
function hideShowWholeStyle(index,state){
if(theStyleRules===undefined)initStyleGlobals();
if(! theStyleRules){
oops('hideShowWholeStyle()called but no theStyleRules,called and completed initStyleGlobals()?');
return;
}
if((((typeof index)!='number')&&((typeof index)!='string'))||((typeof state)!='boolean'))softOops('hideShowWholeStyle('+index+','+state+')invoked with bad arguments');
var ruleIndex;
if((typeof index)=='number')ruleIndex=index;
else ruleIndex=ruleIndexFromSelector(index);
if(theStyleRules[ruleIndex]){
theStyleRules[ruleIndex].style.display=state ? 'none' : 'block';
return;
}
oops('failed to hideShowWholeStyle('+index+','+state+')');
}
function ruleIndexFromSelector(selector){
if(theStyleRules===undefined)initStyleGlobals();
if(! theStyleRules){
oops('ruleIndexFromSelector()called but no theStyleRules,called and completed initStyleGlobals()?');
return;
}
var numberOfStyleRules=theStyleRules.length;
for(var i=0;i<numberOfStyleRules;++i){
if(theStyleRules[i].selectorText==selector)return i;
}
oops('could not find rule for selector '+selector+'(theStyleRules[0].selectorText='+theStyleRules[0].selectorText+')');
}
function findYPos(obj){
var curtop=0;
if(obj.offsetParent){
do{
curtop+=obj.offsetTop;
}while(obj=obj.offsetParent);
}else{
oops('unable to fully calculate vertical position of '+obj+',faking '+curtop);
}
return curtop;
}
function highlight(myevent,element){
if(! stopBubbleUp(myevent))return false;
element.style.color='#00f';
return false;
}
function unHighlight(myevent,element){
if(! stopBubbleUp(myevent))return false;
if(element.style.removeProperty){
element.style.removeProperty('color');
}
if(element.style.removeAttribute){
element.style.removeAttribute('color');
}
return false;
}
function getKeycode(myevent){
var keycode=0;
if(myevent&&myevent.which)keycode=myevent.which;
else if(window.event)keycode=myevent.keyCode;
else oops('getKeycode was triggered but failed to get a keycode');
return keycode;
}
function isActionKey(keycode){
if((keycode <=0)||(keycode > 255))return false;
if(((keycode==8)||(keycode==9))||(keycode==27))return false;
if((keycode >=33)&&(keycode <=40))return false;
if((keycode >=112)&&(keycode <=123))return false;
if((keycode >=44)&&(keycode <=46))return false;
if((keycode >=16)&&(keycode <=20))return false;
if((keycode==144)||(keycode==145))return false;
return true;
}
function initTextBeforeLoad(){
noFailOutFlag=true;
if(! initText()){
setEventHandler('load',initText);
}
noFailOutFlag=false;
}
function initText(){
if(isNonInteractive())return false;
if(window.location.search)return false;
if(theStyleRules===undefined)initStyleGlobals();
if(! theStyleRules){
oops('initText()called but theStyleRules could not be given any content');
return false;
}
hideShowWholeStyle('.noscript',true);
hideShowWholeStyle('.instructions',false);
hideShowWholeStyle('.actions',false);
if(forceRerender)forceRerender();
return true;
}
function forceRerender(){
if(suspectVersion)return;
if(forceRerenderElement===undefined)initUtilityGlobals();
if(! forceRerenderElement)return;
if(forceRerenderElement.style.display!='none')forceRerenderElement.style.display='none';
else forceRerenderElement.style.display='block';
}
function forceReload(){
location.reload(false);
return false;
}
function nix(){return false;}
function disableContextMenu(element){
if(suspectVersion)return;
if(! element){
oops('argument to disableContextMenu('+element+')is not an element');
return;
}
element.oncontextmenu=nix;
element.onmousedown=nix;
element.onmouseup=nix;
}
function initUtilityGlobals(){
forceRerenderElement=universalGetElementById('forcererender');
hiddenIframeElement=universalGetElementById('hiddeniframe');
if(universalGetElementById('bigpictures'))bigpictures=true;
bigpicturesInitted=true;
if(document.getElementsByTagName)pageTitleElements=document.getElementsByTagName('h1');
if(screen&&screen.width){
theScreenWidth=screen.width;
if(theScreenWidth < 320)
theScreenCategory=theScreenCategories.SMALL;
else if(theScreenWidth < 1024)
theScreenCategory=theScreenCategories.MEDIUM;
else
theScreenCategory=theScreenCategories.LARGE;
}
}
function setEventHandler(eventname,handler){
if(window.addEventListener){
window.addEventListener(eventname,handler,false);
}else if(window.attachEvent){
window.attachEvent(eventname,handler);
}else if(eventname=='load'){
if(typeof window.onload=='function'){
var previousFuncs=window.onload;
var combinedString='function(){'+previousFuncs+';'+handler+'};';
window.onload=function(){previousFuncs();handler();};
}else{
window.onload=handler;
}
}else{
oops('failed to setEventHander(eventname='+eventname+',handler='+handler+')');
}
}
function cookieDomainName(fulldomain){
if(fulldomain=='')return '';
var firstchar=fulldomain.charAt(0);
if((firstchar >='0')&&(firstchar <='9'))return fulldomain;
if(fulldomain=='localhost')return '';
var dotpos=fulldomain.lastIndexOf('.');
if(dotpos < 0){
softOops('cookies on "'+fulldomain+'" questionable,guessing ".ckollars.org" instead and hoping');
return '.ckollars.org';
}
dotpos=fulldomain.lastIndexOf('.',(dotpos-1));
if(dotpos < 0)return('.'+fulldomain);
var secondld=fulldomain.substring(dotpos);
return secondld;
}
function setMyCookie(name,value){
if((typeof document.cookie)=='undefined')return;
var date=new Date();
date.setTime(date.getTime()+38880000000);
var mydomainname=cookieDomainName(window.location.hostname);
var setString=name+'='+escape(value)
+(';expires='+date.toUTCString())
+(';path='+'/')
+((mydomainname!='')?(';domain='+mydomainname): '')
;
document.cookie=setString;
}
function getMyCookie(name){
var index,equalspos,aname,avalue,Cookies;
if(! document.cookie)return false;
Cookies=document.cookie.split(";");
for(index=0;index<Cookies.length;index++){
equalspos=Cookies[index].indexOf('=');
aname=Cookies[index].substr(0,equalspos);
avalue=unescape(Cookies[index].substr((equalspos+1)));
aname=aname.replace(/^\s+|\s+$/g,"");
if(aname==name){
return avalue;
}
}
return false;
}
function carpIfNoCookie(name){
if(!getMyCookie(name))
alert('Please turn on "cookies" - without them your preferences(for example large/small images)may not be properly remembered.');
}
function syncPageAndCookie(){
if(suspectVersion)return false;
if(isNonInteractive())return false;
if((! thisPagePreferredSize)||(thisPagePreferredSize==''))return true;
var cookieval=getMyCookie(CNAME);
if(! cookieval){
setMyCookie(CNAME,thisPagePreferredSize);
return true;
}else{
if(thisPagePreferredSize==cookieval){
return true;
}else{
replaceVariant(cookieval);
return false;
}
}
}
function toggleSizeCookie(){
if(suspectVersion)return;
var setting=getMyCookie(CNAME);
if(! setting)setting=isMobile()? 'mobile' : 'desktop';
setting=(setting=='mobile')? 'desktop' : 'mobile';
setMyCookie(CNAME,setting);
}
function replaceVariant(variant){
var parts=/^(.*)-(mobile|desktop)\.[^.]*$/.exec(location.href);
if(! parts)parts=/^(.*)\.[^.]*$/.exec(location.href);
if((! parts)||(parts.length < 0))return;
var basename=parts[1];
var oldvariant=(parts.length >=2)? parts[2] : '';
if(oldvariant==variant)return;
location.replace(basename+'-'+variant+'.html');
}
function unShiftElement(handle){
if(handle.length){
for(i=0;i<handle.length;++i){
unShiftElementInner(handle[i]);
}
}else{
unShiftElementInner(handle);
}
}
function unShiftElementInner(element){
element.style.textShadow='3px 2px #fa8';
}
function shiftElement(handle){
if(handle.length){
for(i=0;i<handle.length;++i){
shiftElementInner(handle[i]);
}
}else{
shiftElementInner(handle);
}
}
function shiftElementInner(element){
if((! element)||(! element.style))return;
element.style.textShadow='3px 2px #e98';
setTimeout(function(){unShiftElement(element);},1500);
}
function initRepetitions(){
if(location.pathname.indexOf('lcdtest')>=0)return;
noFailOutFlag=true;
if(! theScreenCategory)initUtilityGlobals();
if(theScreenCategory==theScreenCategories.LARGE){
if(pageTitleElements){
setInterval(function(){shiftElement(pageTitleElements);},3600);
setTimeout(function(){shiftElement(pageTitleElements);},250);
}else{
oops('failed to get handle to <h1> element(s)');
}
}
noFailOutFlag=false;
}
function hideURLBar(){
setTimeout('hideURLBarInner()',100);
}
function hideURLBarInner(){
if(location.hash)return;
var currentscroll=getCurrentScroll();
if((currentscroll[0]!=0)||(currentscroll[1])!=0)return;
setCurrentScroll(0,1);
}
setEventHandler('load',function(){initPageInterlockCount=-1;if(syncPageAndCookie()){hideURLBar();initRepetitions();}});
setEventHandler('pageshow',function(){if(++initPageInterlockCount > 0)syncPageAndCookie();});
if((!window.location.search)&&(! isNonInteractive()))
initTextBeforeLoad();
else
suspectVersion=true;

