

$(document).ready(function(){
	// highslide
	$('a.highslide').each(function(){
		this.onclick = function(){
			return hs.expand(this);
		}
	});

	// Navigation

	$(".menu > li > ul").prev('a').click(function(){
		if($(this).parent("li").hasClass("current")) {
			$(this).parent("li").removeClass("current");
			$(this).next("ul").slideUp("fast");
		}
		else {
			$(".menu li.current ul").slideUp("normal");
			$(".menu li").removeClass("current");
			$(this).next().slideDown("fast");
			$(this).parent("li").addClass("current");
		}
		return false;
	});

	// topmenu

	$('.topmenu > li').hover(function(){
		$('.topmenu').find('ul').stop(true, true);
		$(this).children('ul').slideToggle('fast');
	}, function(){
		$('.topmenu').find('ul').stop(true, true);
		$(this).children('ul').slideToggle('fast');
	});


	$('#slideshow').innerfade({
		animationtype: 'fade',
		speed: 750,
		timeout: 5000,
		type: 'random',
		containerheight: '245px'
	});





	$('#intro').innerfade({
		animationtype: 'fade',
		speed: 1750,
		timeout: 7000,
		containerheight: '268px'
	});
    function set_hs(el,wwidth){    	$(el).click(function(){

						return hs.htmlExpand(el,
											{ outlineType: 'rounded-white',
											  wrapperClassName: 'draggable-header',
											  headingText: '',
											  width: wwidth,
											  maincontentId:$(this).attr('rel') } );
						})    }
	$('.highslide_html').each(function(){
					_width = $('#'+$(this).attr('rel')).width();
					//alert(_width);
					set_hs(this,_width);

				}
	);
	//alert(window.location.toString().indexOf('#'));
    if(window.location.toString().indexOf('#') != -1)
		window.location=window.location;

});
