var Layout = {
	
	navRendered: false,
	
	//Render NAV dropdowns
	renderNav: function() {
		
		if (!this.navRendered) {
			this.navRendered = true;
		}else{
			return;
		}
		
		var round = true;
		//I know it's deprecated.. but I just need to know if this is IE7.
		if (jQuery.browser.msie && jQuery.browser.version=='7.0') {
			round = false;
		}
		
		$('#nav ul li').each(function() {
			$(this).mouseenter(function() {
				$(this).children('ul').show();
				$(this).children('a').addClass('hover');
				if (round) $(this).children('ul').siblings('a').corner('bottom 1px');
			}).mouseleave(function() {
				$(this).children('ul').hide();
				$(this).children('a').removeClass('hover');
				if (round) $(this).children('ul').siblings('a').corner('bottom 5px');
			});
		});
				
		if (round) $('#nav ul li a').corner("5px");
		$('#nav ul li ul').siblings('a').corner('bottom 1px');
		$('#nav ul li ul li a').uncorner();
		$('#nav ul li ul').corner('bottom 5px');
		if (round) $('#nav ul li a.selected').corner("5px");
		
		//subnav
		$('#subnav ul li a').corner("5px");
		
		$('#subnav ul li a.selected').parent().append('<div class="arrow"></div>');
		
		$('#home-testi-balloon').corner("5px");
	},
	
	//Round the corners of boxes
	renderBox: function() {
		$('.box').corner('6px');
		$('.box h2').corner('top 6px');
		
		//What's next box
		//this is a fix applies to IE.
		$('.what').corner('bottom cc:#c5f9af');
		$('#testi-box').corner('top cc:#c2f7af 6px');
	},
	
	//Render the showreel
	renderShowReel: function() {
		
		//Stop this function if the slider not found
		if (document.getElementById('slider') == null) return;
		$('#slider')
		.before('<div id="slider-nav">')
		.cycle({
			fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
			pager: '#slider-nav',
			timeout: 6000
		});
	},
	
	renderVersionNumber: function() {
		
		$.get('/js/version.txt', function(data) {
			$('#build-info-number').html(data);
		});
	}
};