
$(document).ready(function(){ 
	
	var Browser = {
	  Version: function() {
	    var version = 999; // we assume a sane browser
	    if (navigator.appVersion.indexOf("MSIE") != -1)
	      // bah, IE again, lets downgrade version number
	      version = parseFloat(navigator.appVersion.split("MSIE")[1]);
	    return version;
	  }
	}
				
	$('.accordion .accordionHeader').click(function() {
		accordionContent = $(this).parent().find('div.accordionContents');
		accordionOpener = $(this).parent().find('div.accordionHeader h4 a');
		if($(accordionContent).is(':hidden')){
			$(accordionContent).slideDown('fast',function(){
			accordionOpener.text('hide');
			accordionOpener.addClass('open');
			});
		}else{
			$(accordionContent).slideUp('fast', function(){
			accordionOpener.text('show');
			accordionOpener.removeClass('open');
			});
		}
	});
	
	$('.teaserContainer .teaser .teaserContent h2').mouseover(function(){
		teaserDefaultPosition	= '106px';
		teaserContent 			= $(this).parent();
		headlineContainer 		= $(this).parent().parent().find('div.headlineContainer');
		if(teaserContent.css('top') == teaserDefaultPosition){
			teaserContent.animate(
				{ 
	        		top: "3px"
	        	}, 
				350 
			);
			if(Browser.Version() > 7){
				headlineContainer.animate(
					{ 
		        		margin: "-140px 0px 0px 0px"
		        	}, 
					350 
				);
			}else{
				headlineContainer.animate(
					{ 
		        		margin: "-139px 0px 0px 0px"
		        	}, 
					350 
				);
			}
			
		}
		
	});
	$('.teaserContainer .teaser .teaserContent').mouseleave(function(){
		teaserDefaultPosition	= '106px';
		teaserContent 			= $(this);
		headlineContainer 		= $(this).parent().find('div.headlineContainer');
		//if(teaserContent.css('top') == '3px'){
			teaserContent.animate(
				{ 
	        		top: teaserDefaultPosition
	        	}, 
				350 
			);
			headlineContainer.animate(
				{ 
	        		margin: "-36px 0px 0px 0px"
	        	}, 
				350 
			);
		//}
		
	});
	
	
	
	Cufon.replace('h1') ('h2') ('h3');
	
	Shadowbox.init({
 		skipSetup: true,
 		players: ["html", "img", "swf", "flv", "iframe"]
	});

	Shadowbox.setup("a.thickbox", {
   		height:     500,
   		width:      400,
   		overlayColor:	"#011E26"
   	});
   	
   	Shadowbox.setup("a.thickbox_wide", {
   		height:     500,
   		width:      730,
   		overlayColor:	"#011E26"
   	});
	
	
	
	if (Browser.Version() < 7) {
		DD_belatedPNG.fix('.colRight .containerBox');
		DD_belatedPNG.fix('.page .teaser .teaserContainer');
		
		
	}
}); 