function setFileAndSubmit(fname) {
    document.edit.filename.value = fname;
    document.edit.submit();
}

function showNewCat() {
    $("#newcat").css({visibility: "visible"});
    document.addcat.addcategory.focus();
}

function editcat(catid, catname) {
    $("#cat" + catid).html('<td colspan="3"><form method="POST" action="projects.php" name="catedit"><input type="text" name="catname" value="' + catname + '" /><input type="hidden" name="catid" value="' + catid + '" /><input type="submit" value="Rename" /></form>');
    document.catedit.catname.focus();
}

function showAddClient() {
    $("#addclient").css({visibility: "visible"});
    document.addclientform.login.focus();
}

function initReel() {
    var vid=videos.shift();
    $("#content").load("video.php?id=" + vid);
}

function playNext() {
	try {
		if((x=videos.shift())) {
			$("#content").load("video.php?id=" + x);
		} else { location.href="/work.php"; }
	} catch(e) {
		location.href="/work.php";
	}

}
