	var div     = document.createElement('div');
	div.id      = 'banner';
	var a       = document.createElement('a');
	a.href      = 'http://www.novyrybnik.com';
	var img     = document.createElement('img');
	img.src     = '/images/kachna.png';
	img.title   = 'www.novyrybnik.com';
	var close   = document.createElement('div');
	close.id    = 'banner_close';
	close.innerHTML = 'x zavřít';
	var text	= document.createElement('div');
	text.id		= 'banner_text_in';
	
	img   = a.appendChild(img);
  	a   = div.appendChild(a);
	close = div.appendChild(close);

function Schovat(){
    //window.clearTimeout(automaticky);
    
//	var queue = Effect.Queues.get('kachna');
//	queue.each(function(effect) { effect.cancel(); });
  
    jQuery(function() {
	   var $ = jQuery;
  	 var myWidth = $('body').width();
      $('#banner').animate( {left:(myWidth)+"px", top: "-400px"}, 1000);
    });

  //  new Effect.Move ('banner',{ x: screen.availWidth, y: -400, mode: 'absolute'});
    new Effect.SwitchOff ('banner');
}

function Continue(){
    
  if(img.complete){
    jQuery(function() {
	   var $ = jQuery;
  	 var myWidth = $('body').width();
      $('#banner').animate( {left:(myWidth / 5)+"px", top: "100px"}, 1500);
      $('#banner').animate( {left:(myWidth / 3)+"px", top: "50px"}, 1500); 
      $('#banner').animate( {left:(myWidth / 2)+"px", top: "70px"}, 1500); 
      $('#banner').animate( {left:(myWidth -492)+"px", top: "40px"}, 1500);  	
      /*new Effect.Move ('banner',{ x: (((myWidth) / 5)), y: 100, mode: 'absolute', queue: { position: 'end', scope: 'kachna' }});
      new Effect.Move ('banner',{ x: (((myWidth) / 3)), y: 50, mode: 'absolute', queue: { position: 'end', scope: 'kachna' }});
      new Effect.Move ('banner',{ x: (((myWidth) / 2)), y: 70, mode: 'absolute', queue: { position: 'end', scope: 'kachna' }});
      new Effect.Move ('banner',{ x: (myWidth - 492), y: 40, mode: 'absolute', queue: { position: 'end', scope: 'kachna' }});*/
	
    });
	
    var automaticky = window.setTimeout("Schovat()", 10000);
  }else{  
    window.setTimeout("Continue()", 1000);
  }
}

function Banner(){

	Event.observe(close, 'click', function() {
		Schovat();
	}, false);

	
	text.innerHTML = document.getElementById('banner_text').value;
	text = div.appendChild(text);
	div = document.body.appendChild(div);
  
    Continue();
}
Event.observe(window, 'load', function() {
  window.setTimeout("Banner()", 1000);
}, false)