	
	
	var ratio = 1697/1129;
	var image_w = 0;
	var image_h = 0;
	var w;
	var h;
	var r;
	
	
	function fontReplace() {
		Cufon.replace('#header a, #submenu a, #fixtures-top a, #theclub-sidebar-main a, #theclub-sidebar-sub a', { hover: true });
		Cufon.replace('h1, h2, h3, .contact_form h3, #latest-messages a', { hover: true });
	}
	
	
	$(document).ready(function() {
		fontReplace();
		wrapReady();
		setSize();
	});
	
	
	$(window).resize(function() {  
		setSize();
	});
	
	
	function wrapReady() {
		var h = $('#container').height()-70;
		if (h>0) {
			$('#wrap-mid').css('height',h+'px');
		} else {
			$('#wrap-mid').css('height','0px');
		}
	}


	function setSize() {
		w = $(window).width();
		h = $(window).height();
		
		r = w/h;
		if (r > ratio) {
			image_w = w;
			image_h = w / ratio;
		} else {
			image_h = h;
			image_w = h * ratio;
		}
			
		$("#background img").attr( "width", image_w );
		$("#background img").attr( "height", image_h );
			
		//$('#background').css( "margin-left", -image_w / 2);
		//$('#background').css( "margin-top", -image_h / 2);
	}
	
	
	function setColumnHeight( left, middle, right ) 
	{
		var lh = $( left ).height();
		var mh = $( middle ).height();
		var rh = $( right ).height();
		
		if ( lh > mh && lh > rh ) 
		{
			$('#theclub-links').css( 'height', lh+'px' );
			$('#theclub-content').css( 'height', lh+'px' );
		} 
		else if ( mh > lh && mh > rh ) 
		{
			$('#theclub-links').css( 'height', mh+'px' );
			$('#theclub-sidebar').css( 'height', mh+'px' );
		}
		else if ( rh > lh && rh > mh ) 
		{
			$('#theclub-content').css( 'height', rh+'px' );
			$('#theclub-sidebar').css( 'height', rh+'px' );
		}
	 }
	 
	 
	 
