var ca_top=false;var ca_top_scrolled=false;var ca_top_diff=2;var ca_top_offset=(ca_main_width=="100%")?10:0;$(document).ready(function(){if(ca_ie){$("body").addClass("ca-ie").addClass((ca_ie6)?"ca-ie6":"ca-ie7")}});$(window).load(function(){ca_setup_scroll();ca_resize_images();ca_fix_forum_images()});function ca_tables_init(){var a=false;$("div").each(function(b){if(this.className=="block-caption"){a=b;this.setAttribute("id","ca-block-"+b)}if(this.className=="block-content"){if(a!==false){this.setAttribute("id","ca-block-"+a+"-item");$("#ca-block-"+a).dblclick(function(){(ca_ie6)?(($("#"+this.id+"-item").css("display")=="none")?$("#"+this.id+"-item").css("display",""):$("#"+this.id+"-item").css("display","none")):$("#"+this.id+"-item").slideToggle("fast");return false})}a=false}})}function ca_resize_images(){var b,a,c;c=200;a=false;if(ca_main_width&&ca_main_width.indexOf("%")==-1){ca_main_width.replace(/px/,"");if(ca_main_width>0){ca_do_resize_images($("#page-body"),ca_main_width-c);return}}if($("#page-body").width()){a=$("#page-body").width()}if(document.documentElement&&document.documentElement.offsetWidth){a=(a==false||a>document.documentElement.offsetWidth)?document.documentElement.offsetWidth:a}else{if(window.innerWidth){a=(a==false||a>window.innerWidth)?window.innerWidth:a}}if(document.body.clientWidth){a=(a==false||a>document.body.clientWidth)?document.body.clientWidth:a}a=(a==false)?600:(a-c);a=(a<500)?500:a;ca_do_resize_images($("#page-body div.block-content"),a)}function ca_setup_scroll(){if(ca_ie6){return}ca_item=$("#search-box");ca_item2=0;if(ca_item.length){ca_item2+=ca_item.width()}ca_item=$("#topnav");if(ca_item.length){ca_item2+=ca_item.width()}if(ca_item2>0){ca_item2+=50;if(ca_item2<400){ca_item2=400}$("#global").css("min-width",ca_item2+"px")}var c=$("#page-header");var b=$("#navbar-top");if(!c.length||!b.length||!c.offset().top||!c.height()||!document.body.clientWidth){return}ca_top=b.offset().top;c.css({height:c.height()+"px",padding:"0",position:"relative"});b.css({width:c.width()+"px",margin:"0",position:"absolute","z-index":"1"});var a=$("#navbar-top li.navbar-hidden").length;if(($("#navbar-top li").length-a)<3){if($("#navbar-top-top").length){$("#navbar-top-top").addClass("navbar-hidden");a++}}if(a>0){c.addClass("navbar-has-hidden")}$(window).scroll(function(){ca_scroll_top()});$(window).resize(function(){ca_scroll_top()});if(navigator.appName!=="Microsoft Internet Explorer"){ca_scroll_top()}}function ca_scroll_top(){var b=$("#page-header");var a=$("#navbar-top");ca_top=0;if(typeof(window.pageYOffset)=="number"){ca_top=window.pageYOffset}else{if(document.body&&document.body.scrollTop){ca_top=document.body.scrollTop}else{if(document.documentElement&&document.documentElement.scrollTop){ca_top=document.documentElement.scrollTop}}}ca_top-=ca_top_diff;if(ca_top>b.offset().top&&$(document.body).width()>400){if(ca_top_scrolled==false){ca_top_scrolled=true;if(!window.opera){b.css("z-index","1")}a.css({position:"fixed",top:"0","margin-top":(0-ca_top_diff)+"px","margin-left":(0-ca_top_offset)+"px","z-index":"2"});a.addClass("navbar-top-fixed")}a.css("width",(b.width()+(ca_top_offset*2))+"px")}else{if(ca_top_scrolled){ca_top_scrolled=false;a.css({position:"absolute",top:"","margin-top":"0","margin-left":"0","z-index":"2"});a.removeClass("navbar-top-fixed")}a.css("width",b.width()+"px")}}ca_code="ca_init_headers(); ";ca_startup=ca_code+ca_startup;function ca_init_headers(){$("div.block-caption-header").each(function(a){$(this).html('<div class="block-caption-right"></div><table border="0" cellspacing="0" cellpadding="0" width="100%" class="block-caption-table"><tr><td width="45%">&nbsp;</td><td class="block-caption-mid"><div class="block-caption-mid"><div class="block-caption-content">'+$(this).html()+'</div></div></td><td width="45%">&nbsp;</td></tr></table>').removeClass("block-caption-header")});$("div.forabg, div.forumbg").each(function(a){$("li.row:last",this).each(function(b){$(this).addClass("row-last")})})}function ca_fix_forum_images(){$("span.forum-image").each(function(){ca_item=$(this).parent().find(".forum-image-div").css({"float":"none","margin-left":(Math.round($(this).width())+6)+"px"})})};
