function checkFields(val1, val2, val3) {
    var tel = $("#" + val1).val().trim();
    var email = $("#" + val2).val().trim();

    if (tel == '' && email == '') {
        alert('Proszę wypełnić przynajmniej jedno z powyższych pól');
    } else {
        var contetntLog = "";
        if (tel != "" && email != ""){
            contetntLog = "telefon+email";
        } else if (tel != "" ){
            contetntLog = "telefon";
        } else {
            contetntLog = "email";
        }     
        
        _gaq.push(['_trackEvent', 'Akcja', 'Lead', contetntLog]);
        $("#" + val3).submit();
    }
}

function doLoginBox(callerId){
    var baseUrl = $("base").attr("href");
    var currentPath = window.location.href;
    var trimmedPath = currentPath.replace(baseUrl,"/");

    //use trimmedPath to send only part of path
    _gaq.push(['_trackEvent', 'Akcja', 'Zaloguj', currentPath]);
    $("#login_form").submit();
}
