
function changeImage(imageId) {
	
	for(i=0;i<100;i++) {
		if (document.getElementById('detail'+i)) {
			if (i == imageId) {
				document.getElementById('detail'+i).style.display='block';
			} else {
				document.getElementById('detail'+i).style.display='none';
			}
		}
	}
	
}

function setflash(ffile,fvars,fwidth,fheight,ffname){

	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+fwidth+'" height="'+fheight+'" name="'+ffname+'" id="'+ffname+'" align="middle">');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="movie" value="'+ffile+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="Play" value="True" />');
	document.write('<param name="bgcolor" value="#FFFFFF" />');
	document.write('<param name="FlashVars" value="'+fvars+'" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="'+ffile+'" id="'+ffname+'"  FlashVars="'+fvars+'" wmode="transparent" quality="high" bgcolor="#FFFFFF" width="'+fwidth+'" height="'+fheight+'" name="'+ffname+'" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
	document.write('</object>');

}

function kundenkarte_open(adresse) {
	kundenkarte = window.open(adresse, "toomkundenkarte", "width=600,height=710,resizable=0,scrollbars=1");
	kundenkarte.focus();
}

function popup(w,h,site, name) {
	var win = window.open(site,name,'width='+w+',height='+h+',left=400,top=200, scrollbars=yes, resize=no');
	win.focus();
}

function set_popup() {
	var padding;
	(navigator.appName == "Microsoft Internet Explorer") ? (padding = 10) : (padding = 0);

	document.getElementById('tippWrapper').style.top='0';
	document.getElementById('tippWrapper').style.left='0';
	document.getElementById('tippWrapper').style.zIndex='10010';
	document.getElementById('tippWrapper').style.height='2600';
	document.getElementById('tippWrapper').style.width='2600';
	document.getElementById('tippWrapper').style.background='red';
	document.getElementById('tippWrapper').style.position='absolute';
	//document.getElementById(id).style.overflow='visible';
	document.getElementById('tipp-layer').style.display='inline';
}

function unset_popup(id) {
	document.getElementById(id).style.display='none';
}

function myrating() {
	if (document.getElementById('rating_1').style.display == 'block') {
		document.getElementById('rating_1').style.display='none';
		document.getElementById('rating_2').style.display='none';
	} else if (document.getElementById('rating_1').style.display == 'none') {
		document.getElementById('rating_1').style.display='block';
	}
}

function mycomments() {
	if (document.getElementById('rating_2').style.display == 'block') {
		document.getElementById('rating_2').style.display='none';
	} else if (document.getElementById('rating_2').style.display == 'none') {
		document.getElementById('rating_2').style.display='block';
	}
}


var myPoint = false;

function googleLoad(x, y, ort) {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("map"));
		map.setCenter(new GLatLng(x,y), 16);

		// Control
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());

		// Create our "tiny" marker icon
		var icon = new GIcon();
		icon.image = "http://www.toom-baumarkt.de/fileadmin/img/marktfinder/logo.png";
		icon.shadow = "http://www.toom-baumarkt.de/fileadmin/img/marktfinder/schatten.png";
		icon.iconSize = new GSize(166, 29);
		icon.shadowSize = new GSize(166, 29);
		icon.iconAnchor = new GPoint(17.5, 52);
		// wichtig. 1/4 und einmal ganz
		icon.infoWindowAnchor = new GPoint(5, 1);

		// Erstellt die marker
		function createMarker(point, info, icon) {
			var marker = new GMarker(point,icon);
			GEvent.addListener(marker, "mouseover", function() {
			marker.openInfoWindowHtml(info);
			});
			return marker;
		}

		myPoint = createMarker(
		new GLatLng(x,y),
			'<br>Geben Sie hier Ihre Ausgangsposition ein: <form action="http://maps.google.com/maps?" target="_blank"><input type="hidden" name="daddr" value="'+ort+'" /><input type="text" style="border:1px solid #333333;" value="" name="saddr"><input type="submit" style="border:1px solid #333333;margin-left:5px;" value="Route abrufen"></form>',
			icon
		);

		map.addOverlay(myPoint);
	}
}

	var opened = false;
	var loaded = false;
	var sendStr = "";
	var movie = "";


	function openMicrosite(str)
	{
		opened = true;
		if(str)
			sendStr = str;
		else
			sendStr = "0";
		
		document.getElementById('divMicrosite').style.width = '100%';
		document.getElementById('divMicrosite').style.height = '100%';

		if(loaded == true)
			sendToFlash();
	}

	function closeMicrosite()
	{
		opened = false;
		document.getElementById('divMicrosite').style.width = '1px';
		document.getElementById('divMicrosite').style.height = '1px';

	}

	function saveLoaded()
	{
		loaded = true;
		if(opened == true)
			sendToFlash();
	}


	function sendToFlash()
	{
		thisMovie('microsite').startFlash(sendStr);
	}
	
	function thisMovie(movieName)
	{
		if (navigator.appName.indexOf('Microsoft') != -1)
		{
			return window[movieName];
		}
		else
		{
			return document[movieName];
		}
	}