jQuery(document).ready(function(){


	// Scroll to Top     
    jQuery('a[href*=#top]').bind("click", function(event) {
        event.preventDefault();
        var ziel = jQuery(this).attr("href");

        jQuery('html,body').animate({
                scrollTop: jQuery(ziel).offset().top
        }, 500);
        return false;
    });
    
    /* ================================================================================     
	   Scroll Top -80px
	================================================================================ */
  
    
   jQuery('a[href^=#]').bind("click", function(event) {
        event.preventDefault();
        var ziel = jQuery(this).attr("href");

        jQuery('html,body').animate({
                scrollTop: jQuery(ziel).offset().top -100
        }, 1000);
        return false;
    });

	
	jQuery(".imageBox").hover(
	  function () {
		jQuery(this).stop(true,false).animate({opacity:0.0}, 250);
	  }, 
	  function () {
		jQuery(this).animate({opacity:1.0}, 1000);
	  }
	);
	

	jQuery('.hide').click(function(){
			jQuery('.gallery-item').fadeOut(750);
	}); 
	
	jQuery('.show').click(function(){
			jQuery('.gallery-item').fadeIn(750);
	}); 

	//if (jQuery.browser.msie && parseInt(jQuery.browser.version) == 7) {
	
	
	if (jQuery.browser.msie !== true) {
		/*jQuery('#head').animate({
			opacity: 0.95
		}, 0);*/
	}
	
	
	var count = 1;
	while (count < 3){
		jQuery('.thumbGallery dl:last dt a').attr("rel","")
		jQuery('.thumbGallery dl:last').remove();
		count++;
	}

	/* ================================================================================
	   App Switcher	   
	================================================================================ */
	
	jQuery('#iPadAppsSlider, #macAppsSlider').fadeOut(5);
	
	jQuery('a.showIphone').click(function(){
			jQuery('#iPadAppsSlider, #macAppsSlider').fadeOut(750);		
			jQuery('#iPhoneAppsSlider').fadeIn(750);
			jQuery('#control2, #control3').animate({opacity:0.0, right: "150"}, 500);
			jQuery('#controls').show().animate({opacity:1.0, right: "31"}, 250);			
			jQuery('a.showIphone').addClass('showIphoneAktiv');
			jQuery('a.showIpad').removeClass('showIpadAktiv');
			jQuery('a.showMac').removeClass('showMacAktiv');
			jQuery('.newestApps').text('The newest iPhone Apps');
	}); 
		
	jQuery('a.showIpad').click(function(){
			jQuery('#iPhoneAppsSlider, #macAppsSlider').fadeOut(750);				
			jQuery('#iPadAppsSlider').fadeIn(750);
			jQuery('#controls, #control3').animate({opacity:0.0, right: "150"}, 500);	
			jQuery('#control2').show().animate({opacity:1.0, right: "31"}, 250);			
			jQuery('a.showIpad').addClass('showIpadAktiv');
			jQuery('a.showIphone').removeClass('showIphoneAktiv');
			jQuery('a.showMac').removeClass('showMacAktiv');
			jQuery('.newestApps').text('The newest iPad Apps');
	}); 
	
	jQuery('a.showMac').click(function(){
			jQuery('#iPhoneAppsSlider, #iPadAppsSlider').fadeOut(750);		
			jQuery('#macAppsSlider').fadeIn(750);
			jQuery('#control2, #controls').animate({opacity:0.0, right: "150"}, 500);
			jQuery('#control3').show().animate({opacity:1.0, right: "31"}, 250);			
			jQuery('a.showMac').addClass('showMacAktiv');
			jQuery('a.showIpad').removeClass('showIpadAktiv');
			jQuery('a.showIphone').removeClass('showIphoneAktiv');
			jQuery('.newestApps').text('The newest Mac Apps');
	}); 
	
	jQuery('h1').animate({
		top: 0,
		opacity: "show"
	},350);
	    
	

});

