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


				/* left_layer_banner */

if($("left_layer_banner")){
	$("left_layer_banner").addEvent("mouseenter", function(){
		if(!$("left_layer_banner").hasClass("act")){
			$("left_layer_banner").tween("width", 361);
			$("left_layer_banner").addClass("act")
		}
	});
	$("left_layer_banner").addEvent("mouseleave", function(){
		if($("left_layer_banner").hasClass("act")){
			$("left_layer_banner").tween("width", 31);
			$("left_layer_banner").removeClass("act")
		}
	});
}

				/* right_layer_banner */

if($("right_layer_banner")){
	$("right_layer_banner").addEvent("mouseenter", function(){
		if(!$("right_layer_banner").hasClass("act")){
			$("right_layer_banner").tween("width", 361);
			$("right_layer_banner").addClass("act")
		}
	});
	$("right_layer_banner").addEvent("mouseleave", function(){
		if($("right_layer_banner").hasClass("act")){
			$("right_layer_banner").tween("width", 31);
			$("right_layer_banner").removeClass("act")
		}
	});
}


	var tmp, q, w;

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

  new XBox();

  $("f_search").set("value","hledaný výraz").addEvent("focus",function(){if(this.value==="hledaný výraz"){this.value="";}}).addEvent("blur",function(){if(this.value===""){this.value="hledaný výraz";}});

  Cufon.replace("#home > h2,#fav h3,#why p,#why h3,#why label,#act h3,#bl h4,#cli h4,#rooth h1,#rl h1,#twoprod h3,#twoprod h4,#twoprod .probot,#twoprod .proprice,#midcol h3,#contest h3,#award h3,#photowhy h2,.ft h2,.ft a,#entext,#bigbuts,h2.h1,.bp a,#bigphoto p,.prod-box h3,.prod-box strong,#caltop h3,#buth a,#cals h3,#cals strong,#bform h2,#branches h3, #category_list .item h2, #category_list .item .actions .price,#download1 h1,#download1 p,#download2 li,#download3 h2, #partners_zip_search h2, .partners_list h3,#nejakyform h3,#fourprod h3,#fourprod h4,#fourprod .probot,#fourprod .proprice,#phelp h3, #rr .right_box h2, #rr .right_box h3");

  if($("strp")){
    var bans=$$("#strp a"),a=bans[0],b,c=new Element("div",{"id":"numbuts","html":'<div id="innumbuts"></div>'}),i=-1,toc=(function(){
i++;
if(i>=bans.length)i=0;
b.removeClass("act");
a.fade("out");
a=bans[i];
a.fade("in");
b=$("numbut"+(i+1));
b.addClass("act");
  
});
    $("strp").setStyle("overflow-x","hidden").addClass("js").adopt(c);
    $each(bans,function(el,idx){c.getFirst().adopt(new Element("span",{"class":"numbut","id":"numbut"+(idx+1),"html":(idx+1)+"<span></span>","events":{"click":function(){b.removeClass("act");a.fade("out");a=el;a.fade("in");b=$(this);b.addClass("act");i=idx;

window.clearInterval(window.iid);
window.clearTimeout(window.iiid);
window.iiid=window.setTimeout(function(){window.iid=window.setInterval(toc,7000);},7000);




}}}));});
    bans[0].fade("in");
    b=$("numbut1").addClass("act");

window.iid=window.setInterval(toc,7000);


  }
  
  
  tmp = $('accordion');
  
  	  
  	  
  if(tmp){
  var h=446;
  if(tmp.hasClass("thin"))h=219;
  	tmp.setStyles({'overflow':'hidden', 'height':h});
  	q = tmp.getElements('span.acc_button');
  	w = (958-(q.length*32))+'px';
  	if (Browser.Engine.trident) {
  		tmp.addClass('ie');
		}
  	tmp = new Fx.Accordion(q, tmp.getElements('div.banner-content').setStyle('width', w), {
			wait: true,
			height: false,
			width: true,
			duration: 500,
			opacity: false,
			transition: 'sine:in:out',
			fixedWidth: w,
			fixedHeight: h,
			display: 0,
			show: 1,
			displayTimer: null,
			onActive: function(toggler, container) {
				$clear(this.options.displayTimer);
				toggler.addClass('act');
			},
			onBackground: function(toggler, container) {
				toggler.removeClass('act');
			},
			onComplete: function(){
				$clear(this.options.displayTimer);
        this.options.displayTimer = this.display.delay(7000, this, (this.previous + 1) % this.togglers.length);
    }

				
		});

		tmp.display(0);

//    new Accordion({id:"accordion",items_settings:[{"left":0,"right":0},{"left":32,"right":797},{"left":64,"right":829},{"left":96,"right":861},{"left":128,"right":893},{"left":160,"right":925}]}); 
  }
  
  
  
  if($("nejakyform")){
  	  
  	  var adr=[];
  	  adr[0]=[];adr[1]=[];
  	  adr[0][0]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=51&new=true","Fotokalendář v plechové krabičce"];
  	  

adr[0][1]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?new=true&productId=6288&new=true","Nástěnný kalendář A2"];
adr[0][2]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=6285&new=true","Nástěnný kalendář A3"];
adr[0][3]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=6286&new=true","Nástěnný kalendář A3 panorama"];
adr[0][4]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=6284&new=true","Nástěnný kalendář A4"];
adr[0][5]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=6287&new=true","Čtvercový fotokalendář"];
adr[0][6]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=51&new=true","Fotokalendář v plechové krabičce"];




adr[1][0]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=51&new=true","Fotokalendář v plechové krabičce"];
adr[1][1]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=51&new=true","Nástěnný kalendář A4"];
adr[1][2]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=6281&new=true","Nástěnný kalendář A3"];
adr[1][3]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=6278&new=true","Nástěnný plánovací kalendář"];
adr[1][4]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=6283&new=true","Roční 1-listý plánovací kalendář"];
adr[1][5]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=6282&new=true","Kuchyňský a narozeninový kalendář"];
adr[1][6]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=6280&new=true","Stolní kalendář"];
adr[1][7]=["/fotokalendare-kalendare-z-fotografii/objednat-fotokalendar.html?url=https://as.photoprintit.de/web/84011466/productEditor.do?productId=6277&new=true","Stolní plánovací kalendář"];

  	  
  	  
  	  $("nejakyselect1").addEvent("change",function(){
  	    $("nejakyform").action=this.value;
  	  });
  	  
  	  $("nejakyselect2").addEvent("change",function(){
  	    var pole=adr[this.value];
  	    var sel=$("nejakyselect1");
  	    sel.options.length=0;
  	    for(var i=0;i<pole.length;i++){
  	      sel.options[sel.options.length]=new Option(pole[i][1],pole[i][0]);	
  	    }
  	  });
  	  
  	    var pole=adr[$("nejakyselect2").value];
  	    var sel=$("nejakyselect1");
  	    sel.options.length=0;
  	    for(var i=0;i<pole.length;i++){
  	      sel.options[sel.options.length]=new Option(pole[i][1],pole[i][0]);	
  	    }
  	  

$("nejakyform").action=$("nejakyselect1").value;

  	  
  	  }
  
  

         /* search text */

if($$("html").get("lang") == "en"){
  var search_value = "Search ZIP";
} else {
  var search_value = "zadejte PSČ";
}

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

if($("map_dealers")){
  $$("$map_dealers area").each(function(area){
    area.addEvent("mouseenter", function(){
      if(area.id == "map_stredocesky-kraj"){ 
        $("js_prague").setStyle("display", "block");
      } else {
        $("js_prague").setStyle("display", "none");
      }       	   
      $("js_hover").className = "map_hover " + area.id;
      $("js_hover").href = area.href;
    });
  });

  $("js_prague").addEvent("mouseenter", function(){
    $("js_hover").className = "map_hover map_hlavni-mesto-praha";
  })
  
  $("js_click").addEvent("mouseenter", function(){
      if($("js_click").hasClass("map_stredocesky-kraj")){ 
        $("js_prague").setStyle("display", "block");
      } else {
        $("js_prague").setStyle("display", "none");
      } 
  });
  
  if($("partners_region")){
    $$("#partners_region a").addEvent("mouseenter", function(){
      $("js_hover").className = "map_hover " + this.rel;
    })
    .addEvent("mouseout", function(){
      $("js_hover").className = "map_hover";
    });
  }
  
}


         /* vertical_slide */

if($("vertical_slide")){
  var myVerticalSlide = new Fx.Slide("vertical_slide");
  myVerticalSlide.hide();
  if($("vertical_slide_toggle")){
    $('vertical_slide_toggle').addEvent('click', function(event){
      event.stop();
      myVerticalSlide.toggle();
    });
  }
}


if($('win1')){
  $('win1').addEvent('click', function(event){
    (function() {
      window.location.href = 'http://www.fotostar.cz/offline-client/win.html';
    }).delay(3000);
  });
}
if($('win2')){
  $('win2').addEvent('click', function(event){
    (function() {
      window.location.href = 'http://www.fotostar.cz/offline-client/win.html';
    }).delay(1000);
  });
}
if($('win3')){
  $('win3').addEvent('click', function(event){
    (function() {
      window.location.href = 'http://www.fotostar.cz/offline-client/win.html';
    }).delay(1000);
  });
}
if($('mac1')){
  $('mac1').addEvent('click', function(event){
    (function() {
      window.location.href = 'http://www.fotostar.cz/offline-client/mac.html';
    }).delay(1000);
  });
}
if($('mac2')){
  $('mac2').addEvent('click', function(event){
    (function() {
      window.location.href = 'http://www.fotostar.cz/offline-client/mac.html';
    }).delay(1000);
  });
}
if($('mac3')){
  $('mac3').addEvent('click', function(event){
    (function() {
      window.location.href = 'http://www.fotostar.cz/offline-client/mac.html';
    }).delay(1000);
  });
}
if($('lin1')){
  $('lin1').addEvent('click', function(event){
    (function() {
      window.location.href = 'http://www.fotostar.cz/offline-client/lin.html';
    }).delay(1000);
  });
}
if($('lin2')){
  $('lin2').addEvent('click', function(event){
    (function() {
      window.location.href = 'http://www.fotostar.cz/offline-client/lin.html';
    }).delay(1000);
  });
}
if($('lin3')){
  $('lin3').addEvent('click', function(event){
    (function() {
      window.location.href = 'http://www.fotostar.cz/offline-client/lin.html';
    }).delay(1000);
  });
}


});



/*
function recordOutboundLink(link, tracked) {
  try {
    var pageTracker=_gat._getTracker("UA-10721439-2");
    pageTracker._trackPageview(tracked);
    setTimeout('document.location = "' + link.href + '"', 100)
  }catch(err){}
}
*/

function recordOutboundLink(link, tracked) {
	_gaq.push(['_trackPageview', tracked]);
	if (link.target == '_blank') {
		/* odkaz ma JS return true, proto neni potreba timeout */
	} else {
		setTimeout('document.location = "' + link.href + '"', 100);
	}
}















