/*code for fixed scroll div*/
function fixed_floating_div(float_containor, main_containor, float_content) {
    var top = $(float_containor).offset().top; //- parseFloat($('.right-content').css('margin-top').replace(/auto/, 0));
    var containerTop = $(main_containor).position().top;
    var containerHeight = $(main_containor).innerHeight();
    var right_content_width = $(float_containor).width();

    var content_area_height = $(main_containor).innerHeight();
    var right_content_height = $(float_containor).innerHeight()

    $(window).scroll(function (event) {
        var menuHeight = $(float_content).innerHeight();
        // what the y position of the scroll is
        var y = $(this).scrollTop();

        // whether that's below the form
        if(content_area_height > right_content_height){
        if( y <= (containerTop + containerHeight - menuHeight)){
            $(float_content).removeClass("pos_abs").removeAttr("style");
            if (y >= top) {
                // if so, ad the fixed class
                if($.browser.msie && $.browser.version == "6.0"){
                    $(float_content).css('position','absolute').css("top",y+"px");
                }else{
                    $(float_content).addClass('fixed').css("width",right_content_width);
                }
            } else {
                // otherwise remove it
                $(float_content).removeClass('fixed');
            }
        }else{
            $(float_content).removeClass('fixed').addClass("pos_abs").css("top",(containerTop + containerHeight - menuHeight)+"px").css("width",right_content_width);
        }
        }
    });



}
/*code for fixed scroll div*/
