jQuery(document).ready(function(){
	
	if((navigator.userAgent.match(/iPhone/i)) || 
                (navigator.userAgent.match(/Android/i)) ||
                (navigator.userAgent.match(/iPod/i))) 
        { 
		window.location = "http://mmuller.com/m/";
	}

jQuery('#frontrow').jparallax({},{xtravel: '15px', yparallax: false},{xtravel: '15px', yparallax: false},{xtravel: '54px', yparallax: false});

$('blockquote').css({opacity: 0});
$('.cat').css({opacity: 0});

$("#border-bottom").toggle(function(){
		$(this).animate({height:'150px'},{queue:false,duration:2000});
		$('blockquote').animate({opacity: 1},{queue:false,duration:3000});
		$('.cat').animate({opacity: 1},{queue:false,duration:3000});
		}, function(){
		$('#border-bottom').animate({height:'10px'},{queue:false,duration:3000});
		$('.cat').animate({opacity: 0},{queue:false,duration:3000});
		$('blockquote').animate({opacity: 0},{queue:false,duration:3000});
});

$('#display')
 .cycle({ 
		fx: 'fade', 
		cleartypeNoBg: true,
        easing: 'easeInOutSine',
        timeout:  5000, 
		speed: 2000
    }); 
 
$("img").lazyload({ 
    placeholder : "../i/loading.gif",
    effect : "fadeIn" 
});

 
	$('input[type="text"]').focus(function() {
        if (this.value == this.defaultValue){
        	this.value = '';
    	}
        if(this.value != this.defaultValue){
	    	this.select();
        }
    });
    $('input[type="text"]').blur(function() {
        if ($.trim(this.value == '')){
        	this.value = (this.defaultValue ? this.defaultValue : '');
    	}
    });


});


var scrollSpeed = 25;       // Speed in milliseconds
    var step = 1;               // How many pixels to move per step
    var current = 0;            // The current pixel row
    var imageHeight = 134;     // Background image height
    var headerHeight = 134;     // How tall the header is.
   
    //The pixel row where to start a new loop
    var restartPosition = -(imageHeight - headerHeight);
   
    function scrollBg(){
       
        //Go to next pixel row.
        current -= step;
       
        //If at the end of the image, then go to the top.
        if (current == restartPosition){
            current = 0;
        }
       
        //Set the CSS of the header.
        $('#bubble').css("background-position","0 "+current+"px");
       
       
    }
   
    //Calls the scrolling function repeatedly
    var init = setInterval("scrollBg()", scrollSpeed);
	// alo
	var scrollSpeedz = 25;       // Speed in milliseconds
    var stepz = 1;               // How many pixels to move per step
    var currentz = 0;            // The current pixel row
    var imageHeightz = 134;     // Background image height
    var headerHeightz = 134;     // How tall the header is.
   
    //The pixel row where to start a new loop
    var restartPositionz = -(imageHeightz - headerHeightz);
   
    function scrollBgz(){
       
        //Go to next pixel row.
        currentz -= stepz;
       
        //If at the end of the image, then go to the top.
        if (currentz == restartPosition){
            currentz = 0;
        }
       
        //Set the CSS of the header.
        $('#bubble2').css("background-position","0 "+currentz+"px");
       
       
    }
   
    //Calls the scrolling function repeatedly
    var initz = setInterval("scrollBgz()", scrollSpeed);
	
	