﻿// JScript File
function validate_email(str) // REGEX Control to email addresses
{
	var reg = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/;
	return reg.test(str);
}

function validate_phone(str) // REGEX Control to phone number
{
	var reg = /^(\+420)? ?[0-9]{3} ?[0-9]{3} ?[0-9]{3}$/;
	return reg.test(str);
}

function validate_float(str) // REGEX Control to float numbertype
{
  var reg = /[0-9]+[,.]{1}[0-9]{1,2}/;
	return reg.test(str);
}

function validate_integer(str) // REGEX Control to integer numbertype
{
  var reg = /[0-9]+/;
	return reg.test(str);
}

function validate_psc(str) // REGEX Control to PSC "XXXXX"
{
  while (str.indexOf(" ") != -1) { str = str.replace(" ",""); }

  var reg = /\d{5}/;
	return reg.test(str);
}

function validate_ico(str) // REGEX Control to ICO
{
  var reg = /^([0-9]){3,8}$/;
	return reg.test(str);
}


