/**
 * @Copyright CSSJockey - Web Design and Development
 * @Website: http://www.cssjockey.com
 * @Terms of Use: http://www.cssjockey.com/terms-of-use
 * If you change the contents below sky will fall on your head!
 */
$(document).ready(function(){
    $(".appsmugform p.fields > *").focus(function(){
        $(".appsmugform p.fields").removeClass('highlight');
        $(this).parent().addClass("highlight");
    })

$('#appexcerpt').keyup(function(){
    limitChars('appexcerpt', 200, 'charlimitinfo');
})
})

function limitChars(textid, limit, infodiv){
    var text = $('#'+textid).val();
    var textlength = text.length;
    if(textlength > limit){
        $('#' + infodiv).html('You cannot write more then '+limit+' characters!');
        $('#'+textid).val(text.substr(0,limit));
        return false;
    }else{
        $('#' + infodiv).html('You have '+ (limit - textlength) +' characters left.');
        return true;
    }
}

DD_roundies.addRule('.round', 5, true);