$(function() {
	$('#quickBg div h4').click(function(){
		var parentElem = $(this).parent();
		if(parentElem.attr('class').indexOf('open') >= 0) {
			parentElem.removeClass('open');
			parentElem.addClass('close');
		} else {
			parentElem.removeClass('close');
			parentElem.addClass('open');
		}
		return false;
	})  
	$('#navPrimary li li').mouseover(function(){
		var parentObject = $(this).parent().parent().find('a');
		parentObject[0].style.color = '#A71930';
	}).mouseout(function(){
		var parentObject = $(this).parent().parent().find('a');
		parentObject[0].style.color = '';
	})
	
	  //hide the all of the element with class msg_body
	  $(".contacts_body").hide();
	  //toggle the componenet with class msg_body
	  $(".contacts_title").click(function(){
		$(this).next(".contacts_body").slideToggle(600);
	  });
	  $(".contacts_title:first").click();
	  
	  $('#downloadForm, .downloadForm').submit(function(){
		  d = $(this).find('select option:selected').val();
		  if(d != ''){
			  window.open(d );
		  }
		  return false;
		  	
	  });
	  
	  // 3D-Modelldatenbank
	  $(".category_title").click(function(){
			$(this).next(".contacts_body").slideToggle(600);
	  });
	  
	  // Hide all lower ul's
	  $("li ul.treemenu1").hide();
	  $("ul.treemenu1 li strong.openable").click(function(){
		  	if($(this).parent().children('ul.treemenu1')){
		  		if ($(this).hasClass("open")) {
			  		$(this).removeClass('open');
				  } else {
					$(this).addClass('open');
				  }	
		  		$(this).parent().children("ul.treemenu1").slideToggle(600);
		  	}
		  	
		  	

			
			
	  });  
});
