/*! --- onload --- */

$(document).ready(function()
{
	set_external_links();

	if($('#imgBlock').length){
		$('#imgBlock a').lightBox({slideshow: false,fixedNavigation:true});
	}
});

/*! --- functions --- */

// open external links in a new window
function set_external_links() {
	var server = 	window.location.protocol + '//' +  window.location.host;
	
	// (get absolute links) (not on this server)
	$('a[href^=http]').not('a[href^="'+server+'"]').click(function(ev){
		ev.preventDefault();
		// open a new window
    window.open(this.href);
    return false;
	});
}

// hide text in input on click (useful for search boxes)
function show_hide_text(el) {
	$(el).each(function() {
		document['def_'+$(this).attr('name')] = $(this).attr('value');
		
		$(this).focus(function() {
			if($(this).attr('value') == document['def_'+$(this).attr('name')]) { $(this).attr('value',''); }
		});
		
		$(this).blur(function() {
			if($(this).attr('value') == '') { $(this).attr('value',document['def_'+$(this).attr('name')]); }
		});
		
	});
}
