function startComponents() {
    var username = (LANG == 'de') ? 'Benutzername' : "Nom d'utilisateur";

    // Box Login
    $('#txt-login-username')
		.focus(function(){
				if ($(this).val() == username) {
					$(this).val('');
				}
		})
		.blur(function(){
				if ($(this).val() == '') {
					$(this).val(username);
				}
		})
		.each(function(){
				if ($(this).val() == '') {
					$(this).val(username);
				}
		});

    $('#pw-login-password')
		.hide()
		.blur(function(){
				if ($(this).val() == '') {
					$(this).hide();
					$('#txt-login-password').show();
				}
		});

    $('#txt-login-password')
		.show()
		.focus(function(){
				$(this).hide();
				$('#pw-login-password').show().focus();
			})
}

function ajaxRequest(url,params,targetFunc,method) {
    url = '/services/'+url+'.htx';
    if(!method) method='get';
	helpAjax = new Ajax.Request(url,
		{
  		method: method,
  		parameters: params,
    	onComplete: eval(targetFunc)
  	}
  );
}

function fade(objid,tduration) {
    if(!tduration) tduration = 0.2;
    new Effect.Fade(objid,{ duration: tduration, from: 1.0, to: 0.0  });
}

function appear(objid,tduration) {
    if(!tduration) tduration = 0.2;
    new Effect.Appear(objid,{ duration: tduration, from: 0.0, to: 1.0  });
}


function checkMail(email) {
 var a = false;
 var res = false;

 if(typeof(RegExp) == 'function') {
    var b = new RegExp('abc');
    if(b.test('abc') == true){
        a = true;
    }
 }

 if(a == true) {
  reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
                   '(\\@)([a-zA-Z0-9\\-\\.]+)'+
                   '(\\.)([a-zA-Z]{2,4})$');
  res = (reg.test(email));
 }
 else {
  res = (email.search('@') >= 1 &&
         email.lastIndexOf('.') > email.search('@') &&
         email.lastIndexOf('.') >= email.length-5)
 }
 return(res);
}