//code for confirmation of flag operation
function confirmation(val)
{
	var mes='';
	if(val=='Unpublished by Admin')
		mes="Do you want to publish this record.";
	else if(val=='Published')
		mes="Do you want to unpublish this record";
	else if(val=='approval by admin')
		mes="Do you want to approve and publish this record";
	return confirm(mes);
}

//code for checking the image extension
function checkImageExtension(val,idName)
{
	if(val.length!=0)
	{
		if(val.indexOf(".")!=-1)
		{
			var ext=val.substring(val.lastIndexOf(".")+1);
			if(ext=="jpeg" || ext=="JPEG" || ext=="jpg" || ext=="JPG" || ext=="gif" || ext=="GIF" || ext=="png" || ext=="PNG")
			{
				return true;	
			}
			else
			{
				alert("Sorry! This type of image can't be uploaded.\nImages with following extensions are acceptable only:-\n.jpg, .jpeg, .gif, .png");	
				document.getElementById(idName).value="";
				document.getElementById(idName).focus();
				return false;		
			}
		}
		else
		{
			alert("Sorry! This type of image can't be uploaded.");	
			document.getElementById(idName).value="";
			document.getElementById(idName).focus();
			return false;
		}
	}
	else
	{
		return true;	
	}
}


