<!-- 
  
  function CheckLogin( )
  {
    if (document.loginform.strUsername.value == "") 
    {
      alert("You must enter your username.");
      return false;
    }
    if (document.loginform.strPassword.value == "")
    {
      alert("You must enter a password.");
      return false;
    }
    return true;
  } 
  
  
  function CheckLogin_DE( )
  {
    if (document.loginform.strUsername.value == "") 
    {
      alert("Bitte geben Sie Ihren Benutzernamen ein.");
      return false;
    }
    if (document.loginform.strPassword.value == "")
    {
      alert("Bitte geben Sie Ihr Passwort ein.");
      return false;
    }
    return true;
  }   



  function CheckEmail( strEmail )
  {
	  if( strEmail == "" || (strEmail.search("@") == -1  || strEmail.indexOf(".") == -1) ) 
	  {
	    alert("You must enter your valid e-mail address.");
	    return false;
	  }
    else
      return true;
  }


  function CheckEmail_DE( strEmail )
  {
	  if( strEmail == "" || (strEmail.search("@") == -1  || strEmail.indexOf(".") == -1) ) 
	  {
	    alert("Bitte Ihre gültige E-Mail-Adresse eingeben.");
	    return false;
	  }
    else
      return true;
  }


  function getRadioValue( radio )
  {
    if( radio ) 
    {
     for (var i = 0; i < radio.length; i++)
      {   
        if (radio[i].checked) { break }
      }
      if( i == radio.length )
        return -1;
      else
        return radio[i].value;
    }
  }


  function openWindow(url, w, h) {
    var options = "width=" + w + ",height=" + h + ",";
    options += "resizable=yes,scrollbars=yes,status=no,";
    options += "menubar=no,toolbar=no,left=0,top=0,directories=no";
    var newWin = window.open(url, 'newWin', options);
    newWin.focus();
  }

  function openWindowMenubar(url, w, h) {
    var options = "width=" + w + ",height=" + h + ",";
    options += "resizable=yes,scrollbars=yes,status=no,";
    options += "menubar=yes,toolbar=no,left=0,top=0,directories=no";
    var newWin = window.open(url, 'newWin', options);
    newWin.focus();
  }


  function ViewOther( sID, qID, intStatVal, rrID )
  {
    var url = "./a_results.asp?levelID=3&sID=" + sID + "&qID=" + qID + "&intStatVal=" + intStatVal + "&rrID=" + rrID;
    openWindow(url, 500, 400);
  }

  function ViewDefinition( defID )
  {
    var url = "./definitions.asp?defID=" + defID;
    openWindow(url, 500, 400);
  }



  function CheckProfile( )
  {
    if( document.profile.bDecline )
    {
      if( !document.profile.bDecline.checked )
      {    
          if( document.profile.strEmail  &&  document.profile.strConfirm )
          {
            var strEmail    = document.profile.strEmail.value;
            var strConfirm  = document.profile.strConfirm.value;
            if( strEmail == "" ) 
            {
              alert("You must enter email address.");
              return false;
            }
            if( strConfirm == "" ) 
            {
              alert("You must confirm your email address.");
              return false;
            }    
            if( strEmail != strConfirm )
            {
              alert("Your email address entries do not match.");
              return false;
            }
            else
            {
              CheckEmail( strEmail );
              CheckEmail( strConfirm );            
            }      
          }   
          
          if( document.profile.strEmail  &&  !document.profile.strConfirm )
          {
            var strEmail = document.profile.strEmail.value;
            if( strEmail == "" ) 
            {
              alert("You must enter email address.");
              return false;
            }
            if( !CheckEmail( strEmail ) )
              return false;
          }     
        
        
          if( document.profile.strFname.value == "" ) 
          {
            alert("You must enter your first name.");
            return false;
          }
          if( document.profile.strLname.value == "" ) 
          {
            alert("You must enter your last name.");
            return false;
          } 
          if( document.profile.strAddress1.value == "" ) 
          {
            alert("You must enter your address.");
            return false;
          }
          if( document.profile.strCity.value == "" ) 
          {
            alert("You must enter your city.");
            return false;
          }
          if( document.profile.strCountry )
          {
            if( document.profile.strCountry.value != "US" ) 
            {
              if( document.profile.strProvince.value == "" ) 
              {
                alert("You must enter your province.");
                return false;
              }
            }
          }
          if( document.profile.strState )
          {
            if( document.profile.strState.value == "" ) 
            {
              alert("You must enter your state.");
              return false;
            }        
          }
          if( document.profile.strZip.value == "" ) 
          {
            alert("You must enter your ZIP/Postal code.");
            return false;
          }
          if( document.profile.strCountry.value == "" ) 
          {
            alert("You must enter your country.");
            return false;
          }
      }    
    }
    return true;
  }
  


  function CheckProfileIntercept( )
  {

      if( document.profile.strEmail  &&  document.profile.strConfirm )
      {
        var strEmail    = document.profile.strEmail.value;
        var strConfirm  = document.profile.strConfirm.value;
        if( strEmail == "" ) 
        {
          alert("You must enter email address.");
          return false;
        }
        if( strConfirm == "" ) 
        {
          alert("You must confirm your email address.");
          return false;
        }    
        if( strEmail != strConfirm )
        {
          alert("Your email address entries do not match.");
          return false;
        }
        else
        {
          CheckEmail( strEmail );
          CheckEmail( strConfirm );            
        }      
      }   
      
      if( document.profile.strEmail  &&  !document.profile.strConfirm )
      {
        var strEmail = document.profile.strEmail.value;
        if( strEmail == "" ) 
        {
          alert("You must enter email address.");
          return false;
        }
        if( !CheckEmail( strEmail ) )
          return false;
      }     

    return true;
  }
  
  


  function CheckDate( tmp )
  {
    var re = /\-/gi
    tmp = tmp.replace(re, "/");

    var re2 = /^\d{1,2}\/\d{1,2}\/\d{2,4}/
    if( re2.exec( tmp ) ) 
    {
       return true;
    }
    return false;
  }

  
  function isValidDate(dateStr, format) {
     if (format == null) { format = "MDY"; }
     format = format.toUpperCase();
     if (format.length != 3) { format = "MDY"; }
     if ( (format.indexOf("M") == -1) || (format.indexOf("D") == -1) ||  (format.indexOf("Y") == -1) ) { format = "MDY"; }
     if (format.substring(0, 1) == "Y") { // If the year is first
        var reg1 = /^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/
        var reg2 = /^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/
     } else if (format.substring(1, 2) == "Y") { // If the year is second
        var reg1 = /^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/
        var reg2 = /^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/
     } else { // The year must be third
        var reg1 = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/
        var reg2 = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/
     }
     // If it doesn't conform to the right format (with either a 2 digit year or 4 digit year), fail
     if ( (reg1.test(dateStr) == false) && (reg2.test(dateStr) == false) ) { return false; }
     var parts = dateStr.split(RegExp.$1); // Split into 3 parts based on what the divider was
     // Check to see if the 3 parts end up making a valid date
     if (format.substring(0, 1) == "M") { var mm = parts[0]; } else 
        if (format.substring(1, 2) == "M") { var mm = parts[1]; } else { var mm = parts[2]; }
     if (format.substring(0, 1) == "D") { var dd = parts[0]; } else 
        if (format.substring(1, 2) == "D") { var dd = parts[1]; } else { var dd = parts[2]; }
     if (format.substring(0, 1) == "Y") { var yy = parts[0]; } else 
        if (format.substring(1, 2) == "Y") { var yy = parts[1]; } else { var yy = parts[2]; }
     if (parseFloat(yy) <= 50) { yy = (parseFloat(yy) + 2000).toString(); }
     if (parseFloat(yy) <= 99) { yy = (parseFloat(yy) + 1900).toString(); }
     var dt = new Date(parseFloat(yy), parseFloat(mm)-1, parseFloat(dd), 0, 0, 0, 0);
     if (parseFloat(dd) != dt.getDate()) { return false; }
     if (parseFloat(mm)-1 != dt.getMonth()) { return false; }
     return true;
  }  


  function CloseAndRefresh( )
  {
    window.opener.location.reload();
    this.close();
    return true;
  }


  function getCheckCount( skey, qna )
  {
    var sStr, j = 0;
    for( var i=1; i <= qna; i++ )
    {
      sStr = skey + "_" + i
      if( eval("document.forms[0]." + sStr + ".checked") ) 
      {
        j++;
      }
    }
    return j;
  }

  function IsNumeric( strString )
  {
    var strValidChars = "0123456789.";
    var strChar;
    var blnResult = true;
    var intPeriods = 0;

    if (strString.length == 0) return false;
    //  test strString consists of valid characters listed above
    for (i = 0; i < strString.length && blnResult == true; i++)
    {
      strChar = strString.charAt(i);
      if( strChar == "." )  
      {
        intPeriods += 1;
        if( intPeriods > 1 ) 
          blnResult = false;
      }
      if (strValidChars.indexOf(strChar) == -1)
        blnResult = false;
    }
    return blnResult;
  }
  
  
  function IsNumericWhole( strString )
  {
    var strValidChars = "0123456789-";
    var strChar;
    var blnResult = true;
    var intPeriods = 0;

    if( strString == null )  return false;
    if (strString.length == 0) return false;
    //  test strString consists of valid characters listed above
    for (i = 0; i < strString.length && blnResult == true; i++)
    {
      strChar = strString.charAt(i);
      if( strChar == "." )  
      {
        intPeriods += 1;
        if( intPeriods > 1 ) 
          blnResult = false;
      }
      if (strValidChars.indexOf(strChar) == -1)
        blnResult = false;
    }
    return blnResult;
  }


  function ConfirmDelete( )
  {
    if( confirm("Are you sure that you wish to delete this entry?") ) 
      return true;
    else
      return false;
  }


  function CheckDateFilter( )
  {
    var mm1 = document.report.mm1.value;
    var dd1 = document.report.dd1.value;
    var yy1 = document.report.yy1.value;
    var mm2 = document.report.mm2.value;
    var dd2 = document.report.dd2.value;
    var yy2 = document.report.yy2.value;

    if( mm1 != "" ) 
    {
      if( !IsNumeric(mm1) || !IsNumeric(dd1) || !IsNumeric(yy1) ) 
      {
        alert("You have entered an invalid beginning date.");
        return false;
      }
      if( !IsNumeric(mm2) || !IsNumeric(dd2) || !IsNumeric(yy2) ) 
      {
        alert("You have entered an invalid ending date.");
        return false;
      }      

      if( document.report.mm1.value == "" || document.report.dd1.value == "" || document.report.yy1.value == "" )      
      {
        alert("You must enter a complete beginning date.");
        return false;
      }
      if( document.report.mm2.value == "" || document.report.dd2.value == "" || document.report.yy2.value == "" ) 
      {
        alert("You must enter a complete ending date.");
        return false;
      }
    }
    return true;
  }


  function PrintCoupon( strIn )
  {
    var strOut = "/survey/pr.asp?pr=" + strIn;
    image1 = new Image();
    image1.src = strOut; 
    
    window.print();
  }  
  

// -->