$().ready(function() {
				   
	/*
	// Color Highlight rows
	$('TABLE.chart TR:even').addClass("alt");
	$('TABLE.chart TR').mouseover(function () {
		$(this).addClass("over");
	});
	$('TABLE.chart TR').mouseout(function () {
		$(this).removeClass("over");
	});
	*/
	
	$('#main a[href="/size-charts.php"]').click(function (e) {
		popover('#chart');
		e.preventDefault();		
	});
		
	$('#main a[href="/about/fabrics.php"]').click(function (e) {
		popover('#fabrics');
		e.preventDefault();
	});
		
	$('#main a[href="/about/padding.php"]').click(function (e) {
		popover('#padding');
		e.preventDefault();
	});
	
	$('.close, #hide_back, #fabrics, #chart, #padding').click(function (e) {
		e.preventDefault();
		$('#fabrics, #chart, #padding').hide('slow');
		$('#hide_back').fadeTo(1000,0).hide();
	});
	
	function popover ($ID) {
		o_top  = $('#main').offset().top;
		o_left = $('#main').offset().left;
	
		if($(window).height() > $('html').height()) {
			m_height = $(window).height();
		} else {
			m_height = $('body').height()+60;
		}
		
		if($(window).width() > $('body').width()) {
			m_width = $(window).width();
		} else {
			m_width = $('body').width();
		}
		
		$('#hide_back').height(m_height);
		$('#hide_back').width(m_width);
		
		o_top = '-' + o_top + 'px';
		o_left = '-' + o_left + 'px';
		
		$('#hide_back').css({top: o_top,left: o_left});
		
		$('#hide_back').css('display','block');		
		$($ID).show('slow');						
		$('#hide_back').fadeTo(0,0.33);
		
	}
});