// clear function
function clear() {
    this.value = "";
}

// submit check function
function submit_check() {
    returnValue = true;
    $('#signUpForm input.required').each(function() {
        if (this.value == "") {
            returnValue = false;
            this.parentNode.parentNode.style.background = '#ff0000';
        }
        else {
            this.parentNode.parentNode.style.background = 'transparent';
        }
    });
    
    return returnValue;
}

function submit_check_sk() {
    returnValue = submit_check();
    if (returnValue == false) alert("Nevyplnili ste všetky povinné položky!");
    return returnValue;
}

function submit_check_en() {
    returnValue = submit_check();
    if (returnValue == false) alert("You did not fill all required fields!");
    return returnValue;
}

// jQuery lightbox
$(function() {
    // jQuery lightbox
    $('a.singlePhoto').livequery(function() {
        $(this).lightBox();
    });
    $('a.galleryPhoto').livequery(function() {
        $('a.galleryPhoto').lightBox();
    });
    
    //
    $('input.fileInput').livequery('change', function(event) {
        // .val() doesn't work in Opera
        //$(this).clone(true).val('').insertAfter($('<br />').insertAfter(this));
        $('<input class="fileInput" name="file[]" type="file" />').insertAfter($('<br />').insertAfter(this));
    });
});
