$(BT_init);var BT_open_wait=500;var BT_close_wait=5000;var BT_cache_enabled=true;var BT_events=new Array();var BT_titles=new Array();function BT_init(){$("a.betterTip").parent("div.betterTip").hover(function(){BT_hoverIn($(this).children("a.betterTip")[0]);return false},function(){BT_hoverOut($(this).children("a.betterTip")[0])});$("a.betterTip").filter(function(a){return $(this).parent("div.betterTip").length==0}).hover(function(){BT_hoverIn(this)},function(){BT_hoverOut(this)}).click(function(){return false})}function BT_setOptions(a){if(a.openWait!=null){BT_open_wait=a.openWait}if(a.closeWait!=null){BT_close_wait=a.closeWait}if(a.cacheEnabled!=null){BT_cache_enabled=a.cacheEnabled}}function BT_hoverIn(b){var c=BT_open_wait;if($("#BT_cache_"+b.id).length>0){c=0}var d=b.title;if(!BT_titles[b.id]){if(!d||d.toLowerCase()=="$none"){d=""}else{if(d.toLowerCase()=="$content"){d=$(b).text()}}BT_titles[b.id]=d;b.title=""}BT_events[b.id]=1;setTimeout(function(){BT_show(b.id)},BT_open_wait)}function BT_hoverOut(b){BT_events[b.id]=0;setTimeout(function(){BT_remove()},BT_close_wait)}function BT_remove(){$("#BT").remove()}function BT_show(k){if(BT_events[k]==0){return}var h=$("#"+k);var d=h[0].href;var t=BT_titles[k];$("#BT").remove();var s=$("#"+k).parent("div.betterTip");if(s.length>0){k=$("#"+k).parent("div.betterTip")[0].id}h=$("#"+k);var g=true;if(t.length==0){g=false}var m=d.split("?",2);var e=BT_parseQuery(m[1]);m[0]=m[0].substr(m[0].lastIndexOf("/")+1);if(!e.width||e.width.length==0){e.width=250}var p=parseInt(e.width);var j=BT_getLeft(k);var q=BT_getWidth(k);var c=j+q+12;var i=BT_getTop(k);var n="left";var f=self.innerWidth||(document.documentElement&&document.documentElement.clientWidth)||document.body.clientWidth;var r=j+q+11+p+20;var b=-10;var l=-3;var o=-7;var a=-7;if(f<r){n="right";c=j-12-p;b=p;l=-1;if(document.all){b-=2}}else{if(g){l=-2}}if(g){n="title_"+n}$("body").append("<div id='BT' class='BT_shadow0' style='top:"+(i-o-8)+"px; left:"+(c-a-8)+"px;'><div class='BT_shadow1'><div class='BT_shadow2'><div id='BT_main' style='width:"+e.width+"px; top:"+o+"px; left:"+a+"px;'><div id='BT_arrow_"+n+"' style='top: "+l+"px; left:"+b+"px;'></div>"+(g?"<div id='BT_title'>"+t+"</div>":"")+"<div style='padding:5px'><div id='BT_content'><div class='BT_loader'></div></div></div></div></div></div></div>");if(m[0].charAt(0)=="$"){$("#BT_content").html($("#"+m[0].substr(1)).html());$("#BT").show()}else{if(BT_cache_enabled){if($("#BT_cache_"+k).length>0){BT_loadCache(k)}else{$.post(d,{},function(u){BT_createCacheElement(k,u)})}}else{$.post(d,{},function(u){$("#BT_content").html(u);$("#BT").show()})}}}function BT_createCacheElement(b,a){$("body").append("<div id='BT_cache_"+b+"' style='display:none'>"+a+"</div>");BT_loadCache(b)}function BT_loadCache(a){$("#BT_content").html($("#BT_cache_"+a).html());$("#BT").show()}function BT_getWidth(b){var a=document.getElementById(b);return a.offsetWidth}function BT_getLeft(d){var c=$("#"+d)[0];var b=c.offsetLeft;var a=c.offsetParent;while(a){b+=a.offsetLeft;a=a.offsetParent}return b}function BT_getTop(d){var c=$("#"+d)[0];var b=c.offsetTop;var a=c.offsetParent;while(a){b+=a.offsetTop;a=a.offsetParent}return b}function BT_parseQuery(e){var g=new Object();if(!e){return g}var d=e.split(/[;&]/);for(var b=0;b<d.length;b++){var c=d[b].split("=");if(!c||c.length!=2){continue}var a=unescape(c[0]);var f=unescape(c[1]);f=f.replace(/\+/g," ");g[a]=f}return g};
