function isValidVatno(vat, xcountry)
{
	var exp = null;
	var country = xcountry.substring(0,2);

	if(country == "SE") return true;

	/* Austria */
	if(country == "AT") {
		exp = /^U\d{8}$/;
	}

	/* Belgium */
	if(country == "BE") {
		exp = /^\d{9}$/;
	}

	/* Cyprus */
	if(country == "CY") {
		exp = /^\d{9}L$/;
	}

	/* Czech Republic */
	if(country == "CZ") {
		exp = /^\d{8}$/;
		if(exp.test(vat) == true) return true;
		exp = /^\d{9}$/;
		if(exp.test(vat) == true) return true;
		exp = /^\d{10}$/;
	}

	/* Denmark */
	if(country == "DK") {
		exp = /^\d{8}$/;
	}

	/* Estonia */
	if(country == "EE") {
		exp = /^\d{9}$/;
	}

	/* Finland */
	if(country == "FI") {
		exp = /^\d{8}$/;
	}

	/* France */
	if(country == "FR") {
		exp = /^.{2}\d{10}$/;
	}

	/* Germany */
	if(country == "DE") {
		exp = /^\d{9}$/;
	}

	/* Great Britain */
	if(country == "GB") {
		exp = /^\d{9}$/;
		if(exp.test(vat) == true) return true;
		exp = /^\d{12}$/;
		if(exp.test(vat) == true) return true;
		exp = /^GD\d{3}$/;
		if(exp.test(vat) == true) return true;
		exp = /^HA\d{3}$/;
	}

	/* Greece */
	if(country == "GR") {
		exp = /^\d{8}\d?$/;
	}

	/* Hungary */
	if(country == "HU") {
		exp = /^\d{8}$/;
	}

	/* Ireland */
	if(country == "IE") {
		exp = /^\d+.+\d{5}.+$/;
	}

	/* Italy */
	if(country == "IT") {
		exp = /^\d{11}$/;
	}

	/* Latvia */
	if(country == "LV") {
		exp = /^\d{11}$/;
	}

	/* Lithuania */
	if(country == "LT") {
		exp = /^\d{9}$/;
		if(exp.test(vat) == true) return true;
		exp = /^\d{12}$/;
	}

	/* Luxemburg */
	if(country == "LU") {
		exp = /^\d{8}$/;
	}

	/* Netherlands */
	if(country == "NL") {
		exp = /^\d{9}.+\d{2}$/;
	}

	/* Poland */
	if(country == "PL") {
		exp = /^\d{10}$/;
	}

	/* Portugal */
	if(country == "PT") {
		exp = /^\d{9}$/;
	}

	/* Spain */
	if(country == "ES") {
		exp = /^.+\d{7}.+$/;
	}

	/* Slowenia */
	if(country == "SI") {
		exp = /^\d{8}$/;
	}

	/* Slovakia */
	if(country == "SK") {
		exp = /^\d{10}$/;
	}

	if(exp == null) {
		return true;
	}

	return exp.test(vat);
}
