text: function browserSupportFileUpload() {
  	var isCompatible = false;
  	if (window.File && window.FileReader && window.FileList && window.Blob) {
  	isCompatible = true;
  	}
  	return isCompatible;
  }
  function splitCSVtoCells(row, separator) {
      return row.split(separator);
  }
  function download_file(url) {
  	window.location.href = url;
  	return false;
  }
  function validateImage(fileInput){
      var filePath = fileInput.value;
      var allowedExtensions = /(\.jpg|\.jpeg|\.png|\.gif)$/i;
      if(!allowedExtensions.exec(filePath)){
          fileInput.value = '';
          return false;
      }
      return true;
  }
  function isValidEmailAddress(emailAddress) {
  	var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
  	return pattern.test(emailAddress);
  }
  function validatePhone(txtPhone) {
      var a = txtPhone;
      var filter = /^[0-9-+]+$/;
      if (filter.test(a)) {
          return true;
      }
      else {
          return false;
      }
  }
  function checkIsValidDomain(domain) { 
  	var re = new RegExp(/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$/);
  	if(!domain.match(re)){
  		
  		var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
  		return regexp.test(domain);
  	}
  	return domain.match(re);
  }
  function showMsgPop(msg, alert_type = 'danger') {
  	$("#message_pop_show").html('<div class="alert alert-'+alert_type+'">' +
  		'<button type="button" class="close" data-dismiss="alert">' +
  			'<i class="ace-icon fa fa-times"></i>'+
  		'</button>'+ msg +'</div>');
  }
  function showMsg(msg, alert_type = 'danger') {
  	$("#message_show").html('<div class="alert alert-'+alert_type+'">' +
  		'<button type="button" class="close" data-dismiss="alert">' +
  			'<i class="ace-icon fa fa-times"></i>'+
  		'</button>'+ msg +'</div>');
  }
  var waitingDialog = waitingDialog || (function ($) {
      'use strict';
  
  	// Creating modal dialog's DOM
  	var $dialog = $(
  		'<div class="modal fade" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-hidden="true" style="padding-top:15%; overflow-y:visible;">' +
  		'<div class="modal-dialog modal-m">' +
  		'<div class="modal-content">' +
  			'<div class="modal-header"><h5 style="margin:0;"></h5></div>' +
  			'<div class="modal-body">' +
  				'<div class="progress progress-striped active" style="margin-bottom:0;"><div class="progress-bar" style="width: 100%"></div></div>' +
  			'</div>' +
  		'</div></div></div>');
  
  	return {
  		/**
  		 * Opens our dialog
  		 * @param message Custom message
  		 * @param options Custom options:
  		 * 				  options.dialogSize - bootstrap postfix for dialog size, e.g. "sm", "m";
  		 * 				  options.progressType - bootstrap postfix for progress bar type, e.g. "success", "warning".
  		 */
  		show: function (message, options) {
  			// Assigning defaults
  			if (typeof options === 'undefined') {
  				options = {};
  			}
  			if (typeof message === 'undefined') {
  				message = 'Loading';
  			}
  			var settings = $.extend({
  				dialogSize: 'm',
  				progressType: '',
  				onHide: null // This callback runs after the dialog was hidden
  			}, options);
  
  			// Configuring dialog
  			$dialog.find('.modal-dialog').attr('class', 'modal-dialog').addClass('modal-' + settings.dialogSize);
  			$dialog.find('.progress-bar').attr('class', 'progress-bar');
  			if (settings.progressType) {
  				$dialog.find('.progress-bar').addClass('progress-bar-' + settings.progressType);
  			}
  			$dialog.find('h5').text(message);
  			// Adding callbacks
  			if (typeof settings.onHide === 'function') {
  				$dialog.off('hidden.bs.modal').on('hidden.bs.modal', function (e) {
  					settings.onHide.call($dialog);
  				});
  			}
  			// Opening dialog
  			$dialog.modal();
  		},
  		/**
  		 * Closes dialog
  		 */
  		hide: function () {
  			$dialog.modal('hide');
  		}
  	};
  
  })(jQuery);