


jQuery.fn.accessNews=function(settings){settings=jQuery.extend({newsHeadline:"Features",newsSpeed:"normal"},settings);return this.each(function(i){aNewsSlider.itemWidth=parseInt(jQuery(".item:eq("+i+")",".slider").css("width"))+parseInt(jQuery(".item:eq("+i+")",".slider").css("margin-right"));aNewsSlider.init(settings,this);});};var aNewsSlider={itemWidth:0,init:function(s,p){jQuery(".messaging",p).css("display","none");itemLength=jQuery(".item",p).length;newsContainerWidth=itemLength*aNewsSlider.itemWidth;jQuery(".container",p).css("width",newsContainerWidth+"px");jQuery(".next",p).css("display","block");animating=false;jQuery(".next",p).click(function(){if(animating==false){animating=true;animateLeft=parseInt(jQuery(".container",p).css("left"))-(aNewsSlider.itemWidth*2);if(animateLeft+parseInt(jQuery(".container",p).css("width"))>0){jQuery(".prev",p).css("display","block");jQuery(".container",p).animate({left:animateLeft},s.newsSpeed,function(){jQuery(this).css("left",animateLeft);if(parseInt(jQuery(".container",p).css("left"))+parseInt(jQuery(".container",p).css("width"))<=aNewsSlider.itemWidth*2){jQuery(".next",p).css("display","none");}
animating=false;});}else{animating=false;}}
return false;});jQuery(".prev",p).click(function(){if(animating==false){animating=true;animateLeft=parseInt(jQuery(".container",p).css("left"))+(aNewsSlider.itemWidth*2);if((animateLeft+parseInt(jQuery(".container",p).css("width")))<=parseInt(jQuery(".container",p).css("width"))){jQuery(".next",p).css("display","block");jQuery(".container",p).animate({left:animateLeft},s.newsSpeed,function(){jQuery(this).css("left",animateLeft);if(parseInt(jQuery(".container",p).css("left"))==0){jQuery(".prev",p).css("display","none");}
animating=false;});}else{animating=false;}}
return false;});}};


(function($){$.facebox=function(data){$.facebox.init()
$.facebox.loading()
$.isFunction(data)?data.call():$.facebox.reveal(data)}
$.facebox.settings={loading_image:'img/fbox-loading.gif',close_image:'img/fbox-close.gif',image_types:['png','jpg','jpeg','gif'],facebox_html:''+'<div id="facebox" style="display:none;">'+'<div class="popup">'+'<table>'+'<tbody> '+'<tr> '+'<td class="tl"/><td class="b"/><td class="tr"/> '+'</tr> '+'<tr> '+'<td class="b"/> '+'<td class="body"> '+'<div class="content"> '+'</div> '+'<div class="footer"> '+'<a href="#" class="close"> '+'<img src="" title="close" class="close_image" /> '+'</a> '+'</div> '+'</td> '+'<td class="b"/> '+'</tr> '+'<tr> '+'<td class="bl"/><td class="b"/><td class="br"/> '+'</tr> '+'</tbody> '+'</table> '+'</div>'+'</div>'}
$.facebox.loading=function(){if($('#facebox .loading').length==1)return true
$('#facebox .content').empty()
$('#facebox .body').children().hide().end().append('<div class="loading"><img src="'+$.facebox.settings.loading_image+'"/></div>')
var pageScroll=$.facebox.getPageScroll()
$('#facebox').css({top:pageScroll[1]+($.facebox.getPageHeight()/10),left:pageScroll[0]}).show()
$(document).bind('keydown.facebox',function(e){if(e.keyCode==27)$.facebox.close()})}
$.facebox.reveal=function(data,klass){if(klass)$('#facebox .content').addClass(klass)
$('#facebox .content').append(data)
$('#facebox .loading').remove()
$('#facebox .body').children().fadeIn('normal')}
$.facebox.close=function(){$(document).unbind('keydown.facebox')
$('#facebox').fadeOut(function(){$('#facebox .content').removeClass().addClass('content')})
return false}
$.fn.facebox=function(){$.facebox.init()
var image_types=$.facebox.settings.image_types.join('|')
image_types=new RegExp('\.'+image_types+'$','i')
function click_handler(){$.facebox.loading(true)
var klass=this.rel.match(/facebox\[\.(\w+)\]/)
if(klass)klass=klass[1]
if(this.href.match(/#/)){var url=window.location.href.split('#')[0]
var target=this.href.replace(url,'')
$.facebox.reveal($(target).clone().show(),klass)}else if(this.href.match(image_types)){var image=new Image()
image.onload=function(){$.facebox.reveal('<div class="image"><img src="'+image.src+'" /></div>',klass)}
image.src=this.href}else{$.get(this.href,function(data){$.facebox.reveal(data,klass)})}
return false}
this.click(click_handler)
return this}
$.facebox.init=function(){if($.facebox.settings.inited){return true}else{$.facebox.settings.inited=true}
$('body').append($.facebox.settings.facebox_html)
var preload=[new Image(),new Image()]
preload[0].src=$.facebox.settings.close_image
preload[1].src=$.facebox.settings.loading_image
$('#facebox').find('.b:first, .bl, .br, .tl, .tr').each(function(){preload.push(new Image())
preload.slice(-1).src=$(this).css('background-image').replace(/url\((.+)\)/,'$1')})
$('#facebox .close').click($.facebox.close)
$('#facebox .close_image').attr('src',$.facebox.settings.close_image)}
$.facebox.getPageScroll=function(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
return new Array(xScroll,yScroll)}
$.facebox.getPageHeight=function(){var windowHeight
if(self.innerHeight){windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowHeight=document.documentElement.clientHeight;}else if(document.body){windowHeight=document.body.clientHeight;}
return windowHeight}})(jQuery);