function setCurserPosition(id,pos)
{

    pos   = typeof(pos) != 'undefined' ? pos : 0;

    input = document.getElementById(id);
    input.focus();
    
    if(typeof input.selectionStart != 'undefined')
    {

        input.selectionStart = pos;
        input.selectionEnd   = pos;
        
    }
    // IE
    else if(typeof document.selection != 'undefined')
    {
    
        range = document.selection.createRange();
        range.moveStart('character',pos);
        range.moveEnd('character',pos);

    }
    
}



function getRandomMailbox()
{

	chars      = new Array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
	mailbox    = '';

	for(i=0;i<15;i++)
	{

		j = Math.ceil(Math.random() * 1000) % chars.length
		mailbox+= chars[j];
		
	}
	
	return mailbox;

}



function setRandomMailbox(id)
{

    input   = document.getElementById(id);
    email   = getRandomMailbox() + '@dontsendmespam.de';

    input.value = email;
    input.select();
    
	return true;
}