/** drukuj strone */
function pagePrint() {
    var pageUrl = document.location.href;
    var tPrintLink = '' + pageUrl + ( ( pageUrl.indexOf('?') > 0 ) ? '&' : '?' ) + '_view=print';
    var tWin = window.open( tPrintLink, 'print', 'scrollbars=yes,status=no,width=840,height=600' );
}
function clearForm(form) {
    $(':input', form).each(function() {
        var type = this.type;
        var tag = this.tagName.toLowerCase();

        if (type == 'text' || type == 'password' || tag == 'textarea')

            this.value = "";
        else if (type == 'checkbox' || type == 'radio')
            this.checked = false;

        else if (tag == 'select')
            this.selectedIndex = -1;
    });
};
$(document).ready(function() {
    /** submit formularza */
    $("form.anchorSubmitForm a.goSubmit").click(function(){
        $(this).parent().submit();
        return false;
    });
    /** drukowanie */
    $('a.print').click(function(){
        pagePrint();
        return false;
    });
    $('input.czysc').click(function(){
        clearForm($(this).closest("form"));
        return false;
    });
    $('#prevSmallPicture').click(function(){
        prev();
        return false;
    });
    $('#nextSmallPicture').click(function(){
        next();
        return false;
    });
});
