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(){

        /* roll_top (collage) */

if($("collage")){
  var collage = new RollTop({
    id : "collage", 
    prev_id : "collage_nav_right",
    next_id : "collage_nav_left",
    height : 386,
    delay : 4000,
    stop_wheeling : "false"
  });
}

        /* products */

if($("products")){
  var products = new Roll({
    id : "products_wheeler", 
    prev_id : "products_right",
    next_id : "products_left",
    crop_width : 652,
    item_width : 652,
    item_width_addend : 0,
    visible_items : 1,
    effect : "fade",
    stop_wheeling : "true"
  });
}

        /* events calendar */

if($("events")){
  var events = new Roll({
    id : "events_wheeler", 
    prev_id : "events_right",
    next_id : "events_left",
    crop_width : 807,
    item_width : 269,
    item_width_addend : 0,
    visible_items : 3,
    duration : "normal",
    transition : "quad:out",
    stop_wheeling : "true"
  });
}

        /* news archive */

if($("news_archive")){
  if($("home_rcol")){
    $("home_rcol").addEvent("mouseenter", function(){
      $("news_archive").setStyle("visibility", "visible");
    });
    $("home_rcol").addEvent("mouseleave", function(){
      $("news_archive").setStyle("visibility", "hidden");
    });
  }
}

if($$("html").get("lang") != "ru"){

            /* cufon START */
  if (Cufon && Cufon.replace) {
  	Cufon.replace('#home_rcol h2, #navi span span, #navi a span, #products h2, #products h3, #products .more, #calendar .h3, #calendar .day, .wysiwyg h1, h1.wsw, .wysiwyg h2, h2.wsw, .wysiwyg h3, #rcol .box h2, #lcol .box h2, #lcol .box p, #rcol .box_2 h2, #rcol .box_2 p, h2.cufonize, p.cufonize, h3.cufonize');
  	/* -- all the changes? -- */
  }

}

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


          /* form-validation */
          
var form_validation = new FormValidation({
    default_border : "0px",
    error_border : "1px solid #B3071B",
    error_background : "#B3071B"
});

          /* targetblanks */

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

         /* search text */

if($$("html").get("lang") == "en"){
  var search_value = "Search term";
  var newsletter_value = "email";
} else if($$("html").get("lang") == "ru"){
  var search_value = "?????";
  var newsletter_value = "email";
} else {
  var newsletter_value = "email";
  var search_value = "Hledaný text";
}

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

if($("presentation_select")){
  $("presentation_select").addEvent("mouseenter", function(){
    $("presentation_select_list").setStyle("display", "block"); 
    $("presentation_select").addClass("act")
  })
  .addEvent("mouseleave", function(){
    $("presentation_select_list").setStyle("display", "none"); 
    $("presentation_select").removeClass("act")
  });
  $("presentation_select_list").addEvent("mouseenter", function(){
    $("presentation_select_list").setStyle("display", "block"); 
    $("presentation_select").addClass("act")
  })
  .addEvent("mouseleave", function(){
    $("presentation_select_list").setStyle("display", "none"); 
    $("presentation_select").removeClass("act")
  });
}

        /* gmap */

if($("gmap1")){
    var gmap1 = new google.maps.Map($("gmap1"), {
      zoom: 13,
      center: new google.maps.LatLng(gmap1_x, gmap1_y),
      scrollwheel: false,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });
    var gmap1_marker = new google.maps.Marker({
          position: new google.maps.LatLng(gmap1_x, gmap1_y), 
          map: gmap1
      });   
}

if($("gmap2")){
    var gmap2 = new google.maps.Map($("gmap2"), {
      zoom: 13,
      center: new google.maps.LatLng(gmap2_x, gmap2_y),
      scrollwheel: false,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });
    var gmap2_marker = new google.maps.Marker({
          position: new google.maps.LatLng(gmap2_x, gmap2_y), 
          map: gmap2
      });   
}

if($("gmap3")){
    var gmap3 = new google.maps.Map($("gmap3"), {
      zoom: 13,
      center: new google.maps.LatLng(gmap3_x, gmap3_y),
      scrollwheel: false,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });
    var gmap3_marker = new google.maps.Marker({
          position: new google.maps.LatLng(gmap3_x, gmap3_y), 
          map: gmap3
      });   
}

if($("gmap4")){
    var gmap4 = new google.maps.Map($("gmap4"), {
      zoom: 13,
      center: new google.maps.LatLng(gmap4_x, gmap4_y),
      scrollwheel: false,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });
    var gmap4_marker = new google.maps.Marker({
          position: new google.maps.LatLng(gmap4_x, gmap4_y), 
          map: gmap4
      });   
}

if($("gmap5")){
    var gmap5 = new google.maps.Map($("gmap5"), {
      zoom: 13,
      center: new google.maps.LatLng(gmap5_x, gmap5_y),
      scrollwheel: false,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });
    var gmap5_marker = new google.maps.Marker({
          position: new google.maps.LatLng(gmap5_x, gmap5_y), 
          map: gmap5
      });   
}

if($("gmap6")){
    var gmap6 = new google.maps.Map($("gmap6"), {
      zoom: 13,
      center: new google.maps.LatLng(gmap6_x, gmap6_y),
      scrollwheel: false,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });
    var gmap6_marker = new google.maps.Marker({
          position: new google.maps.LatLng(gmap6_x, gmap6_y), 
          map: gmap6
      });   
}


/*
if($("static_box")){
  window.addEvent("scroll", function(){
    var scroll = window.getScroll();
    $("static_box").setStyle("top",scroll.y + 428);
  });
}
*/

          /* enquiry_form */

if($("enquiry_form")){
  if($$("#enquiry_form table input").length > 0){
    var table_inputs = $$("#enquiry_form table input");
    table_inputs.addEvent("click", function(){
      this.getParent().getParent().getElements("td").setStyle("background", "#83e579");
    });
  }
}

         /* input file */

$$('input[type=file]').filestyle();

if (collage) {
	$$('div.pf2011 a.htmlbox').addEvent('click', function() {
		this.clickWay = 'q';
		this.roll.addClass('stop_wheeling');
	}.bind(collage));
}


         /* popup screen */

if ($("all")){
  $("all").setStyle("width", window.getScrollWidth());
  $("all").setStyle("height", window.getScrollHeight());
  $$("#all, #all_box, #popup_content").setStyle("display","block");
  $$("#all, #all_box, #popup_content").addEvent("click", function(event){
    $$("#all, #all_box, #popup_content, #popup_content .popup_close").setStyle("display","none");
    return false;
  });
}


});


Element.implement({
	filestyle : function(options) {
		var ex,_filename,_wrapper;

		this.setProperty('value','');								
		_wrapper = new Element("span",{ // vytvori span.wrapper-file.filestyle, ktery obali cely input[type=file]
			'class':'wrapper-file',
			styles:{
				'display': "inline",
				'position': "relative",
				'overflow':'hidden'
			}
		}).addClass('filestyle');

		_filename = new Element("input",{ // vytvory input[type=text].filetext
			'class': this.getProperty("class"),
			'type': 'text',
			styles:{
				display: "inline",
				background:'#e1e2e2 url(/common/images/layout/background/input-file.png) no-repeat'
			}
		}).addClass('filetext');
	
		_filename.inject(this,'before'); // vlozi input (viz. vyse) pred originalni input[type=file]
		_wrapper.wraps(this);
	
		this.setStyles({
			position: "absolute",
			top: "0",
			fontSize:20,
			right:0,
			marginRight:25,
			display: "inline"
		}).set('opacity',0.05); // nastavi orig. input[type=file] opacity => je pruhledny, ale klikatelny
/*	
		if (Browser.Engine.gecko) {
			if (Browser.Platform.win) {
				this.setStyle("margin-left","0px");
			}
			else {
				this.setStyle("margin-left", "-20px");
			}
		}
		else {
			this.setStyle("margin-left", -4);
		}
*/
		this.addEvent("change", function(el) {
			el.set('value',this.get('value').split("\\").pop());
		}.bind(this,_filename));
		_filename.setStyle('visibility',"visible");
	}
});

