function clearInputs() {
	$('.search input').each(function() {
		if(!this.val) this.val = this.value;
		this.onfocus = function(){
			if(this.value == this.val) this.value = '';
		}
		this.onblur = function(){
			if(this.value == '') this.value = this.val;
		}
	});
}
$(document).ready(function() {
	clearInputs();
	$('.calendar .mark').hover(function() {
		$(this).removeClass('mark').addClass('active');
	}, function() {
		$(this).removeClass('active').addClass('mark');
	});
	$('.fotoalbum-box h2 a, .fotoalbum-box .frame a').click(function() {
		var newDialog = false;
		if (!document.getElementById('albumLightbox')) {
			$(document.body).append('<div id="albumLightbox" style="display: none;"></div>');
			$('#albumLightbox').html('<iframe id="albumIframe" frameborder=0 width="650" height="578"></iframe>');
			newDialog = true;
		}
		
		$('#albumIframe').attr('src', this.href);
		if (newDialog) {
			$('#albumLightbox').dialog({
				bgiframe: true,
				resizable: false,
				height: 615,
				width: 650,
				modal: true,
				overlay: {
					backgroundColor: '#000',
					opacity: 0.85
				},
				draggable: false
			});
		} else {
			$('#albumLightbox').dialog('open');
		}
		if (typeof(this.title) != 'undefined' && this.title != '') $('#albumLightbox').dialog('option', 'title', this.title);
		return false;
	});
	if (typeof(document.location.hash) != 'undefined' && document.location.hash != '' && document.location.hash != null) {
		if ($(String(document.location.hash))) {
			$(String(document.location.hash)).next('li').find('h2 a').click();
		}
	}

	// allow hover up and down, with mouseover
	$('.hover-bar').hoverIntent({
		over: function() { $(this).find('.bar').slideDown(); }, 
		timeout: 1000,
		out: function() { $(this).find('.bar').slideUp(); } 
	});

	// move up after 2 secs.
	setTimeout("$('.hover-bar .bar').slideUp();", 5000);
});

