// http://www.janedoe.cz/common/features.js # v 1.2 # 2005-12-27 14:20:00 # garcon

/* Urchin

_uacct = "UA-82719-2";

var len = _uOsr.length;
_uOsr[len]="seznam.cz";       _uOkw[len]="w";
_uOsr[len+1]="centrum.cz";    _uOkw[len+1]="q";
_uOsr[len+2]="jyxo.cz";       _uOkw[len+2]="s";
_uOsr[len+3]="atlas.cz";      _uOkw[len+3]="q";
_uOsr[len+4]="zoohoo.cz";     _uOkw[len+4]="q";
_uOsr[len+5]="tiscali.cz";    _uOkw[len+5]="query";
_uOsr[len+6]="1.cz";          _uOkw[len+6]="q";
_uOsr[len+7]="volny.cz";      _uOkw[len+7]="search";

urchinTracker();

*/

// Ostatni

function Poskryvat() {
  var pDivy;
  var pTexty = new Array();
  pDivy = document.getElementsByTagName("div");
  for(i = 0; i < pDivy.length; i++) {
    if(pDivy[i].className.indexOf("text") > -1) {
      pTexty.push(pDivy[i]);
    }
  }
  for(i = 0; i < pTexty.length; i++) {
    pTexty[i].style.display = (i > 4) ? "none" : "block";
  }
}


function frmCheck(frm) {
  if(frm.txt.value.replace(/[^0-9a-z\x80-\xFF]/gi,'').length < 1) {
    alert("Zlato, nesty\u010F se a pov\u011Bz mi n\u011Bco.\n(Vypl\u0148 pole *Text:*).");
    frm.txt.select();
    return false;
  } else {
    if(frm.url.value.length > 60) {
      alert("Bloguje.cz neum\u00ED ud\u011Blat odkaz nad 60 znak\u016F. Zkuste ho zkr\u00E1tit.");
      return false;
    }
    frm.sub.disabled = true;
    frm.sub.value = "Odes\u00EDl\u00E1\u00E1\u00E1\u00E1\u00E1m.";
    a = "frm.sub.disabled = false;";
    a += "frm.sub.value = 'Zkuzte to za moment znovu.';"
    setTimeout("eval("+a+")",3000);
    return true;
  }
}

function urlBlur(myURL) {
  if(myURL.value.length > 60)
    alert("Bloguje.cz neum\u00ED ud\u011Blat odkaz nad 60 znak\u016F. Zkuste ho zkr\u00E1tit.");
}

if((location.protocol.indexOf("http") > -1) && (location.host.indexOf('janedoe.cz') > -1) && (location.host.indexOf('www') < 0)) location.href="http://www.janedoe.cz" + location.pathname + location.search + location.hash;

 function setStyle(newStyle) {
  newStyle = parseInt(newStyle);
  sheets = document.styleSheets;
  if((newStyle < 0) || (newStyle > sheets.length-1) || !isFinite(newStyle))
   newStyle = 0;
  var expDate = new Date();  expDate.setTime( expDate.getTime() + 365*24*60*60*1000 );
  document.cookie = "style=" + newStyle + "; expires=" + expDate.toGMTString();
  for(i=0;i<sheets.length;i++){
   sheets[i].disabled = (i == newStyle) ? false : true;
  }
  document.getElementById('knoflik').setAttribute('title', 'Aktivní: '+sheets[newStyle].title+'. Následuje: '+sheets[(1+newStyle<sheets.length)?1+newStyle:0].title+'. Celkem: '+sheets.length+'.');
  return ++newStyle;
 }

 window.onload = function() {
  newStyle = parseInt(document.cookie.replace(/style=([0-9]+)/i,'$1'))
  newStyle = (!isFinite(newStyle)) ? setStyle(0) : setStyle(newStyle);
  Poskryvat();
  /* divyBluzky = document.getElementById('bluzka').getElementsByTagName('div');
  prvniSpot = 0;
  for(i in divyBluzky) {
    if(!divyBluzky[i].className) {
      continue;
    }
    if(divyBluzky[i].className.indexOf('spot')>-1 && divyBluzky[i].className.indexOf('archiv')>-1 ) {
      if(++prvniSpot == 1) {
        continue;
      }
      divySpotu = divyBluzky[i].getElementsByTagName('div');
      for(y in divySpotu) {
        if(!divySpotu[y].className) {
          continue;
        }
        if(divySpotu[y].className.indexOf('text')>-1) {
          divySpotu[y].style.display='none';
          break;
        }
      }
    continue;
    }
  } */
 }

 /*
   divySpotu = document.getElementById('bluzka').getElementsByTagName('div');
  prvniSpot = 0;
  for(i in divySpotu) {
    if(divySpotu[i].className.indexOf('spot') != divySpotu[i].className.indexOf('archiv')) {
      prvniSpot += 1;
      prvkySpotu = divySpotu[i].getElementsByTagName('div');
      for(y in prvkySpotu) {
        if(prvkySpotu[y].className.indexOf('text')>-1) {
          prvkySpotu[y].style.display='none';
        }
      }
    }
  }

 */

