<!--
var defaultEmptyOK = false
var iEmail = "This field must be a valid email address (like foo@bar.com). Please reenter it now."
var pEmail = "valid email address (like foo@bar.com)."
var sEmail = "Email"
var mPrefix = "You did not enter a value into the "
var mSuffix = " field. This is a required field. Please enter it now."
// whitespace characters
var whitespace = " \t\n\r";
// Removes all characters which appear in string bag from string s.

function radioButtonCheck(rb)
{
	var fnd;
	fnd=false;
	for (var i=0;i<rb.rows.length;i++)
	{
		if (document.getElementById(rb.id + '_' + i).checked)
		{
			fnd=true;
			break;
		}
	}
	return fnd;
}

function stripCharsInBag (s, bag)

{   var i;
    var returnString = "";

    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }

    return returnString;
}

//--------------------------------remove whitespace in s
function stripWhitespace (s)

{   return stripCharsInBag (s, whitespace)
}

function isEmptyString(s)
{   return ((s == null) || (s.length == 0))
}




// -----------------Returns true if string s is empty or 
// -------------------whitespace characters only.

function isWhitespace (s)

{   var i;

    // Is s empty?
    if (isEmptyString(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);

        if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}


function isEmpty(str) {
  return isWhitespace(str);
}

// A function to check date format. 
// supported formats: dd.mm.yyyy or dd.m.yyyy or d.m.yyyy or d.mm.yyyy
function isRegularDate(strDate) {
	var reDateTime= new RegExp(/(0[1-9]|[1-9]|[1-2][\d]|3[0-1])\.([1-9]|0[1-9]|1[0-2])\.(19[\d]{2}|20[\d]{2})/);
	return reDateTime.test(strDate);
}


function isNotPunctuation(str) {
	var reDateTime= new RegExp(/[\wüğışçöÜĞİŞÇÖ]+/);
	return reDateTime.test(str);
}




function isEmail(val) {
  var reg = new RegExp(/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/);
  return reg.test(val);

}

function isValidUser(val) {
  var reg = new RegExp(/[\w]{6,20}/);
  return reg.test(val);

}

function isValidPass(val) {
  var reg = new RegExp(/[\w\d_]{6,20}/);
  return reg.test(val);

}

function isValidZip(val) {
  var reg = new RegExp(/\d{5}/);
  return reg.test(val);

}

function isValidTel(val) {
  var reg = new RegExp(/\d{7}/);
  return reg.test(val);

}

function isValidTelKod(val) {
  var reg = new RegExp(/\d{3}/);
  return reg.test(val);
}


