// This installs a function with the name "contains" in the prototype of the node-object if if this is not predefined
if (window.Node && Node.prototype && !Node.prototype.contains)
{
	Node.prototype.contains = function (arg)
	{
		return !!(this.compareDocumentPosition(arg) & 16);
	}
}

function fadeIn(elm,e)
{
	e = e || window.event;
	var fromElement = e.relatedTarget || e.fromElement || false;
	if (!elm.contains(fromElement))
	{
		//$(elm).children().filter('ul').attr('style','display:block')
		$(elm).children().filter('ul').fadeIn();
	}
}

function fadeOut(elm,e)
{
	e = e || window.event;
	var toElement = e.relatedTarget || e.toElement || false;
	if (!elm.contains(toElement))
	{
		//$(elm).children().filter('ul').attr('style','display:none')
		$(elm).children().filter('ul').fadeOut();
	}
}


$(document).ready(function(){
	$('.menu img[name]').hover(function(){this.src = this.src.replace('_lo','_hi')},function(){this.src = this.src.replace('_hi','_lo')});
	$('.faq dt').hover(function(){this.style.color = '#BCD579'; $(this).children().filter('img[name]').attr('src','/experten/art/buttons/b_pfeil_ro.gif')},function(){this.style.color = ''; $(this).children().filter('img').attr('src','/experten/art/buttons/b_pfeil_lo.gif')});
});


function doLinkMeTo(destination)
{
	switch (destination)
	{
		case 'Kontakt':
			PopUp('/experten/siteutilities/kontakt.asp?scope=expert','Siteutilities',589,684,'no');
			break;
		case 'Impressum':
			PopUp('/experten/siteutilities/impressum.asp?scope=expert','Siteutilities',589,684,'no');
			break;
		case 'Datenschutz':
			PopUp('/experten/siteutilities/datenschutz.asp?scope=expert','Siteutilities',589,684,'no');
			break;
		case 'Laetta':
			PopUp('/experten/index.asp','Siteutilities');
			break;
	}
}