﻿// RELIS, relis.de 2009 Basic JavaScript Document in combination with jQuery



$(document).ready(function() {

	  /* show current, active subsection  */
	var $currentSection = $('h5.current');

	var $currentSectionId = $('h5.current').parent().attr("id"); // get ID of current subsection
	//alert('currentSectionId: ' + $currentSectionId);
	var $currentSectionList = $('h5.current').next(); // gets current submenu list ul
	//$currentSectionList.css('display','block');	
	
//	$('.dropdown').css('display','none');
//	$('.dropdown').slideDown("slow");
	$currentSectionList.slideDown("slow");
			

	
	$('.dropdown').hover(function() {	
								  
	 
//	$('#top ul.active').fadeTo(1500, 0.3);
//	$('#top ul.active').fadeOut(1500);
//	$currentSectionList.fadeOut("slow");

//	if (this.id == 'dropdown2') {
	if (this.id == $currentSectionId) {
		// alert(".dropdown h5 is current section: " + this.id);
		 $currentSectionList.css('display','block');	
	/* }
	 else if (this.id == 'dropdown3') {
		 $currentSectionList.css('display','block');	
	 } 
	 else if (this.id == 'dropdown4') {
		 $currentSectionList.css('display','block');
	 } 
	 else if (this.id == 'dropdown5') {
		 $currentSectionList.css('display','block');*/
	 } else {	 
		 // alert(".dropdown h5 is NOT current section");
		$currentSectionList.css('display','none');
	 }; 
	$currentSection.css('border-left', 'solid 1px #ffffff'); 

   }, function() {
 
	  $currentSection.css('border-left', 'solid 1px #c5c6c7'); 
	
//	$currentSectionList.fadeIn("slow");
//	$currentSectionList.slideDown("slow");
	$currentSectionList.css('display','block');	
  });
	
/*	$('h5.current').hover(function() {	
		$currentSectionList.css('display','block');	
		$currentSection.css('border-left', 'solid 1px #c5c6c7'); 
	

  });
	
	 $('h5.current a').hover(function() {
		$currentSectionList.css('display','block');	
		$currentSection.css('border-left', 'solid 1px #c5c6c7'); 
  });
	 
	
	 
	  $('ul.active').hover(function() {
		$currentSectionList.css('display','block');	
		$currentSection.css('border-left', 'solid 1px #c5c6c7'); 
  });*/
	 
	  $('ul.active li a').hover(function() {
		$currentSectionList.css('display','block');	
		$currentSection.css('border-left', 'solid 1px #c5c6c7'); 
  });
	 
	var $scrollAreaPosition = $('#scrollWrap').css('top'); 
	var $scrollAreaHeight = $('#scrollWrap').height();
	//alert($scrollAreaPosition);
	$('#scrollWrap').css('display','none');
	$('#contentScrollDown').hover(function() {	
		$('#scrollWrap').slideDown("slow");				  
	}, function() {							  
	$('#scrollWrap').css('display','none');
	});
	

	
	
	$('#wasser').hover(
      function () {
		//$('.sample').css('border-bottom', '1px solid #906e3e');
		$('#wrap').css('background-image', 'url(../images/wasserqualitaet1.png)');
		//$(this).css('background-color', ' #696763');
		//$(this).css('cursor', 'pointer');
		
      }, 
      function () {
		//$('#important h3').css('border-bottom', '1px solid #fff');
		//$('#wrap').css('background-image', 'url(../images/image9.jpg)');
		$('#wrap').css('background-image', 'url(../images/image21.jpg)');
		//$(this).css('background-color', ' #498bae');
		//$(this).css('cursor', 'default');	
      }
    );
	
	$('#wasser2').hover(
      function () {
		$('#wrap').css('background-image', 'url(../images/wasserqualitaet2.png)');
      }, 
      function () {
		$('#wrap').css('background-image', 'url(../images/image23.jpg)');
      }
    );
	
	$('#wasser3').hover(
      function () {
		$('#wrap').css('background-image', 'url(../images/wasserqualitaet3.png)');
      }, 
      function () {
		$('#wrap').css('background-image', 'url(../images/image21.jpg)');
      }
    );
	
	$('#wasser4').hover(
      function () {
		$('#wrap').css('background-image', 'url(../images/wasserqualitaet4.png)');
      }, 
      function () {
		$('#wrap').css('background-image', 'url(../images/image21.jpg)');
      }
    );

});

