// This file contains intellectual property and artistic creations
// by Dennis Sandow and is copyright 2000-2010 by the author.
// For use only on websites maintained by Dennis Sandow, or with
// specific permission.  Do not remove this notice.

// All cookie handling is here.  
// Cookies only used if this js is loaded from template entry.  BEFORE misc or readme
// Misc defaults isKookie =0 if not set here. 
// All cookie users test isKookie, else ignore.

var udf='undefined';
var isKookie=0, kkBase = WorkDir.replace(/[^0-9a-z]/g,'')+isWeb
var kkAll = new Array(), kkHist = new Array();
var kkSeedA = new Date(), kkSeed = kkSeedA.getDate();
var kkHistLength=0, gotDatePreparse=0, gotYMenuPreparse=0;
var TcLisArray=new Array(), upDatesAr = new Array();
var blltsAr = new Array(), yMenuAr = new Array();
if(typeof UsingSidebarCal_NoOptions == udf ) var UsingSidebarCal_NoOptions=0;


function getHistoryKookiesAsArray(){
  if (! isKookie) return;
  kkAll = document.cookie.split(';');
  for (kkx in kkAll) {
    if( kkAll[kkx].replace(/ /g,'').replace(/=.*/,'') == kkBase+'PgViews') {
      kkHist = unescape(kkAll[kkx].split('=')[1]).split('|');
      break;
    };
  };
  kkHistLength=kkHist.length;
};

var kDate = new Date(); 
function makeNewHistoryCookieString(){
  kkLimit=101;
//  nowJul = kDate.getFullYear()*10000+(kDate.getMonth()+1)*100+kDate.getDate() ;
  nowJul = Math.floor(kDate.getTime()/(24*3600*1000));
  kookieAlias=iAm;
  if( iAm == 'index' ) kookieAlias='home';
  kkHistStr=kookieAlias+'~'+nowJul;
  for (kkx in kkHist) {
    if( kookieAlias != kkHist[kkx].split('~')[0] ) kkHistStr += '|'+kkHist[kkx];
    if( ! --kkLimit ) break;
  };
  return kkHistStr;
};

// isReload notes - '' or omit = do not reload
// 0 (numeric) = strip ?[gG] but preserve other USL options, and reload
// ex: 'g' or '\'g'\'' = strip all URL options and reload with ?g (or whatever)
function setKookie(kkName,kkValue,kkDays,isReload){
  if (! isKookie) return;
  kkString = kkName +'='+escape(kkValue);
  if ( typeof stdkkDays != udf && stdkkDays && ! kkDays ) kkDays = stdkkDays ; 
  if( kkDays ){
    kkExpDate = new Date();
    kkExpDate.setTime(kDate.getTime() + (kkDays*24*3600000) );
    kkString += ";expires=" + kkExpDate.toGMTString();
  };
  kkString += isWeb?';path=/':'';
  document.cookie = kkString;
// alert(kkName+' '+kkValue+' '+typeof isReload +' '+ isReload)
  if ( typeof isReload == udf ) return;
  if( typeof reloadRE != udf && ( isReload == 'reSpecial' || isReload == 'REinLine' ) ) return reloadRE();
  if( isReload == 0 ) location.href=location.href.replace(/\?[gG]/g,'?');
  if( isReload ) location.href=location.href.replace(/\?.*/g,'')+'?'+ isReload;
};

function getOtherKookies( othrKookieTarget ){
  if (! isKookie) return '';
  kkAll = document.cookie.split(';');
  for (kkx in kkAll) {
    if( kkAll[kkx].replace(/ /g,'').replace(/=.*/,'') == othrKookieTarget) {
      return unescape(kkAll[kkx].split('=')[1]).split('|');
    };
  };
  return '';
};

if ( getOtherKookies( kkBase+kkSeed ) == kkSeed ) isKookie=1 ;
if ( ! isKookie ) {
  isKookie=-1; setKookie(kkBase+kkSeed,kkSeed,"")
  isKookie = ( getOtherKookies( kkBase+kkSeed) == kkSeed ) ;
};
if (isKookie && MenuItems) {
  getHistoryKookiesAsArray();
// prepend this page to cookie string, and rewrite it
  setKookie(kkBase+'PgViews',makeNewHistoryCookieString(),100);
};

var kkRotateBG=1,forcedBG=0,kkKillNewInMenu=0, kkKillYMenu=0, kkNestYMenu=0, kkLhtFont=0, kkREdoInLine=0; kkREpopmulti=0; kkREshowall=0, kkMarble=0, kkMenuSize=12,kkMenuFont=0;
if (isKookie) kkRotateBG = parseInt(getOtherKookies(kkBase+'xPgBG'));
if ( typeof isLHT != udf && ! kkRotateBG ) kkRotateBG=1 ;
if ( typeof isLIB != udf && ! kkRotateBG ) kkRotateBG=1 ;
if (isKookie) {
  kkKillNewInMenu = parseInt(getOtherKookies(kkBase+'xNewBul'));
  kkKillYMenu = parseInt(getOtherKookies(kkBase+'xYMenu'));
  kkNestYMenu = parseInt(getOtherKookies(kkBase+'xYMenuNest'));
  kkLhtFont = parseInt(getOtherKookies(kkBase+'LhtFont'));
  kkREdoInLine = parseInt('0'+getOtherKookies(kkBase+'REinLine'));
  kkREpopmulti = parseInt('0'+getOtherKookies(kkBase+'REpopmulti'));
  kkREshowall = parseInt('0'+getOtherKookies(kkBase+'Showall'));
  kkMarble = parseInt(getOtherKookies(kkBase+'Marble'));
  kkMenuSize = parseInt(getOtherKookies(kkBase+'MenuSize'));
  kkMenuFont = parseInt(getOtherKookies(kkBase+'MenuFont'));
};

kookieOptionsMsg='<a href="javascript:void(0)" onmouseout="xnd()" '+
  'onMouseover="return HintStick(\'kOpt\',\'Select Options\''+(typeof isLHT != udf?','+600:'')+')" '+
  'class=noUL>'+(typeof kookieOptionsPhrase != udf && kookieOptionsPhrase?kookieOptionsPhrase:'Options')+'</a>';

function makeOptionsOLmessageBody(){
  tex1=''; texCal=''; texPerPage='';
  if ( typeof isLHT != udf ) tex1=LHToptionPopupText();
  if ( typeof isLIB != udf ) tex1=LIBoptionPopupText();
  if (typeof CalCmdLineArgs != udf ||    // Is this a calendar page
      typeof calCheck != udf ) {         // Is this a calendar update page
    texCal = CalOptionsPopupText();
  };
  if (typeof PageSpecificOpts != udf ) { // Look for addl form opts built into a page
    texPerPage = PageSpecificOpts();
  };
  if( tex1 || texCal ) return '<form name=optsForm><center>' +tex1 + texCal + texPerPage+'</center></form>';
};
  
function LHToptionPopupText() {  
  if ( typeof kkRotateBG == udf || typeof kkKillNewInMenu == udf || typeof kkNestYMenu == udf || typeof kkLhtFont == udf ) return '';

  kkOptionMsg = ''+
    'Seal<input type=radio name="radBG" value="-1" '+
      ( kkRotateBG == -1?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'xPgBG\', -1, 30, 0)">'+
    ' Millington<input type=radio name="radBG" value="-2" '+
      ( kkRotateBG == -2?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'xPgBG\', -2, 30, 0)">'+
    ' Memorial<input type=radio name="radBG" value="-3" '+
      ( kkRotateBG == -3?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'xPgBG\', -3, 30, 0)">'+
    ' Meyersville<input type=radio name="radBG" value="-4" '+
      ( kkRotateBG == -4?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'xPgBG\', -4, 30, 0)">'+
    ' All<input type=radio name="radBG" value="all" '+
      (kkRotateBG>0 && kkRotateBG<99 ?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'xPgBG\', 1, 30, 0)">'+
    '&nbsp; <b>Background Image</b>&nbsp; '+
    '<input type=radio name="radBG" value="off" '+
      (kkRotateBG==99?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'xPgBG\', 99, 30, 0)">'+
      'Off'+
// start Richard font choices
    '<br>Most users like '+
    '<input type=radio name="radLF" value="Ar" '+(kkLhtFont?'':'CHECKED')+
      ' onclick="setKookie(kkBase+\'LhtFont\',0,\'\',0)">'+
      'Arial&nbsp;&nbsp; '+
    'Richard likes '+
    '<input type=radio name="radLF" value="Tr" '+(kkLhtFont==1?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'LhtFont\',1,\'\',0)">'+
      'Times Roman&nbsp;&nbsp; '+
    'or <input type=radio name="radLF" value="Ga" '+(kkLhtFont==2?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'LhtFont\',2,\'\',0)">'+
      'Garamond';

// start menu bullets and popup submenus
  if (typeof noMenu == udf || ! noMenu ) kkOptionMsg += '<br>'+
    'On <input type=radio name="radYW" value="on" '+(kkKillNewInMenu?'':'CHECKED')+
      ' onclick="setKookie(kkBase+\'xNewBul\',0,\'\',0)">'+
      '&nbsp; <b>Identify Recent Changes on Menu</b>&nbsp; '+
    '<input type=radio name="radYW" value="off" '+(kkKillNewInMenu?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'xNewBul\',1,\'\',0)">Off'+
      
    '<br>On <input type=radio name="radyMenu" value="on" '+(kkKillYMenu?'':'CHECKED')+
      ' onclick="setKookie(kkBase+\'xYMenu\',0,\'\',0)">'+
      '&nbsp; <b>Use Sub-Menu Popups</b>&nbsp; '+
    '<input type=radio name="radyMenu" value="off" '+(kkKillYMenu?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'xYMenu\',1,\'\',0)">Off'+

    '<br>On <input type=radio name="radyMenuNest" value="on" '+(kkNestYMenu?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'xYMenuNest\',1,\'\',0)">'+
      '&nbsp; <b>Use Deep Sub-Menus</b>&nbsp; '+
    '<input type=radio name="radyMenuNest" value="off" '+(kkNestYMenu?'':'CHECKED')+
      ' onclick="setKookie(kkBase+\'xYMenuNest\',0,\'\',0)">Off';

// start recheck options
  if (iAm == 'recheck' && isWeb ) kkOptionMsg += '<br>'+
    '<b>Property detail results display</b><br>'+
    '<input type=radio name="radREinLine" value="normal" '+ 
      (kkREdoInLine==0 && kkREpopmulti==0?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'REinLine\',0,30,\'REinLine\'); '+
                'setKookie(kkBase+\'REpopmulti\',0,30,0)"'+
      '>Show results as popup (default)&nbsp; '+

    '<input type=radio name="radREinLine" value="multi" '+ 
      (kkREdoInLine==0 && kkREpopmulti==1?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'REinLine\',0,30,\'REinLine\'); '+
                'setKookie(kkBase+\'REpopmulti\',1,1,0)"'+
      '>Show results in separate popups&nbsp; '+

    '<input type=radio name="radREinLine" value="inline" '+
      (kkREdoInLine==1?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'REinLine\',1,30,\'REinLine\')"; '+
      '>Show results in-line';

  if (iAm == 'recheck' && typeof kkREshowall != udf && kkREshowall ) kkOptionMsg += '<br>'+
    '<b>Show property detail</b>&nbsp; '+
    '<input type=radio name="radRE" value="off" '+(kkREshowall==0?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'Showall\',0,'+(isWeb?'\'\'':60)+',\'reSpecial\')">Basic&nbsp; '+
    '<input type=radio name="radRE" value="owner" '+(kkREshowall==1?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'Showall\',1,'+(isWeb?'\'\'':60)+',\'reSpecial\')">+Owners&nbsp; '+
    '<input type=radio name="radRE" value="voters" '+(kkREshowall==2?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'Showall\',2,'+(isWeb?'\'\'':60)+',\'reSpecial\')">+Voters&nbsp; '+
    '<input type=radio name="radRE" value="business" '+(kkREshowall==3?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'Showall\',3,'+(isWeb?'\'\'':60)+',\'reSpecial\')">+Businesses'+
    (! isWeb || kkREshowall>=4?'&nbsp; '+
    '<input type=radio name="radRE" value="K-12" '+(kkREshowall==4?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'Showall\',4,'+(isWeb?'\'\'':60)+',\'reSpecial\')">+K-12':'')+
    (! isWeb || kkREshowall>=5?'&nbsp; '+
    '<input type=radio name="radRE" value="verbose" '+(kkREshowall==5?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'Showall\',5,'+(isWeb?'\'\'':60)+',\'reSpecial\')">Verbose':'');
  return kkOptionMsg ;
};

function LIBoptionPopupText() {
  if ( typeof isLIB == udf || typeof kkRotateBG == udf || typeof kkMarble == udf || typeof kkMenuSize == udf ) return '';

  if (isKookie) kkMenuSize = parseInt(getOtherKookies(kkBase+'MenuSize'));
  if ( ! kkMenuSize ) kkMenuSize=12;
   
  return ''+
    'BACKGROUND&nbsp;&nbsp;  '+
    '<input type=radio name="radBG" value="Off" '+(kkRotateBG==99?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'xPgBG\', 99, 30, 0)">Off&nbsp;&nbsp; '+
    '<input type=radio name="radBG" value="Seal" '+(kkRotateBG==1?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'xPgBG\', 1, 30, 0)">Seal&nbsp;&nbsp; '+
    '<input type=radio name="radBG" value="Grey" '+(kkRotateBG==2?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'xPgBG\', 2, 30, 0)">Pattern'+

    '<br>BANNER&nbsp;&nbsp; '+
    '<input type=radio name="radGM" value="off" '+(kkMarble?'':'CHECKED')+
      ' onclick="setKookie(kkBase+\'Marble\',0,\'\',0)">Text&nbsp;&nbsp; '+
    '<input type=radio name="radGM" value="-" '+(kkMarble?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'Marble\',1,\'\',0)">Marble'+

    '<br>'+
    (kkMenuSize<11?'<font color=gray>':'')+
      'Smaller '+
    (kkMenuSize<11?'</font>'
      :'<input type=radio name="radMS" value="-" '+
        ' onclick="setKookie(kkBase+\'MenuSize\','+(kkMenuSize-2)+',100, \'g\')">'
    )+
    '&nbsp; MENU SIZE is '+kkMenuSize+'pt.&nbsp; '+
    (kkMenuSize>15?'<font color=gray>'
      :'<input type=radio name="radMS" value="+" '+
        ' onclick="setKookie(kkBase+\'MenuSize\','+(kkMenuSize+2)+',100, \'g\')">'
    )+'Larger'+
    (kkMenuSize>15?'</font>':'')+

    '<br>MENU FONT:&nbsp;&nbsp; '+
    '<input type=radio name="radMF" value="Hat" '+(kkMenuFont?'':'CHECKED')+
      ' onclick="setKookie(kkBase+\'MenuFont\',0,\'\',\'g\')">Haettenschweiler&nbsp;&nbsp; '+
    '<input type=radio name="radMF" value="ArN" '+(kkMenuFont==3?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'MenuFont\',3,\'\',\'g\')">ArialNarrow&nbsp;&nbsp; '+
    '<input type=radio name="radMF" value="ArNB" '+(kkMenuFont==4?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'MenuFont\',4,\'\',\'g\')">ArialNarrowBold&nbsp;&nbsp; '+
    '<br><input type=radio name="radMF" value="Ar" '+(kkMenuFont==1?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'MenuFont\',1,\'\',\'g\')">Arial&nbsp;&nbsp; '+
    '<input type=radio name="radMF" value="ArB" '+(kkMenuFont==2?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'MenuFont\',2,\'\',\'g\')">ArialBold&nbsp;&nbsp;'+
    '<input type=radio name="radMF" value="Kr" '+(kkMenuFont==5?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'MenuFont\',5,\'\',\'g\')">Kristen&nbsp;&nbsp;'+
    '<input type=radio name="radMF" value="KrB" '+(kkMenuFont==6?'CHECKED':'')+
      ' onclick="setKookie(kkBase+\'MenuFont\',6,\'\',\'g\')">KristenBold';
};

function CalOptionsPopupText(){
// Kill cal options in Options box if set in caltosidebar.js called from Home page.
  if ( UsingSidebarCal_NoOptions ) return ''; 
// for calendar page
  xCur=new Date();
  if (typeof CalCmdLineArgs != udf ) { // Is this a calendar page
    kkCalMsgAddOns = '<br><input type=radio name="wholeMo" value="1" '+
      'onclick="location.href=\''+iAm+'.htm?'+(mySpecial?'D':'')+(isExpress?'X':'')+(xCur.getMonth()+1)+'+'+forceMonths+'\'">Show Whole Current Month';
// with 'D'
    if ( mySpecial ) kkCalMsgAddOns += '&nbsp; '+
      '<input type=radio name="wholeMo" value="2" '+
      'onclick="location.href=\''+iAm+'.htm?'+(mySpecial?'D':'')+(isExpress?'X':'')+'1+12\'">Show Current Year&nbsp; '+
      '<input type=radio name="wholeMo" value="3" '+
      'onclick="location.href=\''+iAm+'.htm?'+(mySpecial?'D':'')+(isExpress?'X':'')+(xCur.getMonth()+1)+'+12\'">Show 12 months';
    return kkCalMsgAddOns;    
// for update page
  } else if ( typeof calCheck != udf ) { // Is this a calendar update page
    return '<br>'+
    '<input type=radio name="wholeMo" value="2" '+
    'onclick="document.forms.StdForm.oPener.value = \''+opener.location.href.split('?')[0] + '?'+(mySpecial?'D':'')+(isExpress?'X':'')+'1+12\'">Show Current Year&nbsp; '+
    '<input type=radio name="wholeMo" value="3" '+
    'onclick="document.forms.StdForm.oPener.value = \''+opener.location.href.split('?')[0] + '?'+(mySpecial?'D':'')+(isExpress?'X':'')+(xCur.getMonth()+1)+'+12\'">Show 12 months';
  } else return '';
};

function writeLHT_BG(){
// alert(typeof kkRotateBG+' '+kkRotateBG+' '+Math.abs(kkRotateBG) ) 
  switch ( Math.abs(kkRotateBG) ) {
    case 1: 
      if (WWid > 900) { bgpn=50;bgpv=30;bgph=310;} else { bgpn=33;bgpv=50;bgph=285;};
      document.write('<style type="text/css">body{background:url( "'+pixPath+'brnz'+bgpn+'a.jpg" ) no-repeat fixed '+bgph+'px '+ bgpv+'px }</style>');
      break;  
    case 2: 
      document.write('<style type="text/css">body{background:url( "'+pixPath+'millgtn_faded.jpg" ) no-repeat fixed }</style>');
      break;  
    case 3: 
      document.write('<style type="text/css">body{background:url( "'+pixPath+'belltowerfaded.jpg" ) no-repeat fixed }</style>');
      break;  
    case 4: 
      document.write('<style type="text/css">body{background:url( "'+pixPath+'meyersville_faded.jpg" ) no-repeat fixed }</style>');
      break;  
  };
  if (kkRotateBG > 0 && kkRotateBG != 99) {
    kkRotateBG = kkRotateBG%4 +1; 
    setKookie(kkBase+'xPgBG', kkRotateBG, 30 );
  };
};

function overloadLHTStyle(){
  if (! isKookie) return;
  mFo = parseInt(getOtherKookies(kkBase+'LhtFont'));
  switch (mFo) {
    case 1 : preFont='Times New Roman,'; fudge=1.08; break;
    case 2 : preFont='Garamond,'; fudge=1.1; break;
    default: return;
  };
  document.write('<style type="text/css">'+
'.v6 { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*60)+'%; color:#000000; text-decoration:none; }'+
'.v8 { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*75)+'%; color:#000000; text-decoration:none; }'+
'.v8h { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*75)+'%; color:#000000; text-decoration:none; }'+
'.v8h:hover { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*75)+'%; color:#ff0000; text-decoration:none; }'+
'.v8w { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*75)+'%; color:#ffffff; text-decoration:none; }'+
'.v10 { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*95)+'%; color:#000000; text-decoration:none; }'+
'.v10generic { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*95)+'%;}'+
'.v12 { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*115)+'%; color:#000000; text-decoration:none; }'+
'.v14 { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*130)+'%; color:#000000; text-decoration:none; }'+
'.v14NarNoUL { font-family:'+preFont+'Arial Narrow,Arial,Helvetica; font-size:'+(fudge*130)+'%; color:#000000; text-decoration:none; }'+
'.vNarNoUL { font-family:'+preFont+'Arial Narrow,Arial,Helvetica; color:#000000; text-decoration:none; }'+
'.v4 { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*30)+'%; color:#ffffff; text-decoration:none; }'+
'.v4bis { font-size:'+(fudge*30)+'%; color:#ffffff; text-decoration:none; }'+
'.v16 { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*150)+'%; color:#000000; text-decoration:none; }'+
'.v18 { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*180)+'%; color:#000000; text-decoration:none; }'+
'.v20 { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*200)+'%; color:#C00000; text-decoration:none; }'+
'.v20b { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*200)+'%; color:#0000C0; text-decoration:none; }'+
'.v26 { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*260)+'%; color:#009000; text-decoration:none; }'+
'.v10c { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*95)+'%; color:#000000; text-decoration:none; text-align: center }'+
'.v10g { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*95)+'%; color:#888888; text-decoration:none; } '+
'.v12g { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*115)+'%; color:#888888; text-decoration:none; } '+
'.v8gb { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*75)+'%; color:#000000; background-color:#cccccc; text-decoration:none; }'+
'.v10gb { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*95)+'%; color:#000000; background-color:#cccccc; text-decoration:none; }'+
'.v10cg { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*95)+'%; color:#888888; text-decoration:none; text-align: center } '+
'.h8 { font-family:'+preFont+'Arial,Helvetica; font-size:'+(fudge*75)+'%; color:#000000; background-color:yellow; text-decoration:none; }'+
'.h { font-family:'+preFont+'Arial,Helvetica; color:#000000; background-color:yellow; text-decoration:none; }'+
'.hb { font-family:'+preFont+'Arial,Helvetica; color:#000000; background-color:#e0c060; text-decoration:none; }'+
'.hg { font-family:'+preFont+'Arial,Helvetica; color:#000000; background-color:lightgreen; text-decoration:none; }'+
  '</style>');
};

function writeLIB_BG(){
// alert(typeof kkRotateBG+' '+kkRotateBG+' '+Math.abs(kkRotateBG) ) 
  switch ( Math.abs(kkRotateBG) ) {
    case 1: 
      if (WWid > 900) { bgpn=50;bgpv=30;bgph=310;} else { bgpn=33;bgpv=50;bgph=285;};
      document.write('<style type="text/css">body{background:url( "'+pixPath+'brnz'+bgpn+'a.jpg" ) no-repeat fixed '+bgph+'px '+ bgpv+'px }</style>');
      break;  
    case 99: 
      document.write('<style type="text/css">body{background:url( "'+pixPath+'whit.jpg" ) no-repeat fixed }</style>');
      break;  
  };
};

function overloadLIBMenuStyle(){
  if (! isKookie) return;
  mSz = parseInt(getOtherKookies(kkBase+'MenuSize'));
  mFo = parseInt(getOtherKookies(kkBase+'MenuFont'));
  if ( ! mSz ) mSz=12;
  preFont='';
  if ( mFo == 2 || mFo == 4 || mFo == 6 ) fontWt=' font-weight: bold; '; else fontWt='';
  switch (mFo) {
    case 4 : 
    case 3 : preFont='Arial Narrow,';
    case 2 :
    case 1 : preFont+='Arial,';break;
    case 5 :
    case 6 : preFont+='"Kristen ITC",Arial,';break;
  };
//  alert(mFo+' '+preFont)
  document.write('<style type="text/css">'+
    '.here { font-family:'+preFont+'Haettenschweiler,Arial Narrow,Helvetica,Arial; font-size:'+mSz+'pt; '+fontWt+'color:#ff00a0; text-decoration:none; }'+
    '.menu { font-family:'+preFont+'Haettenschweiler,Arial Narrow,Helvetica,Arial; font-size:'+mSz+'pt; '+fontWt+'color:#0000ff; text-decoration:none; }'+
    '.menu2 { font-family:'+preFont+'Haettenschweiler,Arial Narrow,Helvetica,Arial; font-size:'+mSz+'pt; '+fontWt+'color:#0000ff; text-decoration:none; }'+
    '.menu3 { font-family:'+preFont+'Haettenschweiler,Arial Narrow,Helvetica,Arial; font-size:'+mSz+'pt; '+fontWt+'color:#0000ff; text-decoration:none; }'+
  '</style>');
  
};

function overloadSplitTimer(kKey){
  if (! isKookie) return;
  nameStr = getOtherKookies(kkBase+kKey);
  if (typeof nameStr == 'object' ) nameStr =nameStr[0];
  if (nameStr) nameStr=nameStr.replace(/\^*$/,'^').replace(/\^X\^/g,'^');
  return nameStr;
};

function writeSplitTimer(kKey){
  nameStr='';
  with ( document.timers ) {
    if (typeof txt3 != udf ) nameStr+=txt3.value+'^';
    if (typeof txt4 != udf ) nameStr+=txt4.value+'^';
    if (typeof txt5 != udf ) nameStr+=txt5.value+'^';
    if (typeof txt6 != udf ) nameStr+=txt6.value+'^';
    if (typeof txt7 != udf ) nameStr+=txt7.value+'^';
    if (typeof txt8 != udf ) nameStr+=txt8.value+'^';
    if (typeof txt9 != udf ) nameStr+=txt9.value+'^';
    if (typeof txt10 != udf ) nameStr+=txt10.value+'^';
    if (typeof txt11 != udf ) nameStr+=txt11.value+'^';
    if (typeof txt12 != udf ) nameStr+=txt12.value+'^';
    if (typeof txt13 != udf ) nameStr+=txt13.value+'^';
    if (typeof txt14 != udf ) nameStr+=txt14.value+'^';
    if (typeof txt15 != udf ) nameStr+=txt15.value+'^';
    if (typeof txt16 != udf ) nameStr+=txt16.value+'^';
    if (typeof txt17 != udf ) nameStr+=txt17.value+'^';
    if (typeof txt18 != udf ) nameStr+=txt18.value+'^';
    if (typeof txt19 != udf ) nameStr+=txt19.value+'^';
  };
//  alert(kkBase+kKey+' '+nameStr)
  setKookie(kkBase+kKey, nameStr, 999 );
};
