var teaser={
	start:function(){
		if($('contextHelp')){
			teaser.run();
		}
	},
	
	run:function(){
		tol = 20;
	 	el = $('contextHelp');
		fx = el.effects({duration: 750, transition: Fx.Transitions.Back.easeInOut, wait: false});
		el.setStyle('top','-1000px');
		el.setStyle('display','block');
		el.setStyles({
			'top': -1000,
			'left': -1000
		});
		elw = el.getStyle('width').replace(/px/).toFloat();
		elh = el.getStyle('height').replace(/px/).toFloat() / 3;
		x = 0;
		y = 0;
		text1 = "<span>Kategorie w&auml;hlen!</span>";
		text2 = "<span>bis zu 70% sparen!</span>";
		text3 = "<span class=\"sm\">10,- Gutschein sichern!</span>";
		text4 = "<span class=\"sm1\">NEUHEITEN!</span>";
		
		// bringe erstmal in Position, aber noch ausser Sichtweite
		x = $("box_categories").getLeft() - elw - tol;
		x = x.toInt();
		y = 0 - (el.getStyle('width').replace(/px/).toFloat() * 2);
		y = y.toInt();
		
		fx.start({
			'left': x, 
			'top': y
		}).chain(function(){
			// springe zu "Damen"
			y = $("box_categories").getTop() - elh;
			y = y.toInt();
			fx.start.delay(1000, this, {
				'top': [y],
				'left': [x]
			});
		}).chain(function(){
			// springe zu "Sale"
			//y = $("sale").getTop() - elh;
			// cause of IE6
			y += 118;
			y = y.toInt();
			fx.start.delay(4000, this, {
				'top': [y],
				'left': [x]
			});
			el.innerHTML = text1;
		}).chain(function(){
			// springe zu "Gutschein sichern"
			y = $("ligutscheinbrsichern").getTop() - elh;
			y = y.toInt();
			fx.start.delay(4000, this, {
				'top': [y],
				'left': [x]
			});
			el.innerHTML = text2;
		}).chain(function(){
			// springe zu "NEUHEITEN"
			y += 150;
			y = y.toInt();
			fx.start.delay(4000, this, {
				'top': [y],
				'left': [x]
			});
			el.innerHTML = text3;
		}).chain(function(){
			// verschwinden lassen
			y = -1000;
			y = y.toInt();
			fx.start.delay(4000, this, {
				'top': [y],
				'left': [x]
			});
			el.innerHTML = text4;
		});
		
		setTimeout("teaser.run()",30000);

	}
};
window.addEvent('domready',teaser.start);

