// JavaScript Document
function viewNews()
{
	with (window.document.frmListNews) {
		if (cboCountry.selectedIndex != 0) {
/*			window.location.href = 'index.php';
		} else {*/
			window.location.href = 'index.php?count=' + cboCountry.options[cboCountry.selectedIndex].value;
		}
	}
}

function checkAddNewsForm()
{
	with (window.document.frmAddNews) {
		if (isEmpty(txtnewstitle, 'Enter news title', true)) {
			return;
		} else {
			submit();
		}
	}
}

function addNews(qstr)
{
	qstr = (qstr!="")?"&"+qstr:qstr;
	window.location.href = 'index.php?view=add' + qstr;
}

function modifyNews(newsId, qstr)
{
	qstr = (qstr!="")?"&"+qstr:qstr;
	window.location.href = 'index.php?view=add&news=' + newsId + '&bck=1'+qstr;
}

function deleteNews(newsId, qstr)
{
	qstr = (qstr!="")?"&"+qstr:qstr;
	if (confirm('Delete this news?')) {
		window.location.href = 'processNews.php?action=delete&news=' + newsId + qstr;
	}
}

function deleteSelectedNews(frm, qstr)
{
	qstr = (qstr!="")?"&"+qstr:qstr;
	if(confirmdelcheckeditems('News(s)',frm)){
		frm.action="processNews.php?action=delselected" + qstr;
		frm.submit();
	}
}

function publishSelectedNews(frm,qstr)
{
	qstr = (qstr!="")?"&"+qstr:qstr;
	if(confirmpubcheckeditems('News(s)',frm)){
		frm.action="processNews.php?action=pubselected"+qstr;
		frm.submit();
	}
}

function unpublishSelectedNews(frm,qstr)
{
	qstr = (qstr!="")?"&"+qstr:qstr;
	if(confirmunpubcheckeditems('News(s)',frm)){
		frm.action="processNews.php?action=unpubselected"+qstr;
		frm.submit();
	}
}

function deleteNewsImage(newsId,imageId)
{
	if (confirm("Delete this image")) {
		window.location.href = "processNews.php?action=deleteImage&news=" + newsId + "&img=" + imageId;
	}
}