
var slideshow = null;     
var _newsletter = null;     
var _youtube = null;

document.observe('dom:loaded', function() {  

	// Youtube
	_youtube = new YoutubeOverlay();

	if($('flashslideshow')) {
		slideshow = new flashSlideshow('flashslideshow');  
	}
	
	// inline labels
	if($$('div.tx-hgproductionjobs-pi1 form').length > 0) {
		$$('div.tx-hgproductionjobs-pi1 form p label').each(function(a) {
			if(a.next().tagName != 'select' && a.className != 'visible') { 
				
				if(a.next().id == 'resume') {  
					if(a.next().innerHTML == '') {
						a.next().innerHTML = a.innerHTML;  
					}
				} else {     
					if(a.next().value == '') {
						a.next().value = a.innerHTML;  
					}                                            
				}  
				   
				a.next().onfocus = function() {
					if(this.id == 'resume') {         
						if(this.innerHTML == a.innerHTML) {
							this.innerHTML = ''; 
						}
					} else {                       
						if(this.value == a.innerHTML) {
							this.value = ''; 
						}                    
					}
					
				};
				
				a.next().onblur = function() {           
					if(this.id == 'resume') {   
						if(this.getValue() == '') {
							this.innerHTML = a.innerHTML;  
						}                       
					} else {     
						if(this.value == '') {
							this.value = a.innerHTML;  
						}                                            
					}  
				};
				
			}   
		});   
	}

	// Newsletter
	_newsletter = new NewsletterOverlay();  
	
	if($$('a.newsletter').length > 0) {  
		$$('a.newsletter').each(function(a) {    
			a.observe('click', function(e) {               
				_newsletter.showForm();

				Event.stop(e);
			}.bind(this));
		});
	}

	if($$('div.two_cols form').length > 0) {
		$$('div.two_cols form p label').each(function(a) {
			if(a.next().tagName != 'select' && a.className != 'visible') {
				a.next().value = a.innerHTML;
				a.next().onfocus = function() {
					if(this.value == a.innerHTML) {
						this.value = '';
					}
				};
				a.next().onblur = function() {
					if(this.value == '') {
						this.value = a.innerHTML;
					}
				};
			}   
		});   
	}
	
	if($('box-text-impressum')) {  
		$('box-text-impressum').hide();   
		box_text_toggler = $('box-text-impressum').up().previous().select('a')[0];
		box_text_toggler.onclick = function() {
			$('box-text-impressum').toggle();
			return false;
		}; 
	}

});
