$(document).ready( function() {

    
    $('.t_a_ui_helper_message').dialog({
        position: 'center',
        modal: true
    });
    

    $("a.fancy-iframe").fancybox({
        'width'			: '95%',
        'height'		: '95%',
        'autoScale'		: false,
        'transitionIn'		: 'elastic',
        'transitionOut'		: 'elastic',
        'type'                  : 'iframe'
    });
    
    $("a.fancy-iframe-small").fancybox({
        'width'			: 600,
        'height'		: 400,
        'autoScale'		: false,
        'transitionIn'		: 'elastic',
        'transitionOut'		: 'elastic',
        'type'                  : 'iframe'
    });
    

    $("a.fancy").fancybox({
        'titleShow'     : false,
        'transitionIn'	: 'elastic',
        'transitionOut'	: 'elastic',
        'easingIn'      : 'easeOutBack',
        'easingOut'     : 'easeInBack'
    });
    
    msie7 =  ($.browser.msie && $.browser.version == '7.0') ;
    
    updateFancyLinks();
    updateInputHinweise();
    
    updateMemberInfoInHeader() 

});


function updateFancyLinks() 
{                 
    $("a.fancyAjaxPopup").unbind('click');
    $("a.fancyAjaxPopup").bind("click", function() {
        $.fancybox.showActivity();
        $.ajax({
            url    : $(this).attr("href"),
            success: function(data) {
                $.fancybox(data);
            }
        });
        return false;
    });         
}


function updateInputHinweise() 
{                 
    $(".inputhinweis").unbind('click');
    $('.inputhinweis').bind('click', function(event) {
        $(this).removeClass('inputhinweis').val('');
        return false;
    })
}


function myPopup(url) {
    window.open( url, "myWindow", "status = 1, height = 500, width = 500, resizable = 0" );
}


function StringBuffer() { 
    this.buffer = []; 
} 

StringBuffer.prototype.append = function append(string) { 
    this.buffer.push(string); 
    return this; 
}; 

StringBuffer.prototype.toString = function toString() { 
    return this.buffer.join(""); 
}; 

jQuery.fn.outerScrollHeight = function(includeMargin) {
    var element = this[0];
    var jElement = $(element);
    var totalHeight = element.scrollHeight; //includes padding
    //totalHeight += parseInt(jElement.css("border-top-width"), 10) + parseInt(jElement.css("border-bottom-width"), 10);
    //if(includeMargin) totalHeight += parseInt(jElement.css("margin-top"), 10) + parseInt(jElement.css("margin-bottom"), 10);
    totalHeight += jElement.outerHeight(includeMargin) - jElement.innerHeight();
    return totalHeight;
};
