
Event.observe(window, 'load', function() {

	//($$('.img_line_img')).invoke('shake');

	($$('img.pedfotolijn')).invoke('observe', 'mouseenter', function(e) { 
			($('main_foto')).setAttribute('src', (e.element()).readAttribute('src'));
		});  
	
	if ( (window.location == "http://www.pedarchitecten.be/") || (window.location == "http://www.pedarchitects.com/") ) {
			
		($$('a')).invoke('observe', 'click', function(e) { 
		
			if (!((e.element()).readAttribute('href')))
				setTimeout( 'window.location=\'/projecten\'', 1220);
			else
				setTimeout( 'window.location=\'' + ((e.element()).readAttribute('href')) + '\'', 1220); 
			e.stop();
			
			if ( ((e.element()).readAttribute('href')) == '/contact') {
				new Effect.Move('home_img', {x:200, y:0, duration: 1.2});			
			}
			else
			if ( ((e.element()).readAttribute('href')) == '/nieuws') {
				new Effect.Grow('home_img', {duration: 1.2});
			}
			else 
			if (((e.element()).readAttribute('href')) == '/home' || ((e.element()).readAttribute('href')) == '/' ) {
				new Effect.Puff('home_img', {duration: 1.2});
			}
			else{
				new Effect.Morph('home_img', {style: 'width: 120px; height: 120px;', duration: 1.2}); 
				new Effect.Move('home_img', {x:-150, y:-160, duration: 1.2}); 
			}
			//return false;
		});	
    }
   
    
    if ( (window.location == "http://www.pedarchitecten.be/contact") || (window.location == "http://www.pedarchitects.com/contact") ) {
			
		($$('a')).invoke('observe', 'click', function(e) { 
		
			if (!((e.element()).readAttribute('href')))
				setTimeout( 'window.location=\'/projecten\'', 1220);
			else
				setTimeout( 'window.location=\'' + ((e.element()).readAttribute('href')) + '\'', 1220); 
			e.stop();
            
            if ( ((e.element()).readAttribute('href')) == '/contact') {
                new Effect.Puff('home_img', {duration: 1.2});
            }
			else
			if ( ((e.element()).readAttribute('href')) == '/nieuws') {
                //new Effect.Grow('home_img', {duration: 1.2});
                new Effect.Move('home_img', {x:-200, y:0, duration: 0.6});
			}
			else 
			if (((e.element()).readAttribute('href')) == '/home' || ((e.element()).readAttribute('href')) == '/' ) {
                new Effect.Move('home_img', {x:-200, y:0, duration: 0.6});
			}
			else{
				new Effect.Morph('home_img', {style: 'width: 120px; height: 120px;', duration: 1.2});
				new Effect.Move('home_img', {x:-350, y:-160, duration: 1.2}); 
			}
			//return false;
		});	
    }  
    
});
