$(document).ready(function() {
	// mask for the zipcode input
	$('#zipCodeInput').mask('9999 aa', {placeholder: '.'});

	// png fixes for IE6
	$('.hexContent').ifixpng();
	$('.hexBackground').ifixpng();

	// mouseover for the top menu links
	$('#baseLinks a').hover(function() {
		$(this).find('img').attr('src', '/download/?id=6808847');
	}, function() {
		$(this).find('img').attr('src', '/download/?id=6808850');
	});
	$('a.frameLink').click(function(){
		return false;
	});
	var loadInIframeModal = function(hash){
		var trigger = $(hash.t);
		var modal = $(hash.w);
		var myUrl = trigger.attr('href');
		var myTitle= trigger.attr('title');
		var modalContent = $('iframe', modal);
		modalContent.html('').attr('src', myUrl);
		//let's use the anchor "title" attribute as modal window title
		$('#jqmTitleText').text(myTitle);
		modal.show();
	}
	// initialise jqModal
	$('#modalWindow').jqm({
		modal: true,
		trigger: 'a.frameLink',
		target: '#jqmContent',
		onShow:  loadInIframeModal
	});
});

var resizeContentDiv = function() {
	if ($('#basicContent').length) {
		$('#basicContent').height($(window).height()-305);
		$('#basicContent .border').height($(window).height()-305);
	}
}

$(window).load(resizeContentDiv);
$(window).resize(resizeContentDiv);