// JavaScript Document
function MapHover(host, direction) {
	var ControlId = host.id.substring(host.id.lastIndexOf('_')+1,host.id.length);
	
	var myCheckBox = new Object;
	var myImage = new Object;
	
	for (i=0; i<checkBoxes.length; i++) {
		myCheckBox[checkBoxes[i].id.substring(checkBoxes[i].id.lastIndexOf('_')+1,checkBoxes[i].id.length)] = checkBoxes[i];	
	}
	for (i=0; i<hoverImages.length; i++) {
		myImage[hoverImages[i].id.substring(hoverImages[i].id.lastIndexOf('_')+1,hoverImages[i].id.length)] = hoverImages[i];	
	}
	if (direction == 'in') {
		myImage[ControlId].style.visibility = 'visible';
	} else {
		myImage[ControlId].style.visibility = 'hidden';
	}
}
function MapClick(host) {
	var ControlId = host.id.substring(host.id.lastIndexOf('_')+1,host.id.length);

	var myCheckBox = new Object;
	var myImage = new Object;
	
	for (i=0; i<checkBoxes.length; i++) {
		myCheckBox[checkBoxes[i].id.substring(checkBoxes[i].id.lastIndexOf('_')+1,checkBoxes[i].id.length)] = checkBoxes[i];	
	}
	for (i=0; i<activeImages.length; i++) {
		myImage[activeImages[i].id.substring(activeImages[i].id.lastIndexOf('_')+1,activeImages[i].id.length)] = activeImages[i];	
	}
	if (myCheckBox[ControlId].checked == false) {
		myImage[ControlId].style.visibility = 'visible';
		if(host.id.indexOf('CB')== -1) myCheckBox[ControlId].checked=true;
	} else {
		myImage[ControlId].style.visibility = 'hidden';
		if(host.id.indexOf('CB')== -1) myCheckBox[ControlId].checked=false;
	}
}
function setAllChecks() {
	var checkSum = false;
	for (i=0; i<checkBoxes.length; i++) {
		checkSum += checkBoxes[i].checked;
	}
	if (checkSum == 0) {
		for (i=0; i<checkBoxes.length; i++) {
			checkBoxes[i].checked = true;
		}
	};
}

function makeDropShadow() {
	var Items = document.getElementsByTagName('h1');
	var mySpan = null;
	var dropShadow = null;
	var myDropShadow = null;
	for (i=0; i<Items.length; i++) {
		if(Items[i].firstChild.nodeType==1) {			
			mySpan = Items[i].getElementsByTagName('span')[0];
			dropShadow = mySpan.cloneNode(true);
			myDropShadow = mySpan.parentNode.insertBefore(dropShadow,mySpan);
			dropShadow.className = "solidText";
			mySpan.className = "dropShadowText";
		};
	};
	var naviHigh = document.getElementById('navigation').getElementsByTagName('li');
	for (i=0; i<naviHigh.length; i++) {
		if(naviHigh[i].firstChild.nodeType==1 && naviHigh[i].className=='active') {			
			mySpan = naviHigh[i].getElementsByTagName('span')[0];
			dropShadow = mySpan.cloneNode(true);
			myDropShadow = mySpan.parentNode.insertBefore(dropShadow,mySpan);
			dropShadow.className = "solidText";
			mySpan.className = "dropShadowText";
		};
	};
};
function setToActive(host) {
	host.className+=' active'
}
function setToInActive(host) {
	host.className=host.className.substring(0, host.className.indexOf('active'));
}
function checkCategory(DefaultCategory) {
	var Category = location.search;
	Category = (Category != '') ? Category.substring(1, Category.length) : DefaultCategory;
	
	if (document.getElementById('Eckdaten')) document.getElementById('Eckdaten').style.display='none';
	if (document.getElementById('Beschreibung')) document.getElementById('Beschreibung').style.display='none';
	if (document.getElementById('Bilder')) document.getElementById('Bilder').style.display='none';
	if (document.getElementById('Anfrage')) document.getElementById('Anfrage').style.display='none';
	if (document.getElementById('Empfehlen')) document.getElementById('Empfehlen').style.display='none';
	if (document.getElementById('Downloads')) document.getElementById('Downloads').style.display='none';
	
	if (document.getElementById(Category)) {
		document.getElementById(Category).style.display='block';
		document.getElementById(Category+'Link').className='active';
	}
}



function doLoadFlash(parent, source, myWidth, myHeight) {
	if (document.getElementById(parent)) {
		var myFlashCode = '';
		myFlashCode+='<object \n';
		myFlashCode+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \n';
		myFlashCode+='codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" \n';
		myFlashCode+='width="'+myWidth+'" \n';
		myFlashCode+='height="'+myHeight+'" \n';
		myFlashCode+='id="unternehmen" \n';
		myFlashCode+='align="middle"> \n';
		myFlashCode+='<param name="allowScriptAccess" value="sameDomain" /> \n';
		myFlashCode+='<param name="movie" value="'+source+'" /> \n';
		myFlashCode+='<param name="quality" value="high" /> \n';
		myFlashCode+='<param name="bgcolor" value="#ffffff" /> \n';
		myFlashCode+='<param name="wmode" value="transparent" /> \n';
		myFlashCode+='<embed \n';
		myFlashCode+='src="'+source+'" \n';
		myFlashCode+='wmode="transparent" \n';
		myFlashCode+='quality="high" \n';
		myFlashCode+='bgcolor="#ffffff" \n';
		myFlashCode+='width="'+myWidth+'" \n';
		myFlashCode+='height="'+myHeight+'" \n';
		myFlashCode+='name="unternehmen" \n';
		myFlashCode+='align="middle" \n';
		myFlashCode+='allowScriptAccess="sameDomain" \n';
		myFlashCode+='type="application/x-shockwave-flash" \n';
		myFlashCode+='pluginspage="http://www.macromedia.com/go/getflashplayer" /> \n';
		myFlashCode+='</object> \n';
		document.getElementById(parent).innerHTML=myFlashCode;
	}
}


