// JavaScript Document




$(document).ready(function(){
  /*
  $('#g1').mbGallery({overlayBackground:'#f0f0f0', overlayOpacity:.8, 
      containment:".ImageGalleryTreml",
      cssURL:"http://www.pflanzen-treml.de/css/gallery/",
      skin:"white",
      exifData:false, //todo

      galleryTitle:"Sonstiges",
      imageSelector: ".imgFull",
      thumbnailSelector: ".imgThumb",
      titleSelector: ".imgTitle",
      descSelector: ".imgDesc",

      minWidth: 300,
      minHeight: 200,
      maxWidth: 0,
      maxHeight: 0,
      fullScreen:true,
      addRaster:false,
      startFrom: 0,//"random"
      fadeTime: 500,
      slideTimer: 6000,
      autoSlide: true,

      onOpen:function(){},
      onBeforeClose:function(){},
      onClose:function(){},
      onChangePhoto:function(){}
 
  });
  */
  if ($("#g1").length > 0) {
    $('#g1').mbGallery({overlayBackground:'#f0f0f0', overlayOpacity:.8, galleryTitle:"Sonstiges", slideTimer: 4000 });
  }
  $("#GotoPlantArticle, #GotoSeedArticle").hover(
    function() {$(this).css({"backgroundColor":"#ccc"})},
    function() {$(this).css({"backgroundColor":"transparent"})}
  );
  
  $(".Article").hover(
    function() {$(this).css({"backgroundColor":"#ECEEEE", "borderColor":"none", "borderColor":"#e6e6e6"}).find("div").css({"color":"#333"})},
    function() {$(this).css({"backgroundColor":"#e6e6e6", "borderColor":"#ccc", "borderStyle":"solid"}).find("div").css({"color":"black"})}
  );
  

  $("#ShowcaPasswd").click(function() {
  
    var pwd = $("#caPasswd").val();
    
    if ($("#caPasswd").attr("type") == "password") { 
      $("#caPasswd").replaceWith("<input maxlength='"+$("#caPasswd").attr("maxlength")+"' value='"+pwd+"' type='text' name='"+$("#caPasswd").attr("name")+"' id='caPasswd' />");
    }
    else {
      $("#caPasswd").replaceWith("<input maxlength='"+$("#caPasswd").attr("maxlength")+"' value='"+pwd+"' type='password' name='"+$("#caPasswd").attr("name")+"' id='caPasswd' />");
    }
  
  })

  $("#ShowcaPasswdContinue").click(function() {
  
    var pwd = $("#caPasswdContinue").val();
    
    if ($("#caPasswdContinue").attr("type") == "password") { 
     
      $("#caPasswdContinue").replaceWith("<input maxlength='"+$("#caPasswdContinue").attr("maxlength")+"' value='"+pwd+"' type='text' name='"+$("#caPasswdContinue").attr("name")+"' id='caPasswdContinue' />");
    }
    else {
      $("#caPasswdContinue").replaceWith("<input maxlength='"+$("#caPasswdContinue").attr("maxlength")+"' value='"+pwd+"' type='password' name='"+$("#caPasswdContinue").attr("name")+"' id='caPasswdContinue' />");
    }
  
  })




  $(".neuePflanzenArtikel").hover(
            function() {
              $(this).css({"backgroundColor":"#ccc", "border":"1px solid green"});
            },
            function() {
              $(this).css({"backgroundColor":"transparent", "border":"1px solid #ccc"});
            }
  );


 /* Buecher Startseite */
  $("#Startseite #Buecher .Content .Books").hover(
    
    function(){
      var infotext = "";
      
      if ($(this).attr("id") == "Book02") infotext = "Heilkraft aus dem Garten <span style='font-size:10px;'>f&uuml;r nur</span> <span style='font-size:16px;'>&euro; 14,95</span>";
      if ($(this).attr("id") == "Book01") infotext = "Kr&auml;uter aus dem Garten <span style='font-size:10px;'>f&uuml;r nur</span> <span style='font-size:16px;'>&euro; 12,95</span>";
      if ($(this).attr("id") == "Book03") infotext = "Geheimnisse im Kr&auml;utergarten <span style='font-size:10px;'>f&uuml;r nur</span> <span style='font-size:16px;'>&euro; 8,80</span>";
      if ($(this).attr("id") == "Book04") infotext = "Heilkraft aus Heilpflanzen <span style='font-size:10px;'>f&uuml;r nur</span> <span style='font-size:16px;'>&euro; 4,90</span>";
      if ($(this).attr("id") == "Book05") infotext = "Exotische Kr&auml;uter <span style='font-size:10px;'>f&uuml;r nur</span> <span style='font-size:16px;'>&euro; 14,95</span>";
      $("#Startseite #Buecher .Content #ArticleInfo").html(infotext).fadeIn(1000, function() { $(this).show(); } );
      //$("#Startseite #Buecher .Content #ArticleInfo");
    },
    function(){
      $("#Startseite #Buecher .Content #ArticleInfo").hide();//fadeOut("fast", function() { $(this).html(""); } );
      //$("#Startseite #Buecher .Content #ArticleInfo");
    }
  );
  

  $("#ContentTop .lm").animate({"opacity": 0.4
                                }, 1500);



/* Ende der FUNKTION */
});


