function openEmailRegistration(url,form) {
    $('#layerContainer').attr('class', 'quickEmailRegistration');
    $('#layerOverlay').show();
    
    //console.log($(form).serialize());
	$.post('http://'+url+'/users/quickEmailRegistration/', $(form).serialize(), function(response){
        $('#layerContainer').html(response);
        getWindowSize('#layerContainer');
        $('#layerContainer').show();
    });
    
    return false;
}

function submitEmailRegistrationData(url) {
    $.post('http://'+url+'/users/quickEmailRegistration',$('#quickEmailRegisterForm').serialize(),function(response) {
        $('#layerContainer').html(response);
    });
}

function resendNickname(url,form) {
    $.post('http://'+url+'/users/resendNickname/', $(form).serialize(), function(response){
        $('#quickEmailRegister').html(response);
    });
    
    return false;
}

function resendEmailActivationMail(url,form) {
    $.post('http://'+url+'/users/resendEmailActivationMail/', $(form).serialize(), function(response){
        $('#quickEmailRegister').html(response);
    });
    
    return false;
}


function closeRegistration() {
	$('#layerContainer').attr('class','');
	$('#layerContainer').html('<div id="layer"></div>');
	window.location = window.location;
	
    //$('#layerOverlay').hide();
    //$('#layerContainer').hide();
}

// initial script by Lokesh Dhakar - http://www.huddletogether.com
function getWindowSize(container) {
	// layer auf aktuelle scroll hoehe setzen und nach oben etwas abziehen
	var top = $(window).scrollTop();
	$(container).css({ 'top': top+'px'});
	
	// set document background
	var docHeight=$(document).height();
	$('#layerOverlay').height(docHeight);
    
}


