
function checkValid(frm)
{
	with(frm)
	{
		if(vUserName.value=="")
		{
			alert(JS_MSG_USERNAME);
			vUserName.focus();
			return false;
		}
		if(vPassword.value=="")
		{
			alert(JS_MSG_PASSWORD);
			vPassword.focus();
			return false;
		}
	}
	frm.submit();
	return true;
}
function addArtileContent(val,iArticleId)
{
//	alert(val+","+iArticleId);
	var url;
	if(val=="Image"){
		window.location = "index.php?file=m-makeacontribution&eContentType=Image&eResearchWork=No&iArticleId="+iArticleId+"&eFrom=articlecontentadd";
	}else if (val == "Video"){
		window.location = "index.php?file=m-makeacontribution&eContentType=Video&eResearchWork=No&iArticleId="+iArticleId+"&eFrom=articlecontentadd";
	}else if (val=="Audio"){
		window.location = "index.php?file=m-makeacontribution&eContentType=Audio&eResearchWork=No&iArticleId="+iArticleId+"&eFrom=articlecontentadd";
	}
	
	return false;
}

function checkStatus(eStatus)
{
	y = getCheckCount();
	if(y == ""){
		alert("Please select record(s) to "+eStatus);
		return false;
	}else{
		if(!confirm("Are you sure want to "+eStatus+" selected record(s)?"))
			return false;
	}
	document.frmlist.mode.value = eStatus;
	document.frmlist.submit();
}
function getCheckCount()
{	
	var x=0;
	var checked_Arr = "";
	for(i=0; i<document.frmlist.elements.length; i++)
	{	
		if (document.frmlist.elements[i].id == 'iId' && document.frmlist.elements[i].checked == true) 
		{
			checked_Arr += document.frmlist.elements[i].value+",";
			x++;
		}
	}
	checked_Arr = checked_Arr.substring(0,checked_Arr.length -1);
	return checked_Arr;
}
