﻿ 
 

  $(document).ready(function(){ 





	
	
	
	
	function superbgimage_GO0() {
	
	
	
	$.fn.superbgimage.options = {
	
			id: 'superbgimage', // id for the containter
		z_index: 0, // z-index for the container
		inlineMode: 0, // 0-resize to browser size, 1-do not resize to browser-size
		showimage: 1, // number of first image to display
		vertical_center: 1, // 0-align top, 1-center vertical
		transition: 1, // 0-none, 1-fade, 2-slide down, 3-slide left, 4-slide top, 5-slide right, 6-blind horizontal, 7-blind vertical, 90-slide right/left, 91-slide top/down
		transitionout: 1, // 0-no transition for previous image, 1-transition for previous image
		randomtransition: 0, // 0-none, 1-use random transition (0-7)
		showtitle: 0, // 0-none, 1-show title
		slideshow: 1,// 0-none, 1-autostart slideshow
		slide_interval: 3000, // interval for the slideshow
		randomimage: 0, // 0-none, 1-random image
		speed: 500, // animation speed
		preload: 1, // 0-none, 1-preload images
		onShow: superbgimage_show2, // function-callback show image
		onClick: superbgimage_click2, // function-callback click image
		onHide: superbgimage_hide, // function-callback hide image
		onMouseenter: null, // function-callback mouseenter
		onMouseleave: null, // function-callback mouseleave
		onMousemove: null // function-callback mousemove
		
	};
	$("#superbgimage").css({"cursor":"pointer"});
	$("#superbgimage").css({"background":"#382920 url('../css/progress_382920.gif') no-repeat center"});
	
	CLICKBILD=0;
	
}


	
function superbgimage_GOsolo() {	
	
	
	$.fn.superbgimage.options = {
	
			id: 'superbgimage', // id for the containter
		z_index: 0, // z-index for the container
		inlineMode: 1, // 0-resize to browser size, 1-do not resize to browser-size
		showimage: 1, // number of first image to display
		vertical_center: 1, // 0-align top, 1-center vertical
		transition: 1, // 0-none, 1-fade, 2-slide down, 3-slide left, 4-slide top, 5-slide right, 6-blind horizontal, 7-blind vertical, 90-slide right/left, 91-slide top/down
		transitionout: 0, // 0-no transition for previous image, 1-transition for previous image
		randomtransition: 0, // 0-none, 1-use random transition (0-7)
		showtitle: 0, // 0-none, 1-show title
		slideshow: 0,// 0-none, 1-autostart slideshow
		slide_interval: 5000, // interval for the slideshow
		randomimage: 0, // 0-none, 1-random image
		speed: 1000, // animation speed
		preload: 1, // 0-none, 1-preload images
		onShow: superbgimage_show2, // function-callback show image
		onClick: null, // function-callback click image
		onHide: superbgimage_hide, // function-callback hide image
		onMouseenter: null, // function-callback mouseenter
		onMouseleave: null, // function-callback mouseleave
		onMousemove: null // function-callback mousemove
		
	};
	$("#superbgimage").css({"cursor":"default"});
	$("#superbgimage").css({"background":"#382920 url('../css/progress_382920.gif') no-repeat center"});
	}
	
	
	
	
	
	
	
	
	







function superbgimage_GOX() {
	
	
	$.fn.superbgimage.options = {
	
			id: 'superbgimage', // id for the containter
		z_index: 0, // z-index for the container
		inlineMode: 1, // 0-resize to browser size, 1-do not resize to browser-size
		showimage: 1, // number of first image to display
		vertical_center: 1, // 0-align top, 1-center vertical
		transition: 3, // 0-none, 1-fade, 2-slide down, 3-slide left, 4-slide top, 5-slide right, 6-blind horizontal, 7-blind vertical, 90-slide right/left, 91-slide top/down
		transitionout: 1, // 0-no transition for previous image, 1-transition for previous image
		randomtransition: 0, // 0-none, 1-use random transition (0-7)
		showtitle: 0, // 0-none, 1-show title
		slideshow: 0,// 0-none, 1-autostart slideshow
		slide_interval: 5000, // interval for the slideshow
		randomimage: 0, // 0-none, 1-random image
		speed: 1000, // animation speed
		preload: 1, // 0-none, 1-preload images
		onShow: superbgimage_show2, // function-callback show image
		onClick: null, // function-callback click image
		onHide: superbgimage_hide, // function-callback hide image
		onMouseenter: null, // function-callback mouseenter
		onMouseleave: null, // function-callback mouseleave
		onMousemove: null // function-callback mousemove
		
	};
	$("#superbgimage").css({"cursor":"default"});
	$("#superbgimage").css({"background":"#382920 url('../css/progress_382920.gif') no-repeat center"});
	
};

	

	
	








// function callback on hiding image
function superbgimage_hide(img) {
	$('.title').empty().hide();
	$("#superbgimage").css({"background":"#382920 url('../css/progress_382920.gif') no-repeat center"});
}

REBSORTENKATEGCLICKED=0;

WEINAUSWAHLKATEGCLICKED=0;
DiaSchieber=0;

	function updateCAPTION(){
	var ANZAHL = $("#thumbsX").find('a.loader').length;

updateNAVI();
	if (DiaSchieber == 1) { $('.title').fadeIn("fast"); }
	if (DiaSchieber == 0) { $('.title').hide("fast"); }
	};
	
	
	
	function updateNAVI(){
	var ANZAHL = $("#thumbsX").find('a.loader').length;

	if (ANZAHL > 2 && SHOWNAVI == 1){
		$('  #showtitle, #playpause, .prev, .next').show();}
		if(REBSORTENKATEGCLICKED==1 && DiaSchieber==0){$(' #playpause, .next, .prev').hide();}
			if(WEINAUSWAHLKATEGCLICKED==1 && DiaSchieber==0){$(' #playpause, .next, .prev').hide();}
			
			
if(REBSORTENKATEGCLICKED==1 && DiaSchieber==1){$(' #playpause').hide();}	
if(WEINAUSWAHLKATEGCLICKED==1 && DiaSchieber==1){$(' #playpause').hide();}
		
	};
	
	
	
	
function updateCURSOR(){
	var ANZAHL = $("#thumbsX").find('a.loader').length;

	if (ANZAHL >= 2 && DiaSchieber == 1){
		$("#superbgimage").css({"cursor":"pointer"});};
	};	
	
	
	
	
	

// function callback on showing image
// get title and display it
function superbgimage_show2(img) {
	
		$('div.title').html($('#thumbsX').find('a.activeslide').attr('title'));	
		$('div.imagecount').html('Bild ' + img + ' / ' + $.superbg_imgIndex);
	updateCAPTION();
	
	$("#superbgimage").css({"background":"#382920"});/*sonst firefox cpu overkill durch gif???*/
};




// function callback on showing image
// get title and display it
function superbgimage_show3(img) {
		$('div.title').html($('.onon').find('a.activeslide').attr('title'));	
		$('div.imagecount').html('Bild ' + img + ' / ' + $.superbg_imgIndex);
	updateCAPTION()
};




/*$("#lokko").toggle(function(){
	$(this).stop().animate({"width": "150px"},600, function(){});
	$("#koppi").css({"border-bottom":"none"});
$("#container1").stop().animate({"left": "-25em"},600, function(){$("#container1").css("overflow", "hidden");});
$("#showquote").animate({"left": "2em", "padding-bottom": "10em"},600);	
$('#superbgimage').animate({ 'bottom': '4em', 'top': '4em',"left":"0.75em"}, 600, function(){$("#SBGIresizer").trigger("click");});
	}, function(){
		$(this).stop().animate({"width": "316px"},600, function(){});
		$('#superbgimage').animate({'bottom': '0.75em', 'top': '0.75em', "left":"25em"}, 600, function(){$("#SBGIresizer").trigger("click");});	
		$("#showquote").animate({"left": "27em", "padding-bottom": "6em"},600);	
$("#container1").stop().animate({"left": "0em"},1000, function(){	
$("#koppi").css({"border-bottom":"1px solid #000"});
	});

$("#container1").css("overflow", "visible");	
		
		});*/				
	
	


$("#lokko").click(function(){
if(DiaSchieber==1){$("#lokko1").trigger("click");}

});
$("#lokko").mouseover(function(){
if(DiaSchieber==1){$(this).css({"cursor":"pointer"})}
if(DiaSchieber==0){$(this).css({"cursor":"default"})}
});






	








// function callback on clicking image, show next slide
function superbgimage_click2(img) {
	
	var ANZAHLXYZ = $("#thumbsX").find('a.loader').length;
	
	if (ANZAHLXYZ > 1 && CLICKBILD==1){
		
	$('#thumbs').nextSlide();}
		if (ANZAHLXYZ > 1 && CLICKBILD==0){
			$('a.stop').trigger("click");
		
	}
	
	else{   }
	
}






// function callback on clicking image, show next slide
function superbgimage_click3(img) {
	
	var ANZAHLXYZ = $("#thumbsX").find('a.loader').length;
		if (ANZAHLXYZ > 2){
	$("#lokko").trigger("click");}

}















	// prev slide
	$('a.prev').click(function() {
		
		if(	WEINAUSWAHLKATEGCLICKED==1){
			
	$.fn.superbgimage.options = {
		transition: 5 // 0-none, 1-fade, 2-slide down, 3-slide left, 4-slide top, 5-slide right, 6-blind horizontal, 7-blind vertical, 90-slide right/left, 91-slide top/down
	};
	
	}
		
		
		return $('#thumbsX').prevSlide();
	});





	// next slide
	$('a.next').click(function() {
		
		if(	WEINAUSWAHLKATEGCLICKED==1){
			
	$.fn.superbgimage.options = {
		transition: 3 // 0-none, 1-fade, 2-slide down, 3-slide left, 4-slide top, 5-slide right, 6-blind horizontal, 7-blind vertical, 90-slide right/left, 91-slide top/down
	};
	
	}
		
		return $('#thumbsX').nextSlide();
	});
	
	
	

	// start slideshow
	$('a.start').click(function() {
		$('a.next').trigger("click");
		CLICKBILD=0;
	$(this).hide();
	$('a.stop').show();	
		return $('#thumbsX').startSlideShow();
	});

	// stop slideshow
	$('a.stop').click(function() {
		CLICKBILD=1;
		$(this).hide();
		$('a.start').show();
		my_slideshowActive = false;
		return $('#thumbsX').stopSlideShow();
	});


	
	
	$('a.startstop').toggle(function() {
		return $('#thumbsX').startSlideShow();
	});
	
	
	
	
	
	
	
			$(".SubMenu1").click(function(){
			var n = $(this).index();
			
		$(".Subcontain2, .Subcontain2b").hide();
		
		$("#VdpEinblender").hide();
		SHOWNAVI = 1;
		SHOWVDPEINBLENDER = 0;
		/*if ($(this).is("#VDP, #WEINGUT, #DIEWEINE, #KONTAKT")){SHOWVDPEINBLENDER = 1;};*/   /*vdp logo einblenden, auskommentiert*/
		
		
		
		
		$(".SubMenu1Clicked").removeClass("SubMenu1Clicked").addClass("SubMenu1");	
	
				$(this).removeClass("SubMenu1").addClass("SubMenu1Clicked");
		
		if($(this).parent().hasClass("MainMenuClicked")){
			
			$(".Subcontain, .Subcontain2").fadeOut(600);
		$(this).parent().find(".Subcontain:eq("+n+")").fadeIn(500).find(".Subcontain2:eq(0), .Subcontain2b:eq(0)").show();
	
			
		}
		
		if($(this).parent().hasClass("MainMenu")){
			$(".Subcontain, .Subcontain2").fadeOut(100);
			$(".MainMenuClicked").stop().removeClass("MainMenuClicked").addClass("MainMenu");
			
				$(this).parent().stop().removeClass("MainMenu").addClass("MainMenuClicked").animate({"top":"8em"}, 600, function(){
		$(this).find(".Subcontain:eq("+n+"), .Subcontain2:eq(0), .Subcontain2b:eq(0)").fadeIn(500);  
		});	
			}
			
			
		$('.MainMenu:eq(0)').animate({"top":"0"}, 800);
		$('.MainMenu:eq(1)').animate({"top":"2em"}, 800);	
		$('.MainMenu:eq(2)').animate({"top":"4em"}, 800);	
		
		
	updateVdpEinblender();
		
		
			
			});
			
	
	
	
	function updateToggler(){
		
		var e=$("#thumbsX").find('a.loader').length;
		
		if(e>1){
			$("#fullscreentoggler").show();}
			
			else{
			$("#fullscreentoggler").hide();}
			
		}
	
	
	
	
	
	
	
	
	

			
	$('.SubMenu1').not('.SubMenu1Clicked').click(function(){
	$(".rebsortenkategClicked").removeClass("rebsortenkategClicked").addClass("rebsortenkateg");
	$(".weinauswahlkategClicked").removeClass("weinauswahlkategClicked").addClass("weinauswahlkateg");
	WEINAUSWAHLKATEGCLICKED=0; REBSORTENKATEGCLICKED=0;
	$('div.title, div.imagecount, #showtitle,  .prev, .next').hide();
	var DIALINK = $(this).find(".DiaTrigger").attr('href');
	var DIA2 = $(DIALINK).html();
	$("#thumbsX").empty().append(DIA2, function(){});	
	var r = $("#thumbsX").find('a.loader').length;
	if(r < 2){superbgimage_GOsolo();}
	if(r > 1){superbgimage_GO0();}
	startUPsupX();
	$("#thumbsX").superbgimage({ reload: true }).show().removeClass('hidden').addClass("onon");
	$("#superbgimage").show();
	updateCURSOR();
	updateToggler();
	});
	
	




$("#lokko1").toggle(function(){
	$("#VdpEinblender").hide();
	
		if(WEINAUSWAHLKATEGCLICKED==1){
			SHOWNAVI=1;
			updateNAVI();
			}
			if(REBSORTENKATEGCLICKED==1){
			SHOWNAVI=1;
			updateNAVI();
			}
	
	$(this).parent().stop().animate({"left": "12em"},600, function(){});
	$(this).attr("src", "pic/navi/toggle-2.png");
	$("#lokko").stop().animate({"width": "160px"},600, function(){});
	$("#koppi").css({"border-bottom":"none"});
$("#container1").stop().animate({"left": "-25em"},600, function(){$("#container1").css("overflow", "hidden");});
$("#showquote").animate({"left": "2em", "padding-bottom": "10em"},600);	
$('#superbgimage').animate({ 'bottom': '4em', 'top': '4em',"left":"0.75em"}, 600, function(){$("#SBGIresizer").trigger("click");

DiaSchieber = 1;
updateCAPTION();
updateCURSOR();

});
	}, function(){
		DiaSchieber = 0;
updateCAPTION();

		$(this).parent().stop().animate({"left": "25em"},600, function(){updateVdpEinblender()});
		$(this).attr("src", "pic/navi/toggle-1.png");
		$("#lokko").stop().animate({"width": "340px"},600, function(){});
		$('#superbgimage').animate({'bottom': '0.75em', 'top': '0.75em', "left":"25em"}, 600, function(){$("#SBGIresizer").trigger("click");});	
		$("#showquote").animate({"left": "27em", "padding-bottom": "6em"},600);	
$("#container1").stop().animate({"left": "0em"},1000, function(){	
$("#koppi").css({"border-bottom":"1px solid #000"});
	});

$("#container1").css("overflow", "visible");	
	
	
	if(WEINAUSWAHLKATEGCLICKED==1){
	$("#DIEWEINE").trigger("click");
	}	
	if(REBSORTENKATEGCLICKED==1){
	$("#Rebsorten").trigger("click");
	}	
	
	
		});




function updateVdpEinblender(){
		if (SHOWVDPEINBLENDER==1 && DiaSchieber==0){$("#VdpEinblender").stop().show();}
		else{$("#VdpEinblender").stop().hide()}
	};











	
	
			// Standard beim Slideshow beginn
function startUPsupX() {
		$('#thumbsX').stopSlideShow();
		my_slideshowActive = false;
		$('#showtitle').hide();
		}
	






// function callback on clicking image, show next slide
function superbgimage_weinclick(img) {
	

		if (DiaSchieber==1){
	$("a.next").trigger("click");}

}



$(".weinauswahlkateg").click(function(){
	
	
	if ($(this).hasClass("weinauswahlkategClicked")){}
	else{
	
	$(".weinauswahlkategClicked").removeClass("weinauswahlkategClicked").addClass("weinauswahlkateg");
	$(this).removeClass("weinauswahlkateg").addClass("weinauswahlkategClicked");
	
	
	SHOWNAVI=1;
	SHOWVDPEINBLENDER = 0;
	updateVdpEinblender();
	
	var u = $(this).index();
	var v = u+1;
	
	$('div.title, div.imagecount, #showtitle,  .prev, .next').hide();
	
	var DIALINK = $(document).find(".DiaTriggerWeinauswahl").attr('href');
	var DIA2 = $(DIALINK).html();
	
	$.fn.superbgimage.options = {
	
			id: 'superbgimage', // id for the containter
		z_index: 0, // z-index for the container
		inlineMode: 1, // 0-resize to browser size, 1-do not resize to browser-size
		showimage: v, // number of first image to display
		vertical_center: 1, // 0-align top, 1-center vertical
		transition: 3, // 0-none, 1-fade, 2-slide down, 3-slide left, 4-slide top, 5-slide right, 6-blind horizontal, 7-blind vertical, 90-slide right/left, 91-slide top/down
		transitionout: 1, // 0-no transition for previous image, 1-transition for previous image
		randomtransition: 0, // 0-none, 1-use random transition (0-7)
		showtitle: 0, // 0-none, 1-show title
		slideshow: 0,// 0-none, 1-autostart slideshow
		slide_interval: 2000, // interval for the slideshow
		randomimage: 0, // 0-none, 1-random image
		speed: 1000, // animation speed
		preload: 0, // 0-none, 1-preload images
		onShow: superbgimage_show2, // function-callback show image
		onClick: superbgimage_weinclick, // function-callback click image
		onHide: superbgimage_hide, // function-callback hide image
		onMouseenter: null, // function-callback mouseenter
		onMouseleave: null, // function-callback mouseleave
		onMousemove: null // function-callback mousemove
	};
	$("#superbgimage").css({"cursor":"default"});
		
	
	if(WEINAUSWAHLKATEGCLICKED==0){
	$("#thumbsX").empty().append(DIA2).superbgimage({ reload: true}).show().removeClass('hidden').addClass("onon");	
	}
	
	if(WEINAUSWAHLKATEGCLICKED==1){
	}
	
	$("#superbgimage").show();
	$("#thumbsX").stop().find("a.loader:eq("+u+")").trigger("click");
	
	WEINAUSWAHLKATEGCLICKED=1;
	updateToggler();
	
	
	
$(".Subcontain2").fadeOut(500);
	$(this).parent().parent().find(".Subcontain2:eq("+v+")").fadeIn(500);  
	
	

	
	}
	});






	


	
	
	$(".rebsortenkateg").click(function(){
		
	if ($(this).hasClass("rebsortenkategClicked")){}

	else{		
		
		
	$(".rebsortenkategClicked").removeClass("rebsortenkategClicked").addClass("rebsortenkateg");
	$(this).removeClass("rebsortenkateg").addClass("rebsortenkategClicked");
	
	SHOWVDPEINBLENDER = 0;
	updateVdpEinblender();
	SHOWNAVI=1;

	var u = $(this).index();
	var v = u+1;
	
	$('div.title, div.imagecount, #showtitle,  .prev, .next').hide();
	
	var DIALINK = $(document).find(".DiaTriggerRebsortenauswahl").attr('href');
	var DIA2 = $(DIALINK).html();
	
	$.fn.superbgimage.options = {
	
			id: 'superbgimage', // id for the containter
		z_index: 0, // z-index for the container
		inlineMode: 1, // 0-resize to browser size, 1-do not resize to browser-size
		showimage: v, // number of first image to display
		vertical_center: 1, // 0-align top, 1-center vertical
		transition: 1, // 0-none, 1-fade, 2-slide down, 3-slide left, 4-slide top, 5-slide right, 6-blind horizontal, 7-blind vertical, 90-slide right/left, 91-slide top/down
		transitionout: 1, // 0-no transition for previous image, 1-transition for previous image
		randomtransition: 0, // 0-none, 1-use random transition (0-7)
		showtitle: 0, // 0-none, 1-show title
		slideshow: 0,// 0-none, 1-autostart slideshow
		slide_interval: 2000, // interval for the slideshow
		randomimage: 0, // 0-none, 1-random image
		speed: 300, // animation speed
		preload: 0, // 0-none, 1-preload images
		onShow: superbgimage_show2, // function-callback show image
		onClick: superbgimage_weinclick, // function-callback click image
		onHide: superbgimage_hide, // function-callback hide image
		onMouseenter: null, // function-callback mouseenter
		onMouseleave: null, // function-callback mouseleave
		onMousemove: null // function-callback mousemove
	};
	$("#superbgimage").css({"cursor":"default"});
		
	
	if(REBSORTENKATEGCLICKED==0){
	$("#thumbsX").empty().append(DIA2).superbgimage({ reload: true}).show().removeClass('hidden').addClass("onon");	
	}
	
	if(REBSORTENKATEGCLICKED==1){
	}
	
	$("#superbgimage").show();
	$("#thumbsX").stop().find("a.loader:eq("+u+")").trigger("click");
	
	REBSORTENKATEGCLICKED=1;
	updateToggler();
	
	$(".Subcontain2b").fadeOut(500);
	$(this).parent().parent().find(".Subcontain2b:eq("+v+")").fadeIn(500);
	
	}
	});
	
	
	
	
	
	$("#lokko1").hover(function(){
	if(DiaSchieber==0){$(this).attr("src", "pic/navi/toggle-1_over.png");}	
	if(DiaSchieber==1){$(this).attr("src", "pic/navi/toggle-2_over.png");}	
		},function(){
	if(DiaSchieber==0){$(this).attr("src", "pic/navi/toggle-1.png");}	
	if(DiaSchieber==1){$(this).attr("src", "pic/navi/toggle-2.png");}	
		});
		
		$("#lokko1").mousemove(function(){
	if(DiaSchieber==0){$(this).attr("src", "pic/navi/toggle-1_over.png");}	
	if(DiaSchieber==1){$(this).attr("src", "pic/navi/toggle-2_over.png");}	
		});
		
		
	
	
		$("#play").hover(function(){
	$(this).attr("src", "pic/navi/play_over.png")
		},function(){
	$(this).attr("src", "pic/navi/play.png")
		});

		$("#pause").hover(function(){
	$(this).attr("src", "pic/navi/pause_over.png")
		},function(){
	$(this).attr("src", "pic/navi/pause.png")
		});	
	
	$("#back").hover(function(){
	$(this).attr("src", "pic/navi/back_over.png")
		},function(){
	$(this).attr("src", "pic/navi/back.png")
		});	
		
	$("#back").click(function(){
	$(this).attr("src", "pic/navi/back.png")
		});	
	$("#back").mousemove(function(){
	$(this).attr("src", "pic/navi/back_over.png")
		});			
		
			
	
	$("#forward").hover(function(){
	$(this).attr("src", "pic/navi/forward_over.png")
		},function(){
	$(this).attr("src", "pic/navi/forward.png")
		});	
	
	$("#forward").click(function(){
	$(this).attr("src", "pic/navi/forward.png")
		});	
	$("#forward").mousemove(function(){
	$(this).attr("src", "pic/navi/forward_over.png")
		});	
	
	
	
	
	
	
	
	
});
















