if((location.protocol.indexOf("http") > -1) && (location.host.indexOf('hledamdivkuzautobusudobrna.com') > -1) && (location.host.indexOf("www") < 0)) location.href= "http://www.hledamdivkuzautobusudobrna.com" + location.pathname + location.search + location.hash;

if(location.search.indexOf("?global") > -1) location.href= "http://www.hledamdivkuzautobusudobrna.com" + location.pathname + location.hash;

if(self != top) top.location.href = self.location.href;

 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;
 }

 function upravKomentare() {
  kht = document.getElementById('vsechnykomentare').innerHTML;
  kre = /\[([0-9]+)\]/g;
  kht = kht.replace(kre, "[<a href='#komentar$1'>$1</a>]");
  kre = /(>http:\/\/.*?)</gi;
  kht = kht.replace(kre, function($0, $1) { if($1.length > 43) { return $1.substr(0,40)+"...<"} else {return $1+"<"}});
  kre = /([^\w\d])(\*)(.+?)\2([^\w\d])/gi;
  kht = kht.replace(kre, "$1<em>$3</em>$4");
  kre = /(\[<a href="#komentar)([0-9]+)/gi;
  kht = kht.replace(kre, "$1$2\" title=\"Pøímý odkaz na komentáø èíslo $2");
  document.getElementById('vsechnykomentare').innerHTML = kht;
 }

 function powerPend(beforeStart,afterStart,beforeEnd,afterEnd,tagName,attrStr) {
  var b,r,attrStr1=attrStr2='',i,n;
  for(i=5;i<arguments.length;i++) {
   attrStr1 += '('+arguments[i]+')';
   attrStr2 += '$'+(i-3);
  }
  n = arguments.length-5;
  b = document.getElementsByTagName('body')[0].innerHTML;
  r = new RegExp("<"+tagName+"([^>]*?)"+attrStr1+"([^>]*)>(.*?)<\/"+tagName+">","gi");
  b = b.replace(r,beforeStart+'<'+tagName+'$1'+attrStr2+'$'+(n+2)+'>'+afterStart+'$'+(n+3)+beforeEnd+'</'+tagName+'>'+afterEnd);
  document.getElementsByTagName('body')[0].innerHTML = b;
 }  

 function gOutbound() {
  // change outbound links
  anchors = document.getElementsByTagName("a");
  for(i=0 ;i<anchors.length;i++) {
   if((anchors[i].href.indexOf("http://") == 0) && (anchors[i].href.indexOf("hledamdivkuzautobusudobrna.com") < 0))
    anchors[i].setAttribute("onclick","urchinTracker('/outbound_link/"+anchors[i].href.replace(/^http:\/\//i,"")+"')");
  }
 }

 function gSetup() {
  // set properties
  _uacct = "UA-82719-1";

  if((document.referrer.length > 10) && (document.referrer.indexOf("http://www.hledamdivkuzautobusudobrna.com") != 0)) {
   __utmSetVar("Cookie: "+document.cookie);
   __utmSetVar("Referrer: "+document.referrer);
  }
  
  var _uOsr=new Array();
  var _uOkw=new Array();
  var _uMyLen=0;
  // Globální
  _uOsr[_uMyLen]="alice";       _uOkw[_uMyLen++]="qs";
  _uOsr[_uMyLen]="alltheweb";   _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="altavista";   _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="aol";         _uOkw[_uMyLen++]="query";
  _uOsr[_uMyLen]="aol";         _uOkw[_uMyLen++]="encquery";
  _uOsr[_uMyLen]="ask";         _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="excite";      _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="gigablast";   _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="google";      _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="live.com";    _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="looksmart";   _uOkw[_uMyLen++]="qt";
  _uOsr[_uMyLen]="lycos";       _uOkw[_uMyLen++]="query";
  _uOsr[_uMyLen]="msn";         _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="netscape";    _uOkw[_uMyLen++]="s";
  _uOsr[_uMyLen]="search.com";  _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="virgilio";    _uOkw[_uMyLen++]="qs";
  _uOsr[_uMyLen]="voila";       _uOkw[_uMyLen++]="kw";
  _uOsr[_uMyLen]="wisenut";     _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="yahoo";       _uOkw[_uMyLen++]="p";
  // Metasearch
  _uOsr[_uMyLen]="clusty";      _uOkw[_uMyLen++]="query";
  _uOsr[_uMyLen]="hotbot";      _uOkw[_uMyLen++]="query";
  _uOsr[_uMyLen]="mamma";       _uOkw[_uMyLen++]="query";
  _uOsr[_uMyLen]="vivisimo";    _uOkw[_uMyLen++]="query"; 
  // Ne tak docela vyhledavaèe
  _uOsr[_uMyLen]="about.com";   _uOkw[_uMyLen++]="terms";
  _uOsr[_uMyLen]="cnn";         _uOkw[_uMyLen++]="query"; 
  // Lokální
  _uOsr[_uMyLen]="baidu";       _uOkw[_uMyLen++]="wd";
  _uOsr[_uMyLen]="euroseek";    _uOkw[_uMyLen++]="string";
  _uOsr[_uMyLen]="yandex";      _uOkw[_uMyLen++]="text";
  // Èeské
  _uOsr[_uMyLen]="1.cz";        _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="atlas.cz";    _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="caramba.cz";  _uOkw[_uMyLen++]="Text";
  _uOsr[_uMyLen]="centrum.cz";  _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="divoch.net";  _uOkw[_uMyLen++]="text";
  _uOsr[_uMyLen]="jyxo.cz";     _uOkw[_uMyLen++]="s";
  _uOsr[_uMyLen]="klikni";      _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="najduvse";    _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="opendir.cz";  _uOkw[_uMyLen++]="cohledas";
  _uOsr[_uMyLen]="seznam.cz";   _uOkw[_uMyLen++]="w";
  _uOsr[_uMyLen]="tiscali.cz";  _uOkw[_uMyLen++]="query";
  _uOsr[_uMyLen]="toplist.cz";  _uOkw[_uMyLen++]="search";
  _uOsr[_uMyLen]="volny.cz";    _uOkw[_uMyLen++]="search";
  _uOsr[_uMyLen]="zacatek.cz";  _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="zdroj.cz";    _uOkw[_uMyLen++]="q";
  _uOsr[_uMyLen]="zoohoo.cz";   _uOkw[_uMyLen++]="q";
  // Slovenské
  _uOsr[_uMyLen]="atlas.sk";    _uOkw[_uMyLen++]="phrase";
  _uOsr[_uMyLen]="azet.sk";     _uOkw[_uMyLen++]="sq";
  _uOsr[_uMyLen]="szm.sk";      _uOkw[_uMyLen++]="WS";
  _uOsr[_uMyLen]="zoznam.sk";   _uOkw[_uMyLen++]="s";
  //_uOsr[_uMyLen]="";            _uOkw[_uMyLen++]="";
  urchinTracker();
 }
 gSetup();

 function strtr(sf,st) {
  ss = this.toString();
  if(typeof sf == "undefined") sf = "ÄÁÆÈÏËÉÌÍ¥ÒÖÔÓÀØ¦©«ÜÚÙÝ®äáæèïëéìíµòöôóàø¶¹»üúùý¾";
  if(typeof st == "undefined") st = "AACCDEEEILNOOORRSSTUUUYZaaccdeeeilnooorrsstuuuyz";
  if(typeof sf != "string") return ss;
  if(typeof st != "string") return ss;
  smax = Math.min(sf.length, st.length);
  for(i = 0; i < smax; i++) {
    sreg = new RegExp(sf.substring(i, i+1), "g");
    ss = ss.replace(sreg,st.substring(i, i+1));
  }
  return ss;
 }
 if(String.strtr != "function") String.prototype.strtr = strtr;

 function toAscii() {
  sf = "ÄÁÆÈÏËÉÌÍ¥ÒÖÔÓÀØ¦©«ÜÚÙÝ®äáæèïëéìíµòöôóàø¶¹»üúùý¾";
  st = "AACCDEEEILNOOORRSSTUUUYZaaccdeeeilnooorrsstuuuyz";
  ss = this.replace(/(\u2014|\u2013)/g,"-").replace(/\u00A0/g," ").replace(/(\u2019|\u2018|\u201A|\u201B|\u2032)/g,"'").replace(/(\u201C|\u201D|\u201E|\u2033|\u00AB|\u00BB)/g,'"').strtr(sf, st);
  return ss;
 }
 if(String.toAscii != "function") String.prototype.toAscii = toAscii;

 function toplist(tid) {
  if(parseInt(tid) < 1) {tid = 74861;}
  tref = escape(top.document.referrer);
  ttit = (typeof encodeURIComponent == "function") ? encodeURIComponent(document.title.toAscii()) : escape(document.title.toAscii());
  tdot = 'http://toplist.cz/dot.asp?id='+tid+'&http='+tref+'&t='+ttit;
  timg = new Image(1,1);
  timg.src = tdot;
 }
 toplist("74861");

 window.onload = function() {
  if(document.all && !window.opera) {
   powerPend('','&#x201E;','&#x201C;','','q');
   powerPend('','<span $2>','</span>','','abbr','[^>]+');
  }
  if(location.pathname.indexOf('_zaznam.html') > 0) {
   upravKomentare(); 
  }
  newStyle = parseInt(document.cookie.replace(/style=([0-9]+)/i,'$1'))
  newStyle = (!isFinite(newStyle)) ? setStyle(0) : setStyle(newStyle);
  if(screen.height < 700)
   document.getElementById('kabat').style.backgroundImage = "none";
  gOutbound();
 }
