// common js file for main template page

// add mouseover events to buttons to swap image and preload background images
// img tag must have a class="button" attribute and an over state image (buttonname_o.gif)
$(document).ready(function () {
	var i = 0;
	window['preload'] = new Array();
	$('.button').each(function(){
		window['preload'][i] = new Image();
		window['preload'][i].src = $(this)[0].src.replace(/(.+)\.(.+)/i,"$1_o.$2");
		i++;
	});
	$('.button').hover(
		function(){
			$(this)[0].src = $(this)[0].src.replace(/(.+)\.(.+)/i,"$1_o.$2");
		},
		function(){
			$(this)[0].src = $(this)[0].src.replace(/(.+)_o\.(.+)/i,"$1.$2");
		}
	);
	$('#bg_blur').height($('#content-wrapper').height()+20);
	$('#bg_filmstrip').height($('#content-wrapper').height()+100);
    $(document).pngFix();
});