function clear_loginForm() {
	username = document.loginForm.username;
	userpass = document.loginForm.userpass;
	if (userpass.value == "Passwort") userpass.value = "";
	if (username.value == "Email-Adresse") username.value = "";
}
	
	
function _CloseOnEsc() {
  if (event.keyCode == 27) { window.close(); return; }
}

function Init() {                                                       // run on page load
  document.body.onkeypress = _CloseOnEsc;

  color = window.dialogArguments;
  color = ValidateColor(color) || '000000';
  View(color);                                                          // set default color
}

function View(color) {                  // preview color
  document.all.ColorPreview.style.backgroundColor = '#' + color;
  document.all.ColorHex.value = '#' + color;
}

function Set(string) {                   // select color
  color = ValidateColor(string);
  if (color == null) { alert("Invalid color code: " + string); }        // invalid color
  else {                                                                // valid color
    View(color);                          // show selected color
    window.returnValue = color;           // set return value
    window.close();                       // close dialog
  }
}

function ValidateColor(string) {                // return valid color code
  string = string || '';
  string = string + "";
  string = string.toUpperCase();
  chars = '0123456789ABCDEF';
  out   = '';

  for (i=0; i<string.length; i++) {             // remove invalid color chars
    schar = string.charAt(i);
    if (chars.indexOf(schar) != -1) { out += schar; }
  }
    
  if (out.length != 6) { return null; }            // check length
  return out;
} 





function toggle( targetId )
{
  if (document.getElementById)
  {
    var target  = document.getElementById( targetId );

    if (target.style.display == "")
    {
      target.style.display = "none"
    }
    else
    {
      target.style.display = ""
    }
  }
}

function show( targetId )
{
  if (document.getElementById)
  {
    var target  = document.getElementById( targetId );

    target.style.display = ""
  }
}

function hide( targetId )
{
  if (document.getElementById)
  {
    var target  = document.getElementById( targetId );

    target.style.display = "none"
  }
}


function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function rowOverEffect(object) {
  if (document.checkout_confirmation.elements[object].parentNode.parentNode.className != 'moduleRowSelected') {
    document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver';
  }
}

function rowOutEffect(object) {
  if (document.checkout_confirmation.elements[object].checked) {
    document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected';
  } else {
    document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'infoBoxContents';
  }
}

function checkboxRowEffect(object) {
  document.checkout_confirmation.elements[object].checked = !document.checkout_confirmation.elements[object].checked;
  if(document.checkout_confirmation.elements[object].checked) {
    document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowSelected';
  } else {
    document.checkout_confirmation.elements[object].parentNode.parentNode.className = 'moduleRowOver';
  }
}

function check_agree(TheForm) {
  if (TheForm.agree.checked) {
	document.getElementById('bconfirm').style.display = 'none';
	document.getElementById('bconfirmed').style.display = 'block';
    return true;
  } else {
    alert(unescape('Bitte bestätigen Sie unsere AGB'));
    return false;
  }
}

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}


function first() {
if(document.getElementById)
document.getElementById("first").style.display = "block";
document.getElementById("second").style.display = "none";
}

function second() {
if(document.getElementById)
document.getElementById("first").style.display = "none";
document.getElementById("second").style.display = "block";
}

