package classes.matuto.utils.model
{
	public class Extension
	{
		
		public static const IMAGE :String = "image";
		public static const SWF   :String = "swf";
		public static const VIDEO :String = "video";
		public static const SOUND :String = "sound";
		public static const DATA  :String = "data";
		
		public static function getExtension(value :String) :String
		{
			return value.substr(-3).toLowerCase()
		}
		
		public static function getType(value :String) :String
		{
			var extension :String = getExtension(value);
			
			var type :String = "";
			
			if(extension=="jpg" || extension=="gif" || extension=="png") type = IMAGE;
			if(extension=="flv" || extension=="f4v") type = VIDEO;
			if(extension=="mp3") type = SOUND;
			if(extension=="swf") type = SWF;
			if(!type) type = DATA;
			
			return type;
		}
		
	}
}