$(document).ready(function(){

	$('#forgottenPassword.hide').hide();
	$('a.sendPassword').click(function() {
		$('#forgottenPassword').slideDown();
	});

});

function SkryjZobraz(id)
{
    var prvek;
     
    if (prvek = document.getElementById(id)){
          
        if (prvek.style.display=="none"){
            prvek.style.display="block";
        }
        else {
            prvek.style.display="none";
        }
    }
}

$(document).ready(function(){

    $("#jquery-animation").cycle({
        fx:    'fade',
        speed:   3000,
        timeout: 6000
    });
      
    $("#seopaticka a").addClass("popup");
    $("#copyright a").addClass("popup");
      
    $(document).pngFix();
      
      
      
    $("#main-img a").addClass("lightbox");
    $(".dalsi-obrazek a").addClass("lightbox");
      
    $('.lightbox').lightBox({
        fixedNavigation:true,
        imageLoading: 'http://www.nextmama.cz/scripts/lightbox-jquery/images/lightbox-ico-loading.gif',
        imageBtnClose: 'http://www.nextmama.cz/scripts/lightbox-jquery/images/lightbox-btn-close.gif',
        imageBtnPrev: 'http://www.nextmama.cz/scripts/lightbox-jquery/images/lightbox-btn-prev.gif',
        imageBtnNext: 'http://www.nextmama.cz/scripts/lightbox-jquery/images/lightbox-btn-next.gif'
    });
      
      
    // search form
    var searchInputValue = $(".search .text").val();
    
    $(document).click(function(){
        if( $(".search .text").val() == ""){
            $(".search .text").val(searchInputValue);
        }
    });
      
    $(".search .text").click(function(){
        return false;
    });
      
    $(".search .text").focus(function(){
        if(searchInputValue == $(".search .text").val()){ 
            $(".search .text").val("");
        }
    });

    $("a.dokoncitSubmit").click(function(){
        $("#appendix form").submit();
        return false;
    });
      

});



/* --- rozklikavani menu bez reloadu ---

      $(".level1 a").not($(".level2").children()).click(function(){
        $(this).parent().children("ul:first").slideToggle();
        $(this).parent().toggleClass("opened");
        return false;
      });

      $(".level2").not($(".level3").children()).click(function(){
        // jde rozbalit?
        if ($(this).children("ul").is("ul")){
          $(this).children("ul:first").slideToggle();
          $(this).addClass("openable_open");
          $(this).css("color", "red");
          //$(this).toggleClass("subopened");
          return false;
        }
        //$(this).addClass("openable_close");
        alert('go / level2');
        return true;
      });

      $(".level3 a").click(function(){
        alert('go / level3');
        location.href=this.href;
        return false;
      });
 */
 
// "javascript bez javascriptu" - otevirani odkazu v novem okne - v html pro odkaz pouzijeme class="popup"

function aktualizujOdkazy() {
    if(!document.getElementsByTagName) return false;
    var links = document.getElementsByTagName("a");
    for (var i=0; i < links.length; i++) {
        if(links[i].className.match("popup")) {
            links[i].onclick = function () {
                return !window.open(this.href);
            }
        }
    }
}
window.onload=aktualizujOdkazy;

function translateCategory( cat )
{
    switch(cat)
    {
        case 'product':
            return 'Produkty';
        case 'manufacturer':
            return 'Značky';
        case 'category':
            return 'Kategorie';
        case 'more':
            return 'Zobrazit další výsledky&hellip;';
    }
  
    return '';
}

