function setLeseprobe(){
    var leseprobe = $('#leseproben_stoerer');
    var stoerer_w = $('#leseproben_stoerer img').width();
    var stoerer_h =$('#leseproben_stoerer img').height();
    var img_w = $('#detailImageLink img').width();
    var img_h =$('#detailImageLink img').height();
    /*console.log("stoerer_w: " + stoerer_w);
    console.log("stoerer_h: " + stoerer_h);
    console.log("img_w: " + img_w);
    console.log("img_h: " + img_h);*/
    leseprobe.css({'top':img_h - stoerer_h,'left':img_w - stoerer_w})
}

jQuery(function($) {
    setLeseprobe();
});


var defaultSearchString = "Suchbegriff / Titel / Autor / ISBN / EAN";

function checkSearchInput() {
    if ($('input#inputSearch').val() == defaultSearchString) {
        $('input#inputSearch').val('');
    }
    return true;
}

$(document).ready(function(){


    $("#WarenkorbImage, #MerkzettelImage, #DruckfrischeNeuheitenImage")
    .mouseover(function(){
        $(this).attr("src", $(this).attr("src").replace(/.gif/, "_mo.gif"));
    })
    .mouseout(function(){
        $(this).attr("src", $(this).attr("src").replace(/_mo.gif/, ".gif"));
    })

    $("#WeitereBuchhaendlerTippsImage, #ZuMeinerBuchhandlungImage")
    .mouseover(function(){
        $(this).attr("src", $(this).attr("src").replace(/.jpg/, "_mo.jpg"));
    })
    .mouseout(function(){
        $(this).attr("src", $(this).attr("src").replace(/_mo.jpg/, ".jpg"));
    })


    // Clear Inputfields on Focus
    if ($('input#inputSearch').val() == "") {
        $('input#inputSearch').val(defaultSearchString);
        $('input#inputSearch').css('color','#878787');
    }

    $('input#inputSearch').focus(function() {
        var value=$(this).val();

        if (value == defaultSearchString) {
            $(this).val("");
            $('input#inputSearch').css('color','#000');
        }
    });
    $('input#inputSearch').blur(function() {
        if($(this).val()==="") {
            $(this).val(defaultSearchString);
            $('input#inputSearch').css('color','#878787');
        }
    });

});

