if (document.getElementById){
ovr1on = new Image(); ovr1on.src = "templates/home/images/navi_home/icon_willkommen_roll.jpg"; ovr1off = new Image(); ovr1off.src = "templates/home/images/navi_home/icon_willkommen.jpg";
ovr2on = new Image(); ovr2on.src = "templates/home/images/navi_home/icon_eltern_roll.jpg"; ovr2off = new Image(); ovr2off.src = "templates/home/images/navi_home/icon_eltern.jpg";
ovr3on = new Image(); ovr3on.src = "templates/home/images/navi_home/icon_praxis_roll.jpg"; ovr3off = new Image(); ovr3off.src = "templates/home/images/navi_home/icon_praxis.jpg";
ovr4on = new Image(); ovr4on.src = "templates/home/images/navi_home/icon_team_roll.jpg"; ovr4off = new Image(); ovr4off.src = "templates/home/images/navi_home/icon_team.jpg";
ovr5on = new Image(); ovr5on.src = "templates/home/images/navi_home/icon_kontakt_roll.jpg"; ovr5off = new Image(); ovr5off.src = "templates/home/images/navi_home/icon_kontakt.jpg";
ovr6on = new Image(); ovr6on.src = "templates/home/images/navi_home/icon_anfahrt_roll.jpg"; ovr6off = new Image(); ovr6off.src = "templates/home/images/navi_home/icon_anfahrt.jpg";


ovr11on = new Image(); ovr11on.src = "templates/home/images/navi_base/icon_willkommen_roll.jpg"; ovr11off = new Image(); ovr11off.src = "templates/home/images/navi_base/icon_willkommen.jpg";
ovr12on = new Image(); ovr12on.src = "templates/home/images/navi_base/icon_eltern_roll.jpg"; ovr12off = new Image(); ovr12off.src = "templates/home/images/navi_base/icon_eltern.jpg";
ovr13on = new Image(); ovr13on.src = "templates/home/images/navi_base/icon_praxis_roll.jpg"; ovr13off = new Image(); ovr13off.src = "templates/home/images/navi_base/icon_praxis.jpg";
ovr14on = new Image(); ovr14on.src = "templates/home/images/navi_base/icon_team_roll.jpg"; ovr14off = new Image(); ovr14off.src = "templates/home/images/navi_base/icon_team.jpg";
ovr15on = new Image(); ovr15on.src = "templates/home/images/navi_base/icon_kontakt_roll.jpg"; ovr15off = new Image(); ovr15off.src = "templates/home/images/navi_base/icon_kontakt.jpg";
ovr16on = new Image(); ovr16on.src = "templates/home/images/navi_base/icon_anfahrt_roll.jpg"; ovr16off = new Image(); ovr16off.src = "templates/home/images/navi_base/icon_anfahrt.jpg";
}

function img_act(imgName){
	if (document.getElementById){
     	imgon = eval(imgName + "on.src");
        document.getElementById(imgName).src = imgon;
    }
}

function img_inact(imgName){
	if (document.getElementById){
      	imgoff = eval(imgName + "off.src");
        document.getElementById(imgName).src = imgoff;
	}
}

var toggleBox1 = false;
var toggleBox2 = false;
var toggleBox3 = false;

function showDiv(boxNumber){
	if(boxNumber == 1){
		if(toggleBox1){
			//$('#box_content_04').insertBefore($('#box_content_01'));
			$('#box_content_04').hide("blind", { direction: "vertical" }, 1000);
			$('#box_content_01').show("blind", { direction: "vertical" }, 1000);
			document.getElementById("box_reiter_02").style.background = "#f7b200";
			toggleBox1 = false;
		}
	}else if(boxNumber == 2){
		if(toggleBox2){
			//$('#box_content_05').insertBefore($('#box_content_02'));
			$('#box_content_05').hide("blind", { direction: "vertical" }, 1000);
			$('#box_content_02').show("blind", { direction: "vertical" }, 1000);
			document.getElementById("box_reiter_03").style.background = "#ff7b00";
			toggleBox2 = false;
		}
	}else if(boxNumber == 3){
		if(toggleBox3){
			//$('#box_content_06').insertBefore($('#box_content_03'));
			$('#box_content_06').hide("blind", { direction: "vertical" }, 1000);
			$('#box_content_03').show("blind", { direction: "vertical" }, 1000);
			toggleBox3 = false;
			//GUnload();
		}
	}else if(boxNumber == 4){
		if(!toggleBox1){
			//$('#box_content_01').insertBefore($('#box_content_04'));
			$('#box_content_01').hide("blind", { direction: "vertical" }, 1000);
			$('#box_content_04').show("blind", { direction: "vertical" }, 1000);
			document.getElementById("box_reiter_02").style.background = "#82b10b";
			toggleBox1 = true;
		}
	}else if(boxNumber == 5){
		if(!toggleBox2){
			//$('#box_content_02').insertBefore($('#box_content_05'));
			$('#box_content_02').hide("blind", { direction: "vertical" }, 1000);
			$('#box_content_05').show("blind", { direction: "vertical" }, 1000);
			document.getElementById("box_reiter_03").style.background = "#e5460e";
			toggleBox2 = true;
		}
	}else if(boxNumber == 6){
		if(!toggleBox3){
			//$('#box_content_03').insertBefore($('#box_content_06'));
			$('#box_content_03').hide("blind", { direction: "vertical" }, 1000);
			$('#box_content_06').show("blind", { direction: "vertical" }, 1000);
			toggleBox3 = true;
			initialize();
		}
	}
}

/* ========================== */
/* Google maps				= */
/* ========================== */

var map, mapContainer, dirContainer, fromInput, toInput, dirService, dirRenderer, marker, infowindow;
var contentString = '<div id="infocontent"><b>Zahnarztpraxis für Kinder Dr. med. dent. Beatris Zagrean</b><br />Max-Planck-Strasse 3<br />81675 München</div>';

function initialize(){
	mapContainer = document.getElementById('gmap_canvas');
	dirContainer = document.getElementById('gmap_directions');
	fromInput = document.getElementById('fromAddress');
	toInput = document.getElementById('toAddress');
	dirService = new google.maps.DirectionsService();
	dirRenderer = new google.maps.DirectionsRenderer();
	map = null;
	
	var latLng = new google.maps.LatLng(48.135706997611486, 11.597105339169502);
    map = new google.maps.Map(mapContainer, {
      zoom: 15,
      center: latLng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });
    
    marker = new google.maps.Marker({
      position: latLng, 
      map: map, 
      title:"Kinderzahnarztpraxis Dr. Zagrean"
	 });
	 
	infowindow = new google.maps.InfoWindow({
    	content: contentString
	});
	google.maps.event.addListener(marker, 'click', function() {
  		infowindow.open(map,marker);
	});
}

function getDirections() {
    var fromStr = fromInput.value;
    var toStr = toInput.value;
    var dirRequest = {
      origin: fromStr,
      destination: toStr,
      travelMode: google.maps.DirectionsTravelMode.DRIVING,
      unitSystem: google.maps.DirectionsUnitSystem.METRIC,
      provideRouteAlternatives: false
    };
    dirService.route(dirRequest, showDirections);
}

function showDirections(dirResult, dirStatus) {
    if (dirStatus != google.maps.DirectionsStatus.OK) {
      alert('Directions failed: ' + dirStatus);
      return;
    }

    // Show directions
    dirRenderer.setMap(map);
    dirRenderer.setPanel(dirContainer);
    dirRenderer.setDirections(dirResult);
}
