var flashinstalled = 0;
var flashversion = 0;
MSDetect = "false";
if (navigator.plugins && navigator.plugins.length) {
	x = navigator.plugins["Shockwave Flash"];
	if (x)	{
		flashinstalled = 2;
		if (x.description) {
			y = x.description;
			flashversion = y.charAt(y.indexOf('.')-1);
		}
	} else {
		flashinstalled = 1;
	}

	if (navigator.plugins["Shockwave Flash 2.0"]) {
		flashinstalled = 2;
		flashversion = 2;
	}
} else if (navigator.mimeTypes && navigator.mimeTypes.length) {
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin) {
		flashinstalled = 2;
	} else {
		flashinstalled = 1;
	}
} else {
	MSDetect = "true";
}


function insertFlash(flash, x, y) {

	if (flashinstalled == '1') {
		document.write('<p>Bitte installieren Sie den Flash-Player!</p>');
	} else {
		document.write('<object id="coupon_flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width=\"'+x+'\" height=\"'+y+'\">\n');
		document.write('<param name=\"movie\" value=\"'+flash+'\" />\n');
		document.write('<param name=\"quality\" value=\"high\" />\n');
		document.write('<param name=\"wmode\" value=\"transparent\" />\n');
		document.write('<embed src=\"'+flash+'\" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"'+x+'\" height=\"'+y+'\"></embed>\n');
		document.write('</object>\n');
	}
 }

function showCouponForm(status) {
	if (status == 'aus') {
		document.getElementById('form_coupon').style.display = 'none';
	} else {
		document.getElementById('form_coupon').style.display = 'block';
	}
}

function switchCouponDepth(status) {
	if (status == 'zurueck') {
		document.getElementById('coupon_flash').style.zIndex = '500';
	} else {
		document.getElementById('coupon_flash').style.zIndex = '10';
	}
}

function sendCouponForm() {
	document.getElementById('form_coupon').submit();
}

function hideFormParts(status) {
	hidearray = new Array ('label_ort', 'label_strasse');
	for (i=0; i<hidearray.length; i++) {
		if (status=='show') {
			document.getElementById(hidearray[i]).style.display = 'block';
		} else {
			document.getElementById(hidearray[i]).style.display = 'none';
		}
	}
}

function showCouponPrice(behandlung) {
	if (behandlung == 'Zahnschmuck') {
		document.getElementById('coupon_preis').innerHTML = '(50 Euro, 1 Stunde)';
	} else {
		document.getElementById('coupon_preis').innerHTML = '(100 Euro, 1,5 Stunden)';
	}

}