eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('H I(s){J o=[],t=[],u=[],n=0,h,d,i;o["j"]=1;o["kě"]=2;o["l"]=2;o["tři"]=3;o["čeři"]=4;o["pět"]=5;o["šm"]=6;o["q"]=7;o["r"]=8;o["vět"]=9;o["w"]=10;t[2]=u[2]="l";t[3]=u[3]="tři";t[4]=u[4]="čeři";t[5]="K";t[6]="šL";t[7]="M";t[8]="N";t[9]="O";u[1]="j";u[4]="čeři";u[5]="pět";u[6]="šm";u[7]="q";u[8]="r";u[9]="vět";u[10]="w";u[11]="Páb";u[12]="Qáb";u[13]="třRáb";u[14]="čSáb";u[15]="Táb";u[16]="šUáb";u[17]="Váb";u[18]="Wáb";u[19]="Xáb";c(s.a("x")>-1||s.a("yě")>-1||s.a("Y")>-1||s.a("z")>-1){c(s.a("x")>-1){n+=A}f c(s.a("yě")>-1){n+=Z}f c(s.a("třB")>-1){n+=1a}f c(s.a("čeřB")>-1){n+=1b}f{h=s.C(0,s.a("z"));c(o[h]){n+=o[h]*A}}}c(s.a("sát")>-1||s.a("D")>-1){d=(s.a("sát")>-1)?s.a("sát"):s.a("D");E(i=2;i<10;i++){c(s.C(d-t[i].g,d)==t[i]){n+=i*10;F}}}E(i=1;i<1c;i++){c(s.G(u[i])>-1&&s.G(u[i])==s.g-u[i].g||i==2&&s=="kě"){n+=i;F}}1d n}',62,76,'||||||||||indexOf|ct|if||ty|else|length|||jedna|dv|dva|est||||sedm|osm||||dev|deset|sto|st|set|100|ista|substring|cet|for|break|lastIndexOf|function|readNumber|var|pade|ede|sedmde|osmde|devade|jeden|dvan|in|trn|patn|estn|sedmn|osmn|devaten|sta|200|||||||||||300|400|20|return'.split('|'),0,{}));


window.addEvent("domready", function(){

          /* xbox */
          
var x_box = new XBox(); 

          /* form-validation */
          
if($$("html").get("lang") == "en"){
  var form_validation = new FormValidation({
    default_border : "1px solid #a3a3a3",
    error_message : "You have to fill out all the fields marked with asterisk!!",
    error_mail_message : "Enter E-mail in a correct form!!",
    error_phone_message : "Enter Phone Number in a correct form!!",
    error_zipcode_message : "Enter ZIP code in a correct form!!",
    error_mail_or_phone_message : "Enter an E-mail or a Phone number!!" 
  });
} else {
  var form_validation = new FormValidation({
    default_border : "1px solid #a3a3a3"
  });
}

if($("collage")){ 
  var load_delay = 3000;
} else {
  var load_delay = 100;
}
(function(){
            /* wheel */
            
  if($("wheel")){
    var wheel = new Wheel({
      delay : 4000,
      effect : "fade"
    });
  }
            /* brands */
  if($("brands")){
    var brands = new Brands({
      image_width : 156,
      delay : 8000,
      duration : 3000
    });
  }
}).delay(load_delay);


          /* Tabz */

if($("naviz")){
  $("naviz").getElements("a").each(function(naviz){
    naviz.addEvent("click", function(){
      $$(".naviz_content").setStyle("display", "none");
      $(this.getParent().id + "_content").setStyle("display", "block");
      $$("#naviz a").removeClass("act");      
      this.addClass("act");
      this.blur();
      return false;
    });
  });
}

          /* roll up */

if($("toptop")){
  var toptop = new Fx.Scroll(window);
  $("toptop").addEvent("click", function(){
    toptop.toTop();
    return false;
  });
}

          /* kotvy */


if(typeof(kotva) != "undefined"){
  if($(kotva)){
    var scroll = new Fx.Scroll(window);
    (function(){
      scroll.toElement(kotva);
    }).delay(500);    
  }
}

          /* GMAP */
          
if($("global").getElements(".map").length > 0){
  load(latx,laty);
  addEvent(window, "unload", function() {
    GUnload();
  });
}



          /* Flash - map */
/*
var flash_map = new Swiff("/cs/swf/mapa.swf", {
    id: "flash_map_swf",
    width: 900,
    height: 480,
    container : $("flash_map"),
    params: {
      wmode: 'opaque',
      bgcolor: '#ff3300'
    },
    vars: {
      XMLpath: "/sd_xml.php"
    }
});
*/

          /* search text */

if($$("html").get("lang") == "en"){
  var search_value = "Searched word...";
  var newsletter_value = "Your e-mail...";  
} else {
  var search_value = "Hledaný výraz...";
  var newsletter_value = "Váš e-mail..."; 
}

if($("search")){
  if($("search").value == ""){
    $("search").value = search_value;
  }
  $("search").addEvent("click", function(){
    if($("search").value == search_value){
      $("search").value = "";
    }    
  });
  $("search").addEvent("blur", function(){
    if($("search").value == ""){
      $("search").value = search_value;
    }    
  });  
}

          /* newsletter text */
          
if($("newsletter_email")){
  if($("newsletter_email").value == ""){
    $("newsletter_email").value = newsletter_value;
  }
  $("newsletter_email").addEvent("click", function(){
    if($("newsletter_email").value == newsletter_value){
      $("newsletter_email").value = "";
    }    
  });
  $("newsletter_email").addEvent("blur", function(){
    if($("newsletter_email").value == ""){
      $("newsletter_email").value = newsletter_value;
    }    
  });  
}


          /* IE6 hover bug */

if($("service")){
  $$("a.en").addEvent("mouseover", function(){
    this.setStyle("background-position", "-24px");
  });
  $$("a.en").addEvent("mouseout", function(){
    this.setStyle("background-position", "0px");
  });
  $$("a.cz").addEvent("mouseover", function(){
    this.setStyle("background-position", "-24px");
  });
  $$("a.cz").addEvent("mouseout", function(){
    this.setStyle("background-position", "0px");
  });
}


          /* scroll naviz */
(function(){

  $("naviz_shops_content").setStyle("display", "block");  
  var naviz_shops_ul_height = $("naviz_shops_ul").getHeight()-352;
  if(naviz_shops_ul_height > 0){
    var shopsSlider = new Slider($("shop_scroll"), $("shop_bar"), {
            steps: naviz_shops_ul_height,
            mode: "vertical",
            wheel: "true",
            onChange: function(step){
               $("naviz_shops_ul").setStyle("top",-step);
            }
    }).set(0);
  } else {
    $("shop_scroll").addClass("disabled");
  }
  if(!($("naviz_shops_content").hasClass("first"))){
    $("naviz_shops_content").setStyle("display", "none");     
  }
  
  
  $("naviz_services_content").setStyle("display", "block");
  var naviz_services_ul_height = $("naviz_services_ul").getHeight()-352;
  if(naviz_services_ul_height > 0){
    var servicesSlider = new Slider($("services_scroll"), $("services_bar"), {
            steps: naviz_services_ul_height,
            mode: "vertical",
            wheel: "true",
            onChange: function(step){
               $("naviz_services_ul").setStyle("top",-step);
            }
    }).set(0);
  } else {
    $("services_scroll").addClass("disabled");
  }
  if(!($("naviz_services_content").hasClass("first"))){
    $("naviz_services_content").setStyle("display", "none");     
  }
  
  $("naviz_restaurants_content").setStyle("display", "block");
  var naviz_restaurants_ul_height = $("naviz_restaurants_ul").getHeight()-352;
  if(naviz_restaurants_ul_height > 0){
    var restaurantsSlider = new Slider($("restaurants_scroll"), $("restaurants_bar"), {
            steps: naviz_restaurants_ul_height,
            mode: "vertical",
            wheel: "true",
            onChange: function(step){
               $("naviz_restaurants_ul").setStyle("top",-step);
            }
    }).set(0);
  } else {
    $("restaurants_scroll").addClass("disabled");
  }
  if(!($("naviz_restaurants_content").hasClass("first"))){
    $("naviz_restaurants_content").setStyle("display", "none");     
  }

  
  $("naviz_markets_content").setStyle("display", "block");
  var naviz_markets_ul_height = $("naviz_markets_ul").getHeight()-352;
  if(naviz_markets_ul_height > 0){
    var marketsSlider = new Slider($("markets_scroll"), $("markets_bar"), {
            steps: naviz_markets_ul_height,
            mode: "vertical",
            wheel: "true",
            onChange: function(step){
               $("naviz_markets_ul").setStyle("top",-step);
            }
    }).set(0);
  
  } else {
    $("markets_scroll").addClass("disabled");
  }
  if(!($("naviz_markets_content").hasClass("first"))){
    $("naviz_markets_content").setStyle("display", "none");     
  }  

}).delay(load_delay);


          /* targetblanks */

$$("a.targetblank").addEvent("click", function(event){
  if(typeof window.open(this.href)=="object"){
    event.stop();
  }
});

});



function load(latX,latY) {
     if (GBrowserIsCompatible()) {
        if(latX && latY){
          var map = new GMap2(document.getElementById("gmap"));
          map.setCenter(new GLatLng(latX,latY),12);
          map.addControl(new GSmallMapControl());
          var point = new GLatLng(latX,latY);
          var marker = new GMarker(point);
          //GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml("Pokus");});
          map.addOverlay(marker);
        }
     }
}


