function noContact(s,message) {

  var allValid = true;
  var mailexists = false;
  var phoneexists = false;
  if ((s.value.length > 0) && (trim(s.value) != null) && (trim(s.value) != "")){
     mailexists = true;
  }
  var s2 = document.emailform.email;
  if ((s2.value.length > 0) && (trim(s2.value) != null) && (trim(s2.value) != "")){
     phoneexists = true;
  }
  if ((mailexists == false) && (phoneexists == false)){
      allValid = false;
  }
  if (!allValid){
    alert(message);
    s.focus();
    return false;
  }
return true;
}

function isLeer(s,message){
        if ((s.value.length == 0) && (trim(s.value) == null) && (trim(s.value) == "")){
                return true;
        }
        alert(message);
        s.focus();
        return true;
}

function isBlank(s,message){
        if ((s.value.length > 0) && (trim(s.value) != null) && (trim(s.value) != "")){
                return false;
        }
        alert(message);
        s.focus();
        return true;
}

function isBlank2(s,message){
        if ((s.value.length > 0) && (trim(s.value) != null) && (trim(s.value) != "")){
                return false;
        }
        return true;
}

function isLetter(s,message){
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ.*- ";
  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)
  {
    alert(message);
    s.focus();
    return false;
  }
return true;
}

function isLetternumber(s,message){
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890ƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ.*-+()/!?_, []&#@$%&§=:\n\r";


  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)
  {
    alert(message);
    s.focus();
    return false;
  }
return true;
}

function isWrongLetter(s,message){

        var checkNOTOK = "<>{}[]";
        var checkStr = s.value;
        var allValid = true;

        for (i = 0;  i < checkStr.length;  i++) {

                ch = checkStr.charAt(i);

                for (j = 0;  j < checkNOTOK.length;  j++) {
                        if (ch == checkNOTOK.charAt(j)) {
                                allValid = false;
                        }
                        if (j == checkNOTOK.length) {
                                break;
                        }
                  }

                if (!allValid) {
                        alert(message);
                        s.focus();
                        return false;
                }
        }
return true;
}

function isNumber(s,message){
  var checkOK = "1234567890";
  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)
 {
   alert(message);
   s.focus();
    return false;
  }
return true;
}

function isPhone(s,message){
  var checkOK = "1234567890()-/+ ";
  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)
  {
    alert(message);
    s.focus();
    return false;
  }
return true;
}

function minmax5 (s,message){
  var checkStr = s.value;
  var allValid = true;
  if (checkStr.length < 5){
      allValid = false;
  }
  if (checkStr.length > 5){
      allValid = false;
  }
  if (!allValid){
    alert(message);
    s.focus();
    return false;
  }
return true;
}

function ismax1000 (s,message) {
  var checkStr = s.value;
  var allValid = true;
  if (checkStr.length > 1000){
      allValid = false;
  }
  if (!allValid){
    alert(message);
    s.focus();
    return false;
  }
return true;
}

function isEmail (s,message){
        var i,ii;
        var j;
        var k,kk;
            var jj;
            var len;
    if (s.value.length >0){
                i=s.value.indexOf("@");
                ii=s.value.indexOf("@",i+1);
                j=s.value.indexOf(".",i);
                k=s.value.indexOf(",");
                kk=s.value.indexOf(" ");
                jj=s.value.lastIndexOf(".")+1;
                len=s.value.length;
                if ((i>0) && (j>(1+1)) && (k==-1) && (ii==-1) && (kk==-1) &&
                        (len-jj >=2) && (len-jj<=4)) {}
                else {
                                  alert(message)
                                  s.focus();
                                return false;
                }
        } else {
    return true;
    }
    return true;
}

function ltrim(str) {
        for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
        return str.substring(k, str.length);
}
function rtrim(str) {
        for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
        return str.substring(0,j+1);
}
function trim(str) {
        return ltrim(rtrim(str));
}
function isWhitespace(charToCheck) {
        var whitespaceChars = " \t\n\r\f";
        return (whitespaceChars.indexOf(charToCheck) != -1);
}




var gescrolltY = 0;

function setwerte() {
         y = 120;
         movepfeile();
}

function setwerte2() {
         //y = 120 + gescrolltY;
		 if (gescrolltY > 120) {
		 	y = gescrolltY;
		 } else {
         	y = 120;
		 }
		
		    movepfeile();

}

function movepfeile() {
		
        if (document.layers) {
                document.page_border_right_n1.top = y;
        }
        if (document.getElementById) {
                document.getElementById("page_border_right_n1").style.top = y + "px";
        }
        if (document.all) {
                document.all.page_border_right_n1.style.top = y;
        }
		
        setTimeout("checkScroll()",150);
}

function checkScroll() {
//alert(document.documentElement.scrollTop);
         if ((document.getElementById) || (document.all)) {
            if (gescrolltY != document.documentElement.scrollTop) {
               gescrolltY = document.documentElement.scrollTop;
               //if (gescrolltY > 50) { 
			   setwerte2(); 
			   //}
            } else {
            setTimeout("checkScroll()",150);
            }
         }
         if (document.layers) {
            if (gescrolltY != window.pageYOffset) {
               gescrolltY = window.pageYOffset;
               //if (gescrolltY > 80) {
				setwerte2(); 
				//}
            } else {
            setTimeout("checkScroll()",150);
            }
         }
}

