
// Google App Engine
// http://compressor.ebiene.de/

var ndate = new Date();
var yy = ndate.getYear();
if (yy < 2000 && yy > 99){ yy = yy + 1900; } else if (yy < 2000 && yy < 99){ yy = yy + 2000; }



function initMenus() {


	$('ul.menu1 ul').hide();


	$.each($('ul.menu1'), function(){
		$('#' + this.id + '.expandfirst ul:first').show();
	});


	$('ul.menu1 li a').click(

		function() {

			var checkElement = $(this).next();
			var parent = this.parentNode.parentNode.id;

			if($('#' + parent).hasClass('noaccordion')) {
				$(this).next().slideToggle('normal');
				return false;
			}

			if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				if($('#' + parent).hasClass('collapsible')) {
					$('#' + parent + ' ul:visible').slideUp('normal');
				}
				return false;
			}

			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				$('#' + parent + ' ul:visible').slideUp('normal');
				checkElement.slideDown('normal');
				return false;
			}
		}
	);
}


function initContMenu() {


	$('ul.menu2 ul').hide();


	$.each($('ul.menu2'), function(){
		$('#' + this.id + '.expandfirst ul:first').show();
	});


	$('ul.menu2 li p').click(
	// $('ul.menu2 li a').click(

		function() {

			var checkElement = $(this).next();

			var parent = this.parentNode.parentNode.id;

			// alert (parent);

			if($('#' + parent).hasClass('noaccordion')) {
				$(this).next().slideToggle('normal');
				return false;
			}

			if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				if($('#' + parent).hasClass('collapsible')) {
					$('#' + parent + ' ul:visible').slideUp('normal');
				}
				return false;
			}

			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				$('#' + parent + ' ul:visible').slideUp('normal');
				checkElement.slideDown('normal');
				return false;
			}
		}
	);
}


function load() {



if (GBrowserIsCompatible()) {

		if (document.getElementById('mp')) {

			var map = new GMap2( document.getElementById('mp') );
			map.setCenter( new GLatLng(54.267029,+12.517204),12);
			// map.addControl( new GSmallMapControl() );
			map.addControl(new GLargeMapControl());
			map.addControl( new GMapTypeControl() );
			// map.setMapType(G_HYBRID_TYPE);
			//var marker = new GMarker( map.getCenter() );
			//var mText = "<p style=\"font-family:verdana,arial,sans-serif; font-size: 10pt;color:silver; margin:8px; padding:10px; border:1px solid silver;\">Simone Moench<br>Schmuckgestaltung<br>und -fertigung<\/p>"
			//map.addOverlay(marker);
			//marker.openInfoWindowHtml(mText);
			//GEvent.addListener( marker, "click", function() { marker.openInfoWindowHtml(mText); } );

			function createMarker(point, number){
				var marker = new GMarker(point);
				GEvent.addListener( marker, "click", function(){ marker.openInfoWindowHtml("" + number + ""); } );
				return marker;
				}

			map.addOverlay(createMarker(new GLatLng(54.265208,+12.51044), '<p style=\"font-family: verdana,arial,sans-serif; font-size: 10pt; color: black; margin:8px; padding:10px; padding-left: 35px; \/*border:1px solid silver;*\/\">Simone Mönch<br>Schmuck<\/p>'));
			//map.addOverlay(createMarker(new GLatLng(54.26,+12.51), 'test'));

			}

		if (document.getElementById('xxx')) {
			// usw.
			}
	}

}


function bgf() {
	var bg = "";
	for (var i = 1; i <= 255; i++){ bg = bg + "\<div id='d" + i + "'><!-- --><\/div>\n"; }
	document.writeln(bg);
}


function rahmen1(box){
document.getElementById(box).style.borderColor = "#c2c2c2";   
// initContMenu();

}


function rahmen2(box){
document.getElementById(box).style.borderColor = "#efefef";
// initContMenu();
}


function fokus() {
this.document.fbs.title.focus();
}

function f(x) {
document.getElementById(x).select();
}
