
/* <![CDATA[ */
$(document).ready(function(){
/* CONFIG */
/* set start (sY) and finish (fY) heights for the list items */
 
sY = 24; /* height of li.sub */
fY = 100; /* height of maximum sub lines * sub line height */
/* end CONFIG */

/* check on which page we are and if we should open a sub menu */
sPath = window.location.pathname;
sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
find = "a[href*=" + sPage + "]"
id = $(find).parents('li:eq(1)').attr('id');
if (id > 0) opensub(id);
  
/* open first list item */
animate (fY)

 
$("#slide .sub").click(function() {
	if (this.className.indexOf('clicked') != -1 ) {
		animate(sY)
		$(this)			.removeClass('clicked')
						.css("background", "transparent url(./images/out.gif) no-repeat 5px 8px")
						.css("color", "#000");
		}
		else {
		animate(sY)
		$('.clicked')	.removeClass('clicked')
						.css("background", "transparent url(./images/out.gif) no-repeat 5px 8px")
						.css("color", "#000");
		$(this)			.addClass('clicked');
		animate(fY)
	}
});

/* open sub menu with id */
function opensub(id) {
    element = "#slide .sub#" + id
		$("element  .clicked")	.removeClass('clicked')
						.css("background", "transparent url(./images/out.gif) no-repeat 5px 8px")
					.css("color", "#000");
		$(element)			.addClass('clicked');
}
 
function animate(pY) {
$('.clicked').animate({"height": pY + "px"}, 500);
}
 
$("#slide .sub")		.hover(function(){
$(this)					.css("background", "transparent url(./images/down.gif) no-repeat 5px 8px")
						.css("color", "#c00");
},function(){
if (this.className.indexOf('clicked') == -1) {
$(this)					.css("background", "transparent url(./images/out.gif) no-repeat 5px 8px")
						.css("color", "#000");
}
});
 
});
/* ]]> */

