function toggle(tag)
{
  var toggleEl = document.getElementById(tag);
  if (toggleEl.style.display == 'none')
    toggleEl.style.display = '';
  else
    toggleEl.style.display = 'none';
}

function MsgBox(msg,msg1)
{
  spring = window.confirm(msg1);
  if (spring == true)
    openNewWindow(msg);
}

function openNewWindow(msg)
{
  window.location = msg;
}


function MsgBox2(fct,msg1)
{
  if (window.confirm(msg1) == true)
    eval(fct);
}

function hideDiv(div)
{
  var Element = document.getElementById(div);
  Element.style.display = 'none';
}

function showDiv(div)
{
  var Element = document.getElementById(div);
  Element.style.display = '';
}

function lengthField(el, reqLength)
{
  strLen = document.getElementById(el).value; 
  if(strLen.length < reqLength)
    return true;
  return false;
}

function valElm(tag)
{
  return document.getElementById(tag).value;  
}

function setValInner(tag, str)
{
  document.getElementById(tag).innerHTML=str;
}

function setFocus(tag)
{
  document.getElementById(tag).focus();
}

function checkMail(mail)
{
	var x = mail;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) return true;
	else false;
}

