jQuery.noConflict();


var cimg = 0;
var sshowC = 0;
var sleep = 10000;

function setHsDefaults(n2, n3) {
	if(n2 == '712') {
		hs.addSlideshow({
			//slideshowGroup: 'group1',
			interval: 5000,
			repeat: true,
			useControls: true,
			fixedControls: 'fit',
			overlayOptions: {
				opacity: .75,
				position: 'bottom center',
				hideOnMouseOut: true
			}
		});
	} else {
		hs.graphicsDir = '../highslide/graphics/';
		hs.align = 'center';
		hs.showCredits = false;
		hs.transitions = ['expand', 'crossfade'];
		hs.fadeInOut = true;
		hs.dimmingOpacity = 0.75;
		hs.lang = {
		   cssDirection:     'ltr',
		   loadingText :     'Lade...',
		   loadingTitle :    'Klick zum Abbrechen',
		   focusTitle :      'Klick um nach vorn zu bringen',
		   fullExpandTitle : unescape('Zur Originalgr%F6%DFe erweitern'),
		   fullExpandText :  'Vollbild',
		   creditsText :     'Powered by <i>Highslide JS</i>',
		   creditsTitle :    'Gehe zur Highslide JS Homepage',
		   previousText :    'Voriges',
		   previousTitle :   'Voriges (Pfeiltaste links)',
		   nextText :		 unescape('N%E4chstes'),
		   nextTitle :       unescape('N%E4chstes (Pfeiltaste rechts)'),
		   moveTitle :       'Verschieben',
		   moveText :        'Verschieben',
		   closeText :       unescape('Schlie%DFen'),
		   closeTitle :      unescape('Schlie%DFen (Esc)'),
		   resizeTitle :     unescape('Gr%F6%DFe wiederherstellen'),
		   playText :        'Abspielen',
		   playTitle :       'Slideshow abspielen (Leertaste)',
		   pauseText :       'Pause',
		   pauseTitle :      'Pausiere Slideshow (Leertaste)',
		   number :          'Bild %1/%2',
		   restoreTitle :    unescape('Klick um das Bild zu schlie%DFen, klick und ziehe um zu verschieben. Benutze Pfeiltasten für vor und zur%FCck.')
		};
	}
	
	if((n3 == '811') || (n3 == '775') || (n2 == '777') || (n3 == '813')) {
		hs.graphicsDir = '../highslide/graphics/';
		hs.align = 'center';
		hs.transitions = ['expand', 'crossfade'];
		hs.fadeInOut = true;

		hs.showCredits = false;
	 
		// Add the controlbar
		hs.addSlideshow({
			//slideshowGroup: 'group1',
			interval: 5000,
			repeat: false,
			useControls: true,
			fixedControls: 'fit',
			overlayOptions: {
				opacity: 1,
				position: 'bottom center',
				hideOnMouseOut: true
			}
		});
	} else {
		hs.printImage = function (el)
		{
		   var exp = hs.expanders[hs.getWrapperKey(el)];
		   link = "about:blank";
		   var pw = window.open(link, "_new");
		   pw.document.open();
		   pw.document.write(exp.getPrintPage());
		   pw.document.close();
		   return false;
		};

		hs.graphicsDir = 'highslide/graphics/';
		hs.showCredits = false;
		hs.wrapperClassName = 'wide-border';
	}
}

function imageAni() {
  if(cimg < (sshowC-1)) {
    jQuery('#ImageViewer img').eq(cimg).fadeOut(1000);
    jQuery('#ImageViewer img').eq((cimg+1)).fadeIn(1000,function() {setTimeout('imageAni()',sleep);} );
    cimg++;
  } else if(cimg == (sshowC-1)) {
    jQuery('#ImageViewer img').eq(cimg).fadeOut(1000);
    cimg = 0;
    jQuery('#ImageViewer img').eq(0).fadeIn(1000,function() {setTimeout('imageAni()',sleep);} );
    
  }
  
}

jQuery().ready(function(){

		jQuery("#MainNavigation").hoverIntent(function() {

			jQuery('#MainNavigation').animate({
				opacity: '0.97',
				width: '207px'
			}, '400');

			jQuery('#MainNavigation .container').animate({
				opacity: 'show',
				marginLeft: '-=50'
			}, 'slow');

		}, function() {

			jQuery('#MainNavigation').animate({
				opacity: '1',
				width: '60px'
			}, 'slow');

			jQuery('#MainNavigation .container').animate({
				opacity: 'hide',
				marginLeft: '+=50'
			}, '400');
		});

		jQuery("#div1").shadowOn( { imageset: '3' } ); 
	
		jQuery.loadImages(['/css/img/main_home.jpg', '/css/img/main_news.jpg', '/css/img/main_impressum.jpg', '/css/img/main_kontakt.jpg', '/css/img/sponsoren_logos_bg_mr.png', '/css/img/sponsoren_logos_bg_lj.png', '/css/img/sponsoren_logos_bg_kp.png', '/css/img/sponsoren_logos_bg_sz.png', '/css/img/sponsoren_logos_bg_gm.png'])


		jQuery("a#599").hover(
		  function () {
			jQuery('body').css("background-image", "url(/css/img/main_bg.jpg)");
		  }, 
		  function () {
			jQuery('body').css("background-image", "url(/css/img/main_home.jpg)");
		  }
		);

		jQuery("a#778").hover(
		  function () {
			jQuery('body').css("background-image", "url(/css/img/main_bg.jpg)");
		  }, 
		  function () {
			jQuery('body').css("background-image", "url(/css/img/main_news.jpg)");
		  }
		);

		jQuery("a#600").hover(
		  function () {
			jQuery('body').css("background-image", "url(/css/img/main_bg.jpg)");
		  }, 
		  function () {
			jQuery('body').css("background-image", "url(/css/img/main_kontakt.jpg)");
		  }
		);

		jQuery("a#601").hover(
		  function () {
			jQuery('body').css("background-image", "url(/css/img/main_bg.jpg)");
		  }, 
		  function () {
			jQuery('body').css("background-image", "url(/css/img/main_impressum.jpg)");
		  }
		);



		jQuery("#mr").hover(
		  function () {
			jQuery('#Sponsors').css("background-image", "url(/css/img/sponsoren_logos_bg_mr.png)");
		  }, 
		  function () {
			jQuery('#Sponsors').css("background-image", "url(/css/img/sponsoren_logos_bg.png)");
		  }
		);

		jQuery("#lj").hover(
		  function () {
			jQuery('#Sponsors').css("background-image", "url(/css/img/sponsoren_logos_bg_lj.png)");
		  }, 
		  function () {
			jQuery('#Sponsors').css("background-image", "url(/css/img/sponsoren_logos_bg.png)");
		  }
		);

		jQuery("#kp").hover(
		  function () {
			jQuery('#Sponsors').css("background-image", "url(/css/img/sponsoren_logos_bg_kp.png)");
		  }, 
		  function () {
			jQuery('#Sponsors').css("background-image", "url(/css/img/sponsoren_logos_bg.png)");
		  }
		);

		jQuery("#sz").hover(
		  function () {
			jQuery('#Sponsors').css("background-image", "url(/css/img/sponsoren_logos_bg_sz.png)");
		  }, 
		  function () {
			jQuery('#Sponsors').css("background-image", "url(/css/img/sponsoren_logos_bg.png)");
		  }
		);

		jQuery("#gm").hover(
		  function () {
			jQuery('#Sponsors').css("background-image", "url(/css/img/sponsoren_logos_bg_gm.png)");
		  }, 
		  function () {
			jQuery('#Sponsors').css("background-image", "url(/css/img/sponsoren_logos_bg.png)");
		  }
		);





  sshowC = jQuery('#ImageViewer img').size();
  if(sshowC > 1 ) {
    var dH = parseInt(jQuery('#ImageViewer img:first').css('height'),10);
    var dW = parseInt(jQuery('#ImageViewer img:first').css('width'),10);
    jQuery('#ImageViewer').css({'position':'relative','height':dH+'px','width':dW+'px'});
    jQuery('#ImageViewer img').css({'position':'absolute','left':'0px','top':'0px'});
    jQuery('#ImageViewer img').not(':first').hide();
    setTimeout('imageAni()',sleep);
  }
  Cufon.replace('h1');
  Cufon.replace('h2');
  Cufon.now();
});