<!-- 



      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;
      }

      /****************************************************************/
      

      // Check whether string s is empty.
      function isEmpty(s)
      { return ((s == null) || (s.length == 0)) }

      /****************************************************************/
      
// whitespace characters
      var whitespace = " \t\n\r";

// 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 (str,strWarning)
{   
var strinput = new String(str.value)
/*    if (isEmpty(str)) 
       if (isEmail.arguments.length == 1) {
        alert("1");
        return false;
        }
       else 
        return (isEmail.arguments[1] == true);
*/

    // is s whitespace?
if (isWhitespace(strinput))    { 
        alert(strWarning);
        return false;
        }

        
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = strinput.length;

    // look for @
    while ((i < sLength) && (strinput.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (strinput.charAt(i) != "@")) {
        alert(strWarning);
        return false;
        }
    else 
        i += 2;

    // look for .
    while ((i < sLength) && (strinput.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (strinput.charAt(i) != ".")) {
        alert(strWarning);
        return false;
        }
    else 
        return true;
}

/****************************************************************/
      function ForceEntry(val, str) {
           var strInput = new String(val.value);

           if (isWhitespace(strInput)) {
                alert(str);
                return false;
           } else
                return true;

      }

      /****************************************************************/

// This function ensures that a field is less than or equal to the
// Length passed in.  You must call this function with the element
// name in your form (for example: "ForceLength(document.forms[0].txtElement)"
// as opposed to "ForceLength(document.forms[0].txtElement.value)"
// If the field's value is too large, an error message is displayed
// and false is returned, else true is returned.

function ForceLength(objField, nLength, strWarning)
{
	var strField = new String(objField.value);

	if (strField.length > nLength) {
		alert(strWarning);
		return false;
	} else
		return true;
}
/****************************************************************/
function ValidateData() {           
	var CanSubmit = false;
	var a,b,c,d,e,f,m
	
	// Check to make sure that the full name field is not empty.
	a = ForceEntry(document.forms[0].CartName,"Please enter your full name");
	b = ForceEntry(document.forms[0].CartAddress,"Please enter your mailing address");
	c = ForceEntry(document.forms[0].CartCity,"Please enter your city");
	d = ForceEntry(document.forms[0].CartState,"Please enter your state");
	e = ForceEntry(document.forms[0].CartZip,"Please enter your zip code");
	m = isEmail(document.forms[0].CartEmail,"Please enter a valid email address (e.g. 'you@yourdomain.com') (your order receipt will be sent here)");
	f = ForceEntry(document.forms[0].CartPhone,"Please enter your phone number");

	if ((a=false) || (b==false) || (c==false) || (d==false) || (e==false) || (f==false) || (m==false))

return false;
          else return true;
      }
/****************************************************************/
function ValidateData2() {           
	var CanSubmit = false;
	var a,b,c,d,e,f,g,h,i1,i2,i3,i4,i5,i6,i7,j,m
	
	// Check to make sure that the full name field is not empty.
	g = ForceEntry(document.forms[0].Username,"Please enter a username");
	h = ForceEntry(document.forms[0].Password,"Please enter a password");
	j = ForceEntry(document.forms[0].UserTitle,"Please enter an event title");
	i1 = ForceEntry(document.forms[0].PriceW,"Please enter a wallet-size price");
	i2 = ForceEntry(document.forms[0].Price4,"Please enter a 4x6 size price");
	i3 = ForceEntry(document.forms[0].Price5,"Please enter a 5x7 size price");
	i4 = ForceEntry(document.forms[0].Price8,"Please enter an 8x10 size price");
	i7 = ForceEntry(document.forms[0].Price11,"Please enter an 12x12 size price");
	i5 = ForceEntry(document.forms[0].Price11,"Please enter an 11x14 size price");
	i6 = ForceEntry(document.forms[0].Price13,"Please enter a 13x19 size price");
	
	if ((g==false) || (h==false) || (i1==false) || (i2==false) || (i3==false) || (i4==false) || (i7==false) || (i5==false) || (i6==false) || (j==false))
return false;
    else return true;
      }
/****************************************************************/
function ValidateEmail() {           
	var a;
	
	// Check to make sure that the full name field is not empty.
	a = isEmail(document.forms[0].email,"Please enter a valid E-mail address (e.g. 'you@yourdomain.com')");
	
	if ((a==false))
		return false;
	else 
		return true;
	}
// --> 
