window.addEvent('domready', function() {
	//load pngfix if browser is older than IE7 and IE
	if (Browser.Engine.name == "trident" && Browser.Engine.version < 5) DD_belatedPNG.fix('.bg');
	//load tierschutz class
	new tierschutz();
});
var tierschutz = new Class({
	initialize: function(options){
		//get sponsor content
		this.getContent(19, 'right');
		//scroll to Top of Window
		$('anchor').addEvents({
			'click': function(e){
				e.stop();
				var scroll = new Fx.Scroll(window);
				scroll.toTop();
			}
		});
		//set mouseover events on nav
		$$('.hNav').addEvents({
			'mouseover': function(e){
				this.addClass('over');
			},
			'mouseleave': function(e){
				this.removeClass('over');
			}
		});
		//set mouseover events on subnav
		$$('.subNavDiv').addEvents({
			'mouseover': function(e){
				this.getChildren()[0].setStyles({
					'display':'block'
				});
			},
			'mouseleave': function(e){
				if (this.id != 'actSub') {
					this.getChildren()[0].setStyles({
						'display': 'none'
					});
				}
			}
		});
	}
	//get content per AJAX from page (param pageID) and set content in target DIV (param contentDiv)
	,getContent: function(pageID,contentDiv){
		new Request({
			url: 'index.php',
			method: 'post',
			data: 'mode=ajax&id=' + pageID + '&reqCol=text,title',
			onComplete: function(response){
				cont = JSON.decode(response);
				txt = cont.text;
				$(contentDiv).innerHTML=txt;
			}.bind(this)
		}).send();
	}
});

