function submitForm(form, action) {
	if (form.elements['action']) {
		form.elements['action'].value = action;
	}
	if (!form.onsubmit || form.onsubmit()) {
		form.submit();
	}
}

function updateNewsletterEmail(element, name) {
	element.form.elements[name].value = element.value;
}

function selectNewsletterEmail(element, name) {
	element.oldValue = element.value;
	element.value = element.form.elements[name].value;
	if (element.value != '') {		element.select();
	}
}

function unselectNewsletterEmail(element, name) {
	if (element.form.elements[name].value == '') {
		element.value = element.oldValue;
	}
}

function initLightBox(selector, txtImage) {
	$(function() {
		$(selector).lightBox({
			fixedNavigation: false,
			txtImage: txtImage,
			txtOf: 'z',
			imageBtnNext: '/images/lightbox/next.gif',
			imageBtnPrev: '/images/lightbox/prev.gif',
			imageBtnClose: '/images/lightbox/close.gif',
			imageLoading: '/images/lightbox/lightbox-ico-loading.gif'
		});
	});
}

function adjustHeight(selector) {
	var max = 0;
	$(selector)
		.each(function() { max = Math.max(max, $(this).height()); })
		.each(function() { $(this).css('height', max); });
}	

