var fesco_upload = function ()
{
	this.validate = function (_this)
	{
		var _value = _this.photo.value;
		if(_value == '')
		{
			alert("Select Photo for Upload");
			return false;
		}
		var suffix;
		suffix = _value.substr((_value.length-3));
		if(suffix.toUpperCase() != 'JPG' && suffix.toUpperCase() !="GIF")
		{
			alert('Valid in JPG or GIF Format');
			return false;
		}
	}
	this.error = function (t)
	{
		var msg;
		switch (t)
		{
			case 1 :
			msg = "Upload Failed";
			case 2 :
			msg = "Please Sign In Before Upload";
			case 3 :
			msg = "Upload Failed";
			case 4 :
			msg = "Upload Failed";
			case 5 :
			msg = "Invalid Format or Exceed Maximum Size(200KB)";
		}
		alert(msg);
		return false;
	}
	this.success = function ()
	{
		alert('Upload Successful');
		window.location = location.href;
	}
}

var __fesco_upload = new fesco_upload();
