$(document).ready(function() {
	
	$('#gallery a').lightBox();
		
	});

// Rollover Flaggen
function change_img(this_obj, flag){
	var path_split = this_obj.attr('src').split('/');
	var file = path_split[path_split.length-1];
	var path = path_split[path_split.length-2];
	
	if(flag == 1)
		this_obj.attr('src', 'img/' + path + '_on/' + file);
	else
		this_obj.attr('src', 'img/' + path.substr(0, path.length - 3) + '/' + file);
	}

function show_layer(id, top, left, width, mtop, mleft) {
	// for our lovely IE
	top ? top + 'px' : '';
	left ? left + 'px' : '';
	width ? width + 'px' : '';
	mtop ? mtop + 'px' : '';
	mleft ? mleft + 'px' : '';
	
	jQuery('.condition').hide();
	jQuery(".fly_message_layer").hide();
	if ((typeof top != 'undefined') && (typeof left != 'undefined') && 
		(typeof mtop != 'undefined') && (typeof mleft != 'undefined')) {
		jQuery('#' + id + '_layer').css({'top' : top, 'left' : left, 'width' : width, 'margin-top' : mtop, 'margin-left' : mleft}).show();
	}
	else if ((typeof top != 'undefined') && (typeof left != 'undefined')) {
		jQuery('#' + id + '_layer').css({'top' : top+'px', 'left' : left+ 'px'}).show();
	}
	jQuery('#' + id + '_layer').show();
}

// Layer schliessen
function hide_layer(id) {
	jQuery('#' + id + '_layer').hide();
}

