function alignCenter() {
	// Vertically Center With Jquery © Detached Designs (http://www.youtube.com/watch?v=qnSzOUaDdx8)
	var height1 = $(document).height();
	var wrapperHeight1 = $('#wrapper').height();
	$('#wrapper').css({'position': 'relative', 'top' : height1/2 - wrapperHeight1/2});

	var height2 = $('#contents').height();
	var wrapperHeight2 = $('ul#stockists-countries').height();
	$('ul#stockists-countries').css({'position': 'relative', 'top' : height2/2 - wrapperHeight2/2 - wrapperHeight2/12});
}

$(document).ready(function() {

	alignCenter();

	// Changing the default text value on focus with jQuery © Chris Hope (http://www.electrictoolbox.com/jquery-change-default-value-on-focus/)
	$('#s').each(function() {
		var default_value = this.value;
		$(this).focus(function() {
			if(this.value == default_value) {
				this.value = '';
			}
		});
		$(this).blur(function() {
			if(this.value == '') {
				this.value = default_value;
			}
		});
	});

	// Pull Up Menu inspired by Suckerfish Dropdowns © PATRICK GRIFFITHS + DAN WEBB (http://www.alistapart.com/articles/dropdowns/)
	startList = function() {
		if (document.all&&document.getElementById) {
			navRoot = document.getElementById('bottomnav');
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName=='LI') {
					node.onmouseover=function() {
						this.className+=' over';
					}
					node.onmouseout=function() {
						this.className=this.className.replace(' over', '');
					}
				}
			}
		}
	}
	window.onload=startList;

});

$(window).resize(function () {
	alignCenter();
});