function updateTips(o, t) {
    o.text(t)
    if (t != '') { o.effect("highlight", {}, 500); }
}

function checkLength(o, tips, n, min, max) {
    if (o.val().length > max || o.val().length < min) {
        o.addClass('ui-state-error');
        if (min == max) {
            updateTips(tips, n + " " + min + " haneli olmalıdır.");
        }
        else {
            updateTips(tips, n + " enaz " + min + " ençok " + max + " karakter olabilir.");

        } return false;
    } else {
        return true;
    }
}

function checkLength2(o, min, max) {
    if (o.val().length > max || o.val().length < min) {
        o.addClass('ui-state-error');
        return false;
    } else {
        o.removeClass('ui-state-error');
        return true;

    }
}

function checkRegexp(o, tips, regexp, n) {
    if (!(regexp.test(o.val()))) {
        o.addClass('ui-state-error');
        updateTips(tips, n);
        return false;
    } else {
        return true;
    }
}

function checkRegexp2(o, regexp) {
    if (!(regexp.test(o.val()))) {
        o.addClass('ui-state-error');
        return false;
    } else {
        o.removeClass('ui-state-error');
        return true;
    }
}
