// Callbacks from Registration Overlays: -----------
// they can't be namespaced b/c then they won't work as a callback in xd_flux.html

function registerFinalIncreaseHeight(args){
    var docH,
    def = '900',
    authFrame = document.getElementById("authenticationFrame");

    NickLog.debug('registerFinalIncreaseHeight');
    try{
        docH = args['h'] ? args['h'] : def; 
        NickLog.debug('registerFinalIncreaseHeight: docH: ' + docH);
        authFrame.style.height = docH + 'px';
    }catch(e){
        NickLog.debug("registerFinalIncreaseHeight: caught exception: e: " + e);
    }
}

function registerFinalCrossDomainCallback(){
    NickLog.debug('registerFinalCrossDomainCallback');
    var curTop = parseInt($(".authentication > div").css('top'));
    $(document).scrollTop(curTop);
    $(".closeButton").click(function(event){	
    	NickLog.debug('registerFinalCrossDomainCallback: closeButton clicked');
        if(window.location.pathname.indexOf('/caption-contest')==0){
    		Flux.reloadWidgets();
    		return;
        } else { // default for now is to reload the page
        	NickLog.debug("Post register: page reload")
        	window.location.href=window.location.href;        	
        }
    });
}
function registerFinalDoneCrossDomainCallback(){
    NickLog.debug('registerFinalDoneCrossDomainCallback');
    registerFinalCrossDomainCallback();
    registerFinalIncreaseHeight({h:"300"});
}
// End Callbacks from Registration Overlays: -----------
