$(document).ready(function(){
 
	$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
	
	$("ul.topnav li span").hover(function() { //When trigger is clicked...
		
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
 
		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
		});
 
		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
	
  $("#newsticker ul").liScroll({travelocity: 0.05});	


			var flashvars = {};
			flashvars.settingsXML = "assets/lib/3d-carousel-menu/settings.xml";
			var params = {};
			params.scale = "noscale";
			params.salign = "tl";
			params.wmode = "transparent";
			var attributes = {};
			swfobject.embedSWF("assets/lib/3d-carousel-menu/carousel.swf", "CarouselDiv", "800", "400", "9.0.0", false, flashvars, params, attributes);


        $("ul.sf-menu").superfish({ 
        }); 

       $('#gallery .gallery_item a').lightBox({
      	overlayBgColor: '#000',
      	overlayOpacity: 0.9,
      	imageLoading: 'http://perras.ticktoo.com/assets/lib/lightbox/lightbox-ico-loading.gif',
      	imageBtnClose: 'http://perras.ticktoo.com/assets/lib/lightbox/lightbox-btn-close.gif',
      	imageBtnPrev: 'http://perras.ticktoo.com/assets/lib/lightbox/lightbox-btn-prev.gif',
      	imageBtnNext: 'http://perras.ticktoo.com/assets/lib/lightbox/lightbox-btn-next.gif',
      	containerResizeSpeed: 350,
      	txtImage: 'Bild',
      	txtOf: 'von'
         });

$('.car_list .item').hover(function(){
					$(".desc", this).stop().animate({top:'0px'},{queue:false,duration:160});
				}, function() {
					$(".desc", this).stop().animate({top:'140px'},{queue:false,duration:160});
				});

	$('.toolbar p.print_link a').click(function() {
		window.print();
		return false;
	});



hs.graphicsDir = '/assets/lib/highslide/graphics/';
    hs.showCredits = false;
    hs.outlineType = 'custom';
    hs.dimmingOpacity = 0.75;
    hs.registerOverlay({
    	html: '<div class="closebutton" onclick="return hs.close(this)" title="Schließen"></div>',
    	position: 'top right',
    	useOnHtml: true,
    	fade: 2 // fading the semi-transparent overlay looks bad in IE
    });
    // German language strings
    hs.lang = {
    	cssDirection: 'ltr',
    	loadingText: 'Lade...',
    	loadingTitle: 'Klick zum Abbrechen',
    	focusTitle: 'Klick um nach vorn zu bringen',
    	fullExpandTitle: 'Zur Originalgröße erweitern',
    	creditsText: 'Powered by <i>Highslide JS</i>',
    	creditsTitle: 'Gehe zur Highslide JS Homepage',
    	previousText: 'Voriges',
    	nextText: 'Nächstes',
    	moveText: 'Verschieben',
    	closeText: 'Schließen',
    	closeTitle: 'Schließen (Esc)',
    	resizeTitle: 'Größe wiederherstellen',
    	playText: 'Abspielen',
    	playTitle: 'Slideshow abspielen (Leertaste)',
    	pauseText: 'Pause',
    	pauseTitle: 'Pausiere Slideshow (Leertaste)',
    	previousTitle: 'Voriges (Pfeiltaste links)',
    	nextTitle: 'Nächstes (Pfeiltaste rechts)',
    	moveTitle: 'Verschieben',
    	fullExpandText: 'Vollbild',
    	number: 'Bild %1 von %2',
    	restoreTitle: 'Klick um das Bild zu schließen, klick und ziehe um zu verschieben. Benutze Pfeiltasten für vor und zurück.'
    };

 
});
