/* Yes, there are also server-side checks, this just cuts down on bandwidth. */
function submitVideo() {
var serror = 0;
var stitle = $.trim($('#v_title').val());
var ssource = $.trim($('#v_source').val());
var sembed = $.trim($('#v_embed').val());
var sdesc = $.trim($('#v_desc').val());
var icat = $('#cat_id').val();

if (stitle == '') {
   serror = 1;
} else if (ssource == '') {
   serror = 2;
} else if (sembed == '') {
   serror = 3;
} else if (sdesc == '') {
   serror = 4;
} else if (icat == '') {
   serror = 5;
}

if (serror == 0) {
$('input#sbsubmit').attr('disabled','disabled');
$('form#r_form').submit();
} else {
var arrErrors = [];
arrErrors[1] = 'You must have a title for your video, please be descriptive, but keep it short.';
arrErrors[2] = 'You must select a valid source for your video.';
arrErrors[3] = 'You must have valid embed code.';
arrErrors[4] = 'You must have a brief description of the video.';
arrErrors[5] = 'You must select a valid category.';
$('div#report').html('<p class="report-warning">' + arrErrors[serror] + '</p>');
return false;
}


}

function saveVideo() {
// Not needed yet
submitVideo();
}