jQuery.fn.center = function () {
	wrw = $('#wrapper').width() + 10;
	wrh = $('#wrapper').height() +10;
	wh = $(window).height();
	ww = $(window).width();
	if(wh > wrh && ww > wrh) {
    	this.css("position","absolute");
		this.css("margin","0 0 0 0");
    	this.css("top", ( $(window).height() - this.height()) / 2+$(window).scrollTop() + "px");
    	this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
    return this;
	}
}
$(document).ready(function() {
	$('#wrapper').center();
	$(window).resize(function(){
	  $('#wrapper').center();
	});
	$('#slides').cycle({ 
	    timeout: 6000, 
	    speed: 2500
	});
	$('#cinner').jScrollPane({
		showArrows:true,
		topCapHeight: 5,
		bottomCapHeight: 5
	});
	
	$("a[href$=pdf]").each(
	   function(){
	      $(this).attr('target', '_blank');
	});
	$("a[href^=http]").each(
	   function(){
		  if(this.href.indexOf(location.hostname) == -1) { 
	      $(this).attr('target', '_blank');
	    }
	});
	
});
