/* 	
	CSS Document for: 	wdi.de
	Author:				www.markusgiesen.de
	CreateDate:			2008-03-24
	ChangeDate:			2008-03-24
*/


var toggleGivenTogglers = new Class ({
	initialize: function(options)
	{
		if($E('.Rcontentmiddle'))
		{
			togglers = $ES('.Rcontentmiddle');
			togglers.each(function(container)
			{
				var contents = container.getChildren();
				var contentToSlide = new Element('div', {
					'styles': {
						'display': 'inline',
						'float': 'left'
					},
					'class': 'toggleContent'
				});
				
				contents.each(function(el)
				{
					if(el.getTag() != "h1"){
						contentToSlide.adopt(el);
					}else{
						el.setStyle('cursor', 'pointer');
					}
				});
				container.adopt(contentToSlide);
				var wrap = container;
				var mySlide = new Fx.Slide($E('.toggleContent',wrap));
				$E('h1',container).addEvent('click', function(e){
					e = new Event(e);
					mySlide.toggle();
					if(container.hasClass('closed') || $E('h1',container).hasClass('off')){
						container.removeClass('closed');
						$E('h1',container).removeClass('off');
						$E('h1',container).addClass('on');
					}else{
						container.removeClass('opened');
						$E('h1',container).removeClass('on');
						$E('h1',container).addClass('off');
					}
					e.stop();
				});
				if(container.hasClass('opened')){
					container.removeClass('opened');
					$E('h1',container).addClass('on');
				}else{
					$E('h1',container).addClass('off');
					mySlide.toggle();
				}
			});
		}
	}
 });

var flashorize = new Class ({
	initialize: function(options)
	{
		if($defined(soLeft)){
			soLeft.write("topimg");
		}
		if($defined(soRight)){
			soRight.write("topfximg");
		}
	}
 });

window.onDomReady(function(){
	// activate togglers to the right
	var togglers = new toggleGivenTogglers();
	
	// assign reflection to images with border-wrap from css styled content
	$each($ES('.csc-textpic-border img'), function(img){
 		img.addReflection({height:0.33,opacity:0.5});
 	});

});


