function Microsoft()
{
  if (document.all&&document.styleSheets) return true;
  return false;
}

function Netscape()
{
  if (navigator.appName=="Netscape") return true;
  return false;
}

function Mozilla()
{
  if (document.getElementById&&!document.all) return true;
  return false;
}

function Opera()
{
  var userAgent=navigator.userAgent;
  if (userAgent.search("Opera")!=-1) return true;
  return false;
}

function SubmitForm(name)
{
  if (!Netscape()||Mozilla()) eval('document.forms["'+name+'"].submit();');
  else eval('document.'+name+'.submit();');
}

function SetFormEnabled(formName,elementName,value)
{
  if (!Netscape()||Mozilla()) document.forms[formName].elements[elementName].disabled=value^1;
  else eval('document.'+formName+'.'+elementName+'.disabled='+value^1);
}

function SetFormValue(formName,elementName,value)
{
  if (!Netscape()||Mozilla()) document.forms[formName].elements[elementName].value=value;
  else eval('document.'+formName+'.'+elementName+'.value='+value);
}

function GetCheckboxValue(formName,elementName)
{
//alert(document.forms[formName].elements[elementName].checked);
  if (!Netscape()||Mozilla()) return document.forms[formName].elements[elementName].checked;
  else return eval('document.'+formName+'.'+elementName+'.checked');

}

function AskDelete(dropId,link)
{
  var txt="Sind Sie sicher den Datensatz mit der Id '"+dropId+"' zu entfernen?";
  if (confirm(txt))
  {
    location.href=link;
  }
}

function IsEmailValid(email)
{
  if (email.search(/.+@+./)==-1) return false;
  if (email.search(/.+[.]+./)==-1) return false;
  if (email.length<5) return false;
  return true;
}

var globalMousePosX=0;
var globalMousePosY=0;

function SaveMousePos(e)
{
  if(Netscape()||Mozilla())
  {
    globalMousePosX=e.pageX;
    globalMousePosY=e.pageY;
  }
  else if(Microsoft()||Opera())
  {
    globalMousePosX=document.body.scrollLeft+event.clientX;
    globalMousePosY=document.body.scrollTop+event.clientY;
  }
}