// JavaScript Document
var SS = jQuery.noConflict();

SS(document).ready(function() {
SS("#alles img").hide();						  
SS("#alles").hide();
SS("#content2").hide();
SS("#contentrechts").hide();
SS.fn.supersized.options = {  
startwidth: 1024,  
startheight: 683,
vertical_center:0
};
SS('#supersize').supersized(); 
// Bilder tauschen
SS(".bild").live("click",function (){
 	var zwischen = "bilder/"+SS(this).attr("id");
	var erklarung = SS(this).attr("alt");
   
	SS("#bg2").fadeOut(1000,function() {
	if(erklarung!="")
	SS("#erklarung").html(erklarung);
	else
	SS("#erklarung").html("&nbsp;");
	SS('#bg2')
    .attr('src', zwischen)
    .load(function(){
       // SS('.profile').append( SS(this) );
    SS("#bg2").fadeIn(1000);
	});});
	return false;
  })


// BOXEN STARTSEITE   
SS("#featured").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, false);  
SS("#featured").hover(  
function() {  
SS("#featured").tabs("rotate",0,false); 
},  
function() {  
SS("#featured").tabs("rotate",5000,false);  
}  
);

SS("#featured2").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, false);  
SS("#featured2").hover(  
function() {  
SS("#featured2").tabs("rotate",0,false);  
},  
function() {  
SS("#featured2").tabs("rotate",5000,false);  
}  
);    

SS("#featured3").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, false);  
SS("#featured3").hover(  
function() {  
SS("#featured3").tabs("rotate",0,false);  
},  
function() {  
SS("#featured3").tabs("rotate",5000,false);  
}  
); 

SS("#featured4").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, false);  
SS("#featured4").hover(  
function() {  
SS("#featured4").tabs("rotate",0,false);  
},  
function() {  
SS("#featured4").tabs("rotate",5000,false);  
}  
);  

SS("#featured5").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, false);  
SS("#featured5").hover(  
function() {  
SS("#featured5").tabs("rotate",0,false);  
},  
function() {  
SS("#featured5").tabs("rotate",5000,false);  
}  
);   

//MENÜ
ddsmoothmenu.init({
 mainmenuid: "smoothmenu1", //menu DIV id
 orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
 classname: 'ddsmoothmenu', //class added to menu's outer DIV
 //customtheme: ["#1c5a80", "#18374a"],
 contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})



SS('a.email').nospam({
      replaceText: true,    
      filterLevel: 'normal' 
   });


SS("#ausblenden").click(function (){
    SS("#contentneu").slideToggle("slow");
		if(SS(".zu").attr('src')=='bilder/schliessen.gif')
	SS(".zu").attr('src','bilder/oeffnen.gif');
	else
	SS(".zu").attr('src','bilder/schliessen.gif');
	return false;
  })
  
    var i=1;
  var maximal=SS("#next").attr("alt");
  var textzwischen=SS("#seite"+i).html();
  SS("#seite").html(textzwischen);
  
  SS("#next").click(function (){
	SS("#seite").slideToggle(500, function (){
	i++;
	var textzwischen=SS("#seite"+i).html();
	SS("#seite").html(textzwischen);
	SS("#zuruck").show();
	if(i==maximal)
	SS("#next").hide();
SS("#seite").slideToggle(500, function(){SS("#seite").animate({opacity:"1"},1,function(){SS("#seite").css('filter',"");});});
	}); })
  
   SS("#zuruck").click(function (){
	SS("#seite").slideToggle(500, function (){
	i--;
	var textzwischen=SS("#seite"+i).html();
	SS("#seite").html(textzwischen);	

	if(i==1)
	SS("#zuruck").hide();
	if(i<maximal)
	SS("#next").show();
	
SS("#seite").slideToggle(500, function(){SS("#seite").animate({opacity:"1"},1,function(){SS("#seite").css('filter',"");});});
	}); })
	
	 SS("#angeboterechts a").click(function (){
i = SS(this).attr("alt");
 var textzwischen=SS("#seite"+i).html();
  SS("#seite").slideToggle(500, function (){
	SS("#seite").html(textzwischen);
	SS("#zuruck").show();
	
	if(i==maximal)
	SS("#next").hide();
	if(i==1)
	SS("#zuruck").hide();
	if(i<maximal)
	SS("#next").show();
	
SS("#seite").slideToggle(500, function(){SS("#seite").animate({opacity:"1"},1,function(){SS("#seite").css('filter',"");});});
	
	
	
	}); });

});
SS(window).load( function() {
//	if(SS(window).load || oneTime(2000){
SS("#alles").fadeIn("slow");
SS("#alles img").show();
SS("#content2").oneTime(2000, function() { SS(this).slideDown("slow");});
SS("#contentrechts2").oneTime(3000, function() { SS(this).slideDown(500);});
SS("#contentrechts").oneTime(3000, function() { SS(this).slideDown(500);});

});
