/* AUTHOR: [web-enhancements] Austria */
/* Creation date: 18.05.2002 */

var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var W3C = document.getElementById? true : false;
if ((!W3C) && (!ns4) && (!ie4)) alert("Diese Seite is mit Ihrem Browser nicht kompatibel!");
var ns = (navigator.appName == 'Netscape') ? true : false;

function openWindow(url,name,w,h) {
  myWindow = window.open(url,name,'width='+w+',height='+h+',location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes');
  if (!myWindow.opener) myWindow.opener = self;
  myWindow.focus();
}

function openMessageWindow(url,name,w,h) {
  myMsgWindow = window.open(url,name,'width='+w+',height='+h+',location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');
  if (!myMsgWindow.opener) myMsgWindow.opener = self;
  myMsgWindow.focus();
}

function switchstate(which,state) {
  document.images[which].src = eval("img"+which+state+".src");
}

function isValidMySQLEntry(which) {
  if (!which) return true;
  var iChars = "'";
  for (var i = 0; i < which.length; i++) {
    if (iChars.indexOf(which.charAt(i)) != -1)  return false;
  }
  return true;
}

function isDigit(which) {
  if (!which) return false;
  var iChars = "1234567890";
  for (var i = 0; i < which.length; i++) {
    if (iChars.indexOf(which.charAt(i)) == -1)  return false;
  }
  return true;
}

function isEmpty(which) {
  if (!which) return true;
  if (which.length <= 0) return true;
  else return false;
}

function isEmail(which) {
  return true;
}

function isCurrency(which) {
  return true;
}

function isDate(which) {
  day = which.substring(0,2);
  month = which.substring(3,5);
  year = which.substring(6,10);
  var today = new Date();
  year = ((!year) ? y2k(today.getYear()):year);
  month = ((!month) ? today.getMonth():month-1);
  if (!day) return false;
  var test = new Date(year,month,day);
  if ( (y2k(test.getYear()) == year) && (month == test.getMonth()) && (day == test.getDate()) ) return true;
  else return false;
}
