function validateForm(opt)
{
	if(obj.media_type.selectedIndex == 0)
	{
		alert("Please select the Type for which you're uploading media file.");
		obj.media_type.focus();
		return;
	}
	if(obj.media_name.value == "")
	{
		alert("Please enter a name for the media.");
		obj.media_name.focus();
		return;
	}
	if(obj.media_file.value == "")
	{
		alert("Please upload a media file.");
		obj.media_file.focus();
		return;
	}
		obj.action = 'manage_media.php?opt='+opt;
		obj.submit();
}

function confirmDelete(media_id, type)
{
	if(confirm("Are you sure to delete the Media File?"))
	{
		self.location = "manage_media.php?opt=delete&id="+media_id+"&type="+type;
	}
}
