﻿$(document).ready(function () {
	    $('#dropdown1').hover(
		    function () {			
			    $('#dropdown1 li a.parent').addClass('hover');
			    $('#dropdown1 ul.children').show();
				
		    },
		    function () {
			    $('#dropdown1 li a.parent').removeClass('hover');			
			    $('#dropdown1 ul.children').hide();
		    }
	    );
	    $('#dropdown2').hover(
		    function () {			
			    $('#dropdown2 li a.parent').addClass('hover');
			    $('#dropdown2 ul.children').show();
				
		    },
		    function () {
			    $('#dropdown2 li a.parent').removeClass('hover');			
			    $('#dropdown2 ul.children').hide();
		    }
	    );
	    $('#dropdown3').hover(
		    function () {			
			    $('#dropdown3 li a.parent').addClass('hover');
			    $('#dropdown3 ul.children').show();
		    },
		    function () {
			    $('#dropdown3 li a.parent').removeClass('hover');			
			    $('#dropdown3 ul.children').hide();
		    }
	    );
	    highlightMenu();
	
	});
	function toggleinfoText(myID)
	{
	    var nr=myID.substr(myID.length-1);
	    //alert(nr);
	    var $box = $('#ctl00_infotext'+nr);
	    $box.slideToggle('slow',function(){});
	}
	
    function highlightMenu()
    {
        var myPageName=getFilename();
        var myMenuLink;
        if (myPageName.toUpperCase().indexOf("HOME")==0)
        {
            myMenuLink=document.getElementById("aHome");
        }
        if (myPageName.toUpperCase().indexOf("KONTAKT") == 0) {
            myMenuLink = document.getElementById("aKontakt");
        }
        if (myPageName.toUpperCase().indexOf("IMPRESSUM") == 0) {
            myMenuLink = document.getElementById("aImpressum");
        }
        if (myPageName.toUpperCase().indexOf("DATENSCHUTZ") == 0) {
            myMenuLink = document.getElementById("aDatenschutz");
        }
        if (myMenuLink!= null)
            myMenuLink.style.color="#000000";
    
    }




	function getFilename()
	{
	    tmp=location.href;
        return(tmp.substr(tmp.lastIndexOf("/")+1,tmp.length-tmp.lastIndexOf("/")+1));
	}
