$(function(){
			if (! ('console' in window) || !('firebug' in console)) {
							var names = ['log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml', 'group', 'groupEnd', 'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd'];
							window.console = {};
							for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {};
				};
jQuery.fn.fadeIn = function(speed, callback) {
    return this.animate({opacity: 'show'}, speed, function() {
        if (jQuery.browser.msie)
            this.style.removeAttribute('filter');
        if (jQuery.isFunction(callback))
            callback();
    });
};

jQuery.fn.fadeOut = function(speed, callback) {
    return this.animate({opacity: 'hide'}, speed, function() {
        if (jQuery.browser.msie)
            this.style.removeAttribute('filter');
        if (jQuery.isFunction(callback))
            callback();
    });
};

jQuery.fn.fadeTo = function(speed,to,callback) {
    return this.animate({opacity: to}, speed, function() {
        if (to == 1 && jQuery.browser.msie)
            this.style.removeAttribute('filter');
        if (jQuery.isFunction(callback))
            callback();
    });
};


			function sidewidths(){
						var tp=$('#thepage').offset();
						tpl=tp.left;
						$('#bluearrowleftback').width(tpl+5);
						$('#bluearrowholderback,#bluearrowholder').show();
			}
			sidewidths();
			$(window).resize(sidewidths);
			$('#topmenu a').bind('mouseenter',function(e){
						//console.debug(e.currentTarget);
						var target=$(e.currentTarget).attr('id');
						var newsub=$('#sub'+target).html();
						var subwidth=$('#sub'+target).attr('title');
						var aspot=$(this).offset();
						$('#bluearrowleft').stop(true).animate({paddingLeft:aspot.left-40-tpl},300);
						if(newsub!=undefined){
									$('#sub1').html(newsub);
									$('#sub1').css({'left':aspot.left-tpl,'width':subwidth}).slideDown(400);
						}
						else{
									$('#sub1').hide();
						}

			});
			$('#topmenu').bind('mouseleave',function(){
						var aspot=$(this).offset();
						$('#sub1').stop(true,true);
						$('#sub1').hide();
					$('#bluearrowleft').animate({paddingLeft:20},300);
			});
			$('.sbox').each(function(i){
						var title=$(this).attr('title');
						var temp=$(this).html();
						//console.debug(temp);
						$('#hiddenarea').append("<div class='sboxcontent' id='sboxtemp"+i+"'>"+temp+"</div>");
						var htemp=$('#sboxtemp'+i).height();
						//console.debug(htemp);
						var sliverheight=htemp-140;
						$(this).html("<div class='sboxtop'><div class='sboxtitle'>"+title+"</div></div>");
						$('#sboxtemp'+i).appendTo($(this));
						$(this).append("<div class='sboxsliver' style='height:"+sliverheight+"px'>&nbsp;</div><div class='sboxbottom' />");
						$(this).show();
			   $('.bignum',$(this)).each(function(){
									var idv=$(this).attr('id');
									var max=$(this).attr('title');
									incrementbn($("#"+idv),0,max);
						});
			})
			$('#addrbar a').hover(function(){$(this).addClass('over');},function(){$(this).removeClass('over');});
			$('.staffperson').live('click',function(){
						var id=$(this).attr('id');
						$('#bigbio').fadeOut();
						$('#bigbio').load("/staff/"+id+".php",function(){$('#bigbio').fadeIn(800,function(){$('.colorlist li').wrapInner("<span class='normal'></span>");var off=$('#bigbio').offset();$('html,body').animate({scrollTop:off.top},1000);$('#bigbio').append("<div id='back2staff'><a href='#staffpage'>Back to Staff List</a></div>");});});
			});
			$('#back2staff a').live('click',function(){$('html,body').animate({scrollTop:$('#staffpage').offset().top},1000);return false;})
//END JQ
})



var ttt;
function incrementbn(holder,current,max){
			//console.debug($(holder),holder,current,max);
			current=current+1;
			if(current<=max){
						$(holder).text(current+'%');
						//console.debug($(holder),holder,current,max);
						ttt=setTimeout(function(){incrementbn(holder,current,max)},26);
			}
			else{
						//console.log('End');
						$(holder).css('color','');
			}
}
