// JavaScript Document

    var map = null;
    var geocoder = null;

	
function load() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        geocoder = new GClientGeocoder();
        showAddress("Elbchaussee 94, 22763 Hamburg, DE");
      }
    }
   
function showAddress(address) {
	
  if (geocoder) {
    geocoder.getLatLng(address, function(point) {
      if (!point) { }
      
      else {
        map.setCenter(new GLatLng(53.564444, 9.95555), 12);
        map.addControl(new GSmallMapControl());

        var marker = new GMarker(point);
        map.addOverlay(marker);
        address2="<b>Landhaus Dill</b><br/>Elbchaussee 94<br/>22763 Hamburg<div style='display:none'><br /><a href='http://maps.google.de/maps?daddr=Elbchaussee+94,+22763+Hamburg' target='_blank'>zum Routenplaner</a></div>";
        marker.openInfoWindowHtml(address2);
      }
    }
    );
  }
}




function go(divId)
{
	var a = window.open('','','scrollbars=yes, width=600,height=400');
	a.document.open("text/html");
	a.document.write('<html><head><link rel="stylesheet" type="text/css" href="styles.css"></head><body style="background-image:url()" ><div id="print" ><div class="noteText">');
	a.document.write(document.getElementById(divId).innerHTML);
	a.document.write('</div></div></body></html>');
	a.document.close();
	a.print();
}


function marktplatz(change){
  if(change=='on'){
    document.getElementById('marktplatz').style.color="#FFFFFF"
  }
  if(change=='out'){
    document.getElementById('marktplatz').style.color="#999999"
  }  
}

function flagOnMouseover(){
  document.getElementById('lang-text').style.display='block';
}
function flagOnMouseout(){ 
  document.getElementById('lang-text').style.display='none';
}
function changeLanguage(lang){
  if(lang=='eng'){
    window.location.href='/english.php';
  }
  if(lang=='ger'){
    window.location.href='/index.php';  
  }
}

var activeNav1='';
var activeNav2='';

function nav(a,b,c,d,e,f,g,h,i,j,k,l,m,n) {
  if(b==1)
    activeNav1=true;
  if(j==1)
    activeNav2=true;    
  set=[a,b,c,d,e,f,g,h,i,j,k,l,m,n];
  colors=['#3A559A','#004080','#002040'];
  navs=['navAllgemeines','navSpeisen','navSpeisekarte','navTageskarte','navMittagstisch','navSchlemmermenu','navWeine','navKontakt','navReservieren','navVerschiedenes','navVeranstaltungen','navFeier','navGastebuch','navRezepte'];
  
  for(i=0;i<14;i++){
    document.getElementById(navs[i]).style.backgroundColor=colors[set[i]];
  }
}


function speisen() {
  if(activeNav1!=true){
    activeNav1=true;  
    nav(0,1,1,1,1,1,0,0,0,0,0,0,0,0)
  }
}


function verschiedenes() {
  if(activeNav2!=true){
    activeNav2=true;  
    nav(0,0,0,0,0,0,0,0,0,1,1,1,1,1)
  }
}    



function browserWindowSize() {
var browserWinWidth = 0, browserWinHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
browserWinWidth = window.innerWidth;
browserWinHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
browserWinWidth = document.documentElement.clientWidth;
browserWinHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
browserWinWidth = document.body.clientWidth;
browserWinHeight = document.body.clientHeight;
}
a = new Array();
a[0] = browserWinWidth;
a[1] = browserWinHeight;

return a;
}

function repositioning(){

  size = browserWindowSize();
  if(size[1]<564){
    if(document.getElementById('container')){
      document.getElementById('container').style.top='0%';
      document.getElementById('container').style.marginTop='15px'; 
    }
  }
  if(size[0]<994){
    if(document.getElementById('container')){
      document.getElementById('container').style.left='0%';
      document.getElementById('container').style.marginLeft='15px';   
    }  
  }

}

function initResize(){
  window.setTimeout('repositioning()', 200);
  window.setTimeout('repositioning()', 500);
  window.setTimeout('repositioning()', 800);  
  window.setTimeout('repositioning()', 1500);
}
function start(){
  window.setTimeout('initAktuell()', 1500);

}
 window.onResize = initResize();

