
//jQuery HoverFader
function jQueryHoverOpacity()
{
	jQuery().ready(function(){
		
		jQuery('[rel="jquery-fade"]').fadeTo("slow", 0.8); // This sets the opacity of the thumbs to fade down to 60% when the page loads
		jQuery('[rel="jquery-fade"]').hover(
			function() {
				jQuery(this).fadeTo("fast", 1.0); // This should set the opacity to 100% on hover
				
			},function() {
				jQuery(this).fadeTo("fast", 0.8); // This should set the opacity back to 60% on mouseout
				
			});
	});
}

//Validate Form
//doc: http://www.position-relative.net
function jQuerySubmitForm(id)
{
	
	var formular = document.getElementById(id);
	
	if(jQuery("#"+id).validationEngine({returnIsValid:true}))
	{
		formular.submit();			
	}
};



//jQuery Content Slider
//doc: http://flowplayer.org/tools/scrollable.html
function jQueryContentSlider(id)
{
	jQuery(document).ready(function(){	
		
		//alle info boxen auf 0 setzen
		jQuery(".info-project").css({display: 'none' });
		
		//wähle die erste box und setze auf 1
		jQuery("#info1").css({display: 'block' }); 
		
		jQuery("#"+id).scrollable({
								  
			onBeforeSeek: function() {
				prevID = this.getPageIndex()+1;
			}, 
			
			onSeek: function() {
				nextID = this.getPageIndex()+1;
				jQuery("#info"+prevID).css({display:'none'});
				jQuery("#info"+nextID).css({display:''});
			
			}, 
			
			size: 1,
			loop: true,
			clickable: false,
			circular: true,
			mousewheel: false
		})
		.circular()
		.navigator()
		.autoscroll({
			autoplay: true,
			interval: 9000
		});
		
		
	});
}

function jQuerySlideUp()
{
	jQuery(document).ready(function(){
		
		//jQuery('#navi-profil,#navi-leistungen,#navi-referenzen,#navi-kontakt,#navi-impressum').click(function() {
		jQuery('#navigation > li > a, .slideshow-link').click(function() {
			  
			  id = jQuery(this).attr("rel");
			  jQuery('#stage').animate({
				height: 0
			  }, 1000, function(p) {
					
				jQuery('.slideshow').hide();
				
				jQuery(location).attr('href',id);

				
					
			  });
			  
			});
		
	});	
}

function subnaviHover()
{
	jQuery(document).ready(function(){

		jQuery('.refHover').hover(function(){
			
			strHref = jQuery(this).attr("href");
			strHrefNoExt = strHref.substring(0,strHref.indexOf("."));
			refID = strHref.substring(strHref.indexOf("-")+1,strHref.length-4);
			dir = refID;
			
			refID = "#navi-"+refID;
			this.origImg = jQuery(this).children().attr("src");
			
			jQuery(refID).addClass("bgPositionBottom");
			jQuery(this).children().attr("src","img/referenzen/"+dir+"/"+strHrefNoExt+"-hover.jpg");
			
			
			
		}, function () { 
			
			jQuery(this).children().attr("src",this.origImg);
			jQuery(refID).removeClass("bgPositionBottom");

			
		});
		
	});
}

function refPictureHover()
{
	jQuery(document).ready(function(){
	
		jQuery('#subnavigation > li > a').hover(function(){
			
			strHref = jQuery(this).attr("href");
			strHrefNoExt = strHref.substring(0,strHref.indexOf("."));
			refID = strHref.substring(strHref.indexOf("-")+1,strHref.length-4);
			
			origImg = jQuery('#'+refID).attr("src");
			
			jQuery('#'+refID).attr("src","img/referenzen/"+refID+"/referenzen-"+refID+"-hover.jpg");
			

		}, function () { 
		
 			jQuery('#'+refID).attr("src",origImg);


		});
	});
}



function jQuerySlideDown()
{	
	jQuery(document).ready(function(){
									
		jQuery("#header-information").hide();
		
		jQuery('#information').toggle(function() {
		  jQuery('#header-information').slideDown('slow') },
		  
		  function() { jQuery('#header-information').slideUp('slow')
		});
	});
}

function jQueryAnimateImprint()
{
	jQuery(document).ready(function(){
	
		jQuery('#impressum').toggle(function()
		 {
			 jQuery("#impressum-wrapper").animate({left:'0'},1000);
		 },function() {
			 jQuery("#impressum-wrapper").animate({left:'-420'},1000);
		 });

	});
}
