// JavaScript Document

function checkNewsForm()

{

    with (window.document.frmNews) {
	if (isEmpty(katBerita)) {

			alert('Silakan pilih kategori berita');

			katBerita.focus();

			return;

		} else	if (isEmpty(txtTitle)) {

			alert('Harap masukan judul');

			txtTitle.focus();

			return;

		} else if (isEmpty(mtxContent)) {

			alert('Isi berita tidak boleh kosong');

			mtxContent.focus();

			return;

		} else {

			submit();

		}

	}

}

function checkArtForm()

{

    with (window.document.frmArticle) {
	if (isEmpty(cboCategory)) {

			alert('Silakan pilih kategori artikel');

			cboCategory.focus();

			return;

		} else	if (isEmpty(txtTitle)) {

			alert('Harap masukan judul');

			txtTitle.focus();

			return;

		} else if (isEmpty(mtxContent)) {

			alert('Isi berita tidak boleh kosong');

			mtxContent.focus();

			return;

		} else {

			submit();

		}

	}

}

function addNews(news_ID)

{

	targetUrl = 'index.php?view=add';

	if (news_ID != 0) {

		targetUrl += '&news_ID=';

	}

	

	window.location.href = targetUrl;

}



function modifyNews(news_ID)

{

	window.location.href = 'index.php?view=modify&news_ID=' + news_ID;

}



function deleteNews(news_ID)

{

	if (confirm('Deleting news ??...\nContinue anyway?')) {

		window.location.href = 'processNews.php?action=delete&news_ID=' + news_ID;

	}

}



function deleteImage(news_ID)

{

	if (confirm('Delete this image?')) {

		window.location.href = 'processNews.php?action=deleteImage&news_ID=' + news_ID;

	}

}
function checkForumForm()

{

    with (window.document.frmForum) {
	if (isEmpty(cboCategory)) {

			alert('Silakan pilih kategori forum');

			cboCategory.focus();

			return;

		} else	if (isEmpty(txtTitle)) {

			alert('Harap masukan judul');

			txtTitle.focus();

			return;

		} else if (isEmpty(mtxContent)) {

			alert('teks area tidak boleh kosong');

			mtxContent.focus();

			return;

		} else {

			submit();

		}

	}

}