sfHover = function() {
	var sfEls = document.getElementById("navMain").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


function open_finder(url)
{
open(url, 'popup', 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=550,height=450');
}


// @author Yannic Stadler
$(document).ready(function() {
	$('a.external').attr('target', '_blank');
	// bookmark
	$('dd.bookmark a').click(function() {
		var title = $('title').text();
		var url = document.URL;
		if($.browser.msie) {
			window.external.AddFavorite(url,title);
		} else {
			window.sidebar.addPanel(title,url,"");
		}
		return false;
	});
	// drucken
	$('dd.print a').click(function() {
		window.print(); 
		return false;
	});
	// accordion
	$('div.accordion ul ul').each(function() { $(this).css('height', $(this).outerHeight()).hide(); });
	$('div.accordion ul li h5').click(function() {
		if($(this).siblings('ul:visible').length > 0) {
			$(this).siblings('ul').slideUp();
			$(this).removeClass('open');
		} else {
			$(this).siblings('ul').slideDown();
			$(this).addClass('open');
		}
		return false;
	});
	
	
	
	//extra Selectbox falls Auswahl "United States" @author cc	
	if ($('#contactForm select#countryAlpha2 option:selected').val() == 'US') {
		$('#contactForm #generated').show();
	};
	
	$('#contactForm select#countryAlpha2').change(function() {
		var country = $(this).find('option:selected').val();		
		
		if (country == 'US') {
			$('#contactForm #generated').slideDown(400);
		}  else if (country != 'US' && $('#contactForm #generated:visible')) {
			$('#contactForm #generated').slideUp(400);
			$('#contactForm #generated option:first').attr('selected', 'selected');
		};
	});
	
});