/**
 * Programme overview
 * 
 * jQuery 1.3.2
 * load: body
 * 
 * @author AK
 */

// correct height basket btn
var h1 = $('h1.mainHeader').height();
var h2 = $('form#addToBasket div.submit').height();

//alert($('body').css('fontSize'));
var fontSizeInt = parseInt($('body').css('fontSize'));

// jQuery doesn't calculate font-size correctly for IE (when body size set in em)
if ($('body').get(0).currentStyle) { // IE only
	var fontSize =  $('body').get(0).currentStyle['fontSize'];
	if (fontSize.match('em')) {
		// we only use em's for IE6&7
		fontSizeInt = fontSizeInt*(1.34);
	}
	if (h1-h2-2 > 0) {	
		var h = ((h1-2)/fontSizeInt);
		$('form#addToBasket div.submit').height(h+'em').children('input.submit').css('paddingTop', h-2.75+'em').css('paddingBottom', 0.6+'em');
	}
}
else if (h1-h2-2 > 0) {	
	var h = ((h1-2)/fontSizeInt) + 'em';
	$('form#addToBasket div.submit').height(h);
}



// auto-select (programme genre/month)
var a = $('form.genreMonthSelect select').autoSelect({debug:false});
if (a.length) {
	$('form.genreMonthSelect').addClass('genreMonthSelect-auto');
}


