$j(document).ready(function(){
   rb.init();
});

var rb={
    init:function(){   		
		var scr_height=window.screen.availHeight;       
		var doc_height=$j(document).height();		
        var height=scr_height-210;
		
        $j('#report_bug').css('top',height+'px');  		
		$j('#report_bug_overlay').fadeTo(1,0,function(){$j(this).css({'height':doc_height+'px',background:'#000'});});
        $j('#report_bug').hover(function(){rb.over();},function(){rb.out();});
        //$j('#report_bug_button').click(function(){rb.click();});
        $j('#report_bug_window').find('.close').click(function(){rb.close_window();});
    },
    close_window:function(){        
        $j('#report_bug_window').fadeOut('fast');		
        $j('#report_bug_overlay').fadeTo(1,0).css('z-index',-1);
    },
    click:function(){      
		var height=window.screen.availHeight;        
        var width=$j(document).width();		
		
        width=(width/2)-250;
		height=(height/2)-250;
		
        $j('#report_bug_overlay').css({'z-index':100}).fadeTo('fast',.70);
        $j('#report_bug_window').css({left:width+'px',top:height+'px'}).fadeIn('normal');
    },
    over:function(){
        $j('#report_bug_button').children('.report_bug_norm').css('display','none');
        $j('#report_bug_button').children('.report_bug_over').css('display','block');        
    },
    out:function(){
        $j('#report_bug_button').children('.report_bug_norm').css('display','block');
        $j('#report_bug_button').children('.report_bug_over').css('display','none');        
    }
}
