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)&&(window.location.search.indexOf('ckollars')< 0))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 < 512)
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)||(window.location.search.indexOf('ckollars' >=0)))&&(! isNonInteractive()))
initTextBeforeLoad();
else
suspectVersion=true;

