xpngFix({root:'left'});

function buildTabs(index, DOMelement){
	jQuery('.tab'+index).click(function(){
		jQuery('.tab').each(function(){
			jQuery(".img_left", this).attr("src", jQuery(".img_left", this).attr("src").replace("-active", ""));
			jQuery(".img_right", this).attr("src", jQuery(".img_right", this).attr("src").replace("-active", ""));
			jQuery(this).css("background", "#c6c6c6");
			jQuery('.redbg', this).removeClass("redbg");
		});
		
		jQuery(this).css("background", "#ba2539");
		jQuery('.img_left', this).attr("src","/ccds_tpl_img/tab-left-active.jpg");
		jQuery('.img_right', this).attr("src","/ccds_tpl_img/tab-right-active.jpg");
		jQuery('#div_header_person').cycle(index);
	});
}

function buildDots(index, DOMelement){
	return "<a href='javascript:;'>&nbsp;</a>";
}

(function($) 
{
	$.noConflict();
	
	$(document).ready(function(){
	
		$('.content').jScrollPane({showArrows:true, scrollbarWidth: 7, arrowSize: 8});
		
		var video = flashembed(
			'video',
			{
				src: '/flash/player.swf',
				id: "embed",
				width: 350, 
				height: 265, 
				allowfullscreen: false,
				wmode: 'transparent',
				version:[8,0]
			 }
		 );
			
		var elms = $('.videos_header a');
		elms.click(function(){
			elms.removeClass('active');
			$(this).addClass('active');
				video.SetVariable("flv", this.href);
			return false;
		});
		
		$('.gallery a').tinyLightbox();

		
		if(jQuery(".div_mitarbeiter_container_cycle").length>1){
			$('#div_header_person_cycle').cycle({
				fx:'fade'
				,timeout:4000
				,speed:1000
				,pager:'#tabnavi_cycle'
				,allowPagerClickBubble:true
				,pagerAnchorBuilder:buildDots
			});
		} else {
			$('.div_mitarbeiter_container_cycle').css("display", "block");
		}
	});
	
	
	$(window).load(function(){
		
		setTimeout("jQuery('.videos_header a:first').trigger('click')", 1000);

	});



})(jQuery);




