b1 = new Image(148,95)
b1.src = "template/images/btn_ofirmie.jpg"
b1r = new Image(148,95)
b1r.src = "template/images/btn_ofirmie_red.jpg"

b2 = new Image(132,95)
b2.src = "template/images/btn_oferta.jpg"
b2r = new Image(132,95)
b2r.src = "template/images/btn_oferta_red.jpg"

b3 = new Image(173,95)
b3.src = "template/images/btn_doswiadczenie.jpg"
b3r = new Image(171,95)
b3r.src = "template/images/btn_doswiadczenie_red.jpg"

b4 = new Image(165,95)
b4.src = "template/images/btn_kontakt.jpg"
b4r = new Image(165,95)
b4r.src = "template/images/btn_kontakt_red.jpg"

function changeImg(cImg,ref) {
    document.getElementById(cImg).src = ref.src
}

$(document).ready(function(){

    //$("ul.subnav").parent().hover(function() { //When trigger is clicked...
    $("#menuOferta").parent().hover(function() { //When trigger is clicked...

        //Following events are applied to the subnav itself (moving subnav up and down)
        $(this).parent().find("#menuOferta").slideDown(0).show(); //Drop down the subnav on click
        document.getElementById("btnOferta").src = "template/images/btn_oferta_red.jpg";

    //Following events are applied to the trigger (Hover events for the trigger)
    }).hover(function() {
        $(this).addClass("subhover"); //On hover over, add class "subhover"
    }, function(){	//On Hover Out
        $(this).removeClass("subhover"); //On hover out, remove class "subhover"
        $(this).parent().find("#menuOferta").slideUp(0, function(){document.getElementById("btnOferta").src = "template/images/btn_oferta.jpg"})
    });

});

$(document).ready(function(){

    //$("ul.subnav").parent().hover(function() { //When trigger is clicked...
    $("#menuOFirmie").parent().hover(function() { //When trigger is clicked...

        //Following events are applied to the subnav itself (moving subnav up and down)
        $(this).parent().find("#menuOFirmie").slideDown(0).show(); //Drop down the subnav on click
        document.getElementById("btnOfirmie").src = "template/images/btn_ofirmie_red.jpg";

    //Following events are applied to the trigger (Hover events for the trigger)
    }).hover(function() {
        $(this).addClass("subhover"); //On hover over, add class "subhover"
    }, function(){	//On Hover Out
        $(this).removeClass("subhover"); //On hover out, remove class "subhover"
        $(this).parent().find("#menuOFirmie").slideUp(0, function(){document.getElementById("btnOfirmie").src = "template/images/btn_ofirmie.jpg"})
    });

});

