jQuery(function(){

// Haven't figured this bit out yet
jQuery(".banner-nav").liScroll({travelocity:0.05});

// Keeps the right hand navigation in the browser viewport
var top=jQuery('#sidenavigation').offset().top-parseFloat(jQuery('#sidenavigation').css('marginTop').replace(/auto/,0));jQuery(window).scroll(function(event){var y=jQuery(this).scrollTop();if(y>=top){jQuery('#sidenavigation').addClass('fixed');}else{jQuery('#sidenavigation').removeClass('fixed');}});

// Tabs code, required on Tenants page to fire calculator
jQuery("#tabs").tabs();jQuery('.calculatoropen').click(function(e){e.preventDefault();var jQuerythis=jQuery(this);jQuery('<iframe border="none" style="border:none;overflow:hidden;" scrolling="no" id="externalSite" class="calculator" src="'+this.href+'" />').dialog({title:(jQuerythis.attr('title'))?jQuerythis.attr('title'):'Affordability calculator',autoOpen:true,width:325,height:326,modal:false,resizable:false,autoResize:false,show:'drop',hide:'drop',overlay:{opacity:0.5,background:"white"}});
});

// Form modal window code maybe
jQuery('#formpop').parent().appendTo(jQuery("form:first"));

// Home Page Slideshow
jQuery('.hero').cycle({
	fx:'scrollHorz',
	speed:2900,
	timeout:10000,
	easing:'easeInOutSine'
});

// Accordion, used on Insurance page for example
jQuery(".accordion").accordion({
	header:"h3",
	collapsible:true,
	active:false,
	autoHeight:false,
	navigation:true
});

// RSS feed
jQuery("#ticker").liScroll({
	travelocity:0.05
});

// Testimonial Code
jQuery('.testimonialwrapper').cycle({
		fx:'fade',
		speed:1500,
		timeout:7000,
		random:1
	});
});
