<!--
var defaultEmptyOK = false

/*------------------------------------------------------------------*/
//Clears out default value of an input field
//e.g. <input type=text value="FirstName.LastName"  onFocus="clearText(this)">
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 
/*------------------------------------------------------------------*/
// Returns true if character c is an English letter 
// (A .. Z, a..z).
//
function isLetter (c)
{   return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) )
}
/*------------------------------------------------------------------*/
// Returns true if character c is a digit 
// (0 .. 9).

function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

/*------------------------------------------------------------------*/
// isAlphanumeric (STRING s [, BOOLEAN emptyOK])
// 
// Returns true if string s is English letters 
// (A .. Z, a..z) and numbers only.
//
function isAlphanumeric (s)

{   var i;

    if (isEmpty(s)) 
       if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;
       else return (isAlphanumeric.arguments[1] == true);

    // Search through string's characters one by one
    // until we find a non-alphanumeric character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number or letter.
        var c = s.charAt(i);

        if (! (isLetter(c) || isDigit(c) ) )
        return false;
    }

    // All characters are numbers or letters.
    return true;
}

/*------------------------------------------------------------------*/

function GetSelectedButton(ButtonGroup)  {
//Returns true if button selected
	for (var i=0; i<ButtonGroup.length; i++)  {
		if (ButtonGroup[i].checked) {
			RequestType = ButtonGroup[i].value;
			return true;
		}
	}
	return false;
}

/*------------------------------------------------------------------*/
//Temporary alert during conversion to the W
//called using the onload function in the BODY statement
function popupAlert ()
{
alert ("W Migration Alert\n1. Requests for access to Legacy Teradata or EDW May 1st forward will not be reflected on The W.\n2. Please do not re-request access rights for the W that you already had.  They were automatically given to your ID.");
}
/*------------------------------------------------------------------*/

// whitespace characters
var whitespace = " \t\n\r";

// Check whether string s is empty.

function isEmpty(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 (isEmpty(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;
}
/*------------------------------------------------------------------*/

// checks for valid values in a field as passed in incoming string (e.g. "1234")
// pass form field as straight object (e.g. form.txtEmail")
// sample call: if (! isValidCharacters(	"0123456789()-.",form.txtPhone))
function isValidCharacters(checkOK,s)
{
	  var checkStr = s.value;
	  var allValid = true;
	  for (i = 0;  i < checkStr.length;  i++)
	  {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		  if (ch == checkOK.charAt(j))
			break;
		if (j == checkOK.length)
		{
		  allValid = false;
		  break;
		}
	  }
	  if (!allValid)
	  {
		return (false);
	  }
return true;
}
function isValidPhone (formField)
{
		if (isWhitespace (formField.value)) {
			alert("Please fill in the Phone number.");
			formField.focus();
			return false;
			}

		if (! isValidCharacters(	"0123456789-.",formField))
		{
				alert("Please enter only numbers, dashes and period characters in the \"Phone\" field.\nAvoid embedded blanks and parentheses.");
				formField.focus();
				return false;
		}	

	  if (formField.value.length < 10)
		  {
			alert("Please enter at least 10 characters in the Phone field.");
			formField.focus();
			return false;
		  }	

	  if (formField.value.length > 20)
		  {
			alert("Please enter at most 20 characters in the Phone field.");
			formField.focus();
			return false;
		  }
return true;

}
//Date validation for strict mm/dd/yyyy dates
function isValidMMDDYY(formField)
{
	var result = true;

//	if (required && !validRequired(formField,fieldLabel))
	//		result = false;
	if (!isValidCharacters ("0123456789/",formField))
	{
		result = false
	}
  

 	if (result)
 	{
 		var elems = formField.value.split("/");
 		
 		result = (elems.length == 3); // should be three components
 		
 		if (result)
 		{
 			var month = parseInt(elems[0],10);
  			var day = parseInt(elems[1],10);
 			var year = parseInt(elems[2],10);
			result = (month > 0) && (month < 13) && (elems[0].length == 2) &&
						(day > 0) && (day < 32) && (elems[1].length == 2) &&
						(elems[2].length == 4);
		}
	} 

	return result;
}

/*------------------------------------------------------------------*/
function RedirectPage(page){
window.location = page;
} 
/*------------------------------------------------------------------*/

function popup_window(myurl) {
var newWindow;
var props = 'width=500,height=250,left=150,top=100,scrollBars,resizable,status';
//var props = 'width=500,height=600,alwaysRaised=yes,scrollBars=yes,resizable=yes,status=yes,toolbar=no,menubar=no,location=no,directories=no';
newWindow = window.open(myurl, "PopupWindow", props);
newWindow.focus();
}

/*--------------------------------*/
function small_window(myurl) {
var newWindow;
var props = 'width=620,height=525,left=100,top=10,scrollBars,resizable,status';
//var props = 'width=500,height=600,alwaysRaised=yes,scrollBars=yes,resizable=yes,status=yes,toolbar=no,menubar=no,location=no,directories=no';
newWindow = window.open(myurl, "SmallWindow", props);
newWindow.focus();
}

/*------------------------------------------------------------------*/
function validRequired(formField,fieldLabel)
{
if (isWhitespace(formField.value) )
  {
    alert('Please enter a value for the "' + fieldLabel +'" field.');
    formField.focus();
    return false;
  }

 return true;
}

/*------------------------------------------------------------------*/
// isEmail (STRING s [, BOOLEAN emptyOK])
// 
// Email address must be of form a@b.c -- in other words:
// * there must be at least one character before the @
// * there must be at least one character before and after the .
// * the characters @ and . are both required
//
// For explanation of optional argument emptyOK,
// see comments of function isInteger.

function isEmail (s)
{   // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}

//	if (! isEmail(form.txtEmail.value)) {
//		alert("Please provide a valid Internet-style Email address:\n(e.g. Joe.Smith@bankofamerica.com)");
//		form.txtEmail.focus();
//		return false;
//	}

//-->

