// JavaScript Document

function cmsSlideshow(){
	var images = '';
	jQuery('.ewcms_news_feed').children('div').each(function(){
		$this = jQuery(this);
		$this.children('a').remove();
		images = images + $this.html();
	});
	jQuery('.ewcms_news_feed').html(images).attr('id','slideshow').removeAttr('class');
};

jQuery(document).ready(function() {
										  
	jQuery('.slideshow img').each( function( index ) {
		jQuery(this).attr("width","980");
		jQuery(this).attr("height","300");
	});
										  
	jQuery("a[rel=lightbox]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Bild ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
		}
	});
	jQuery('.slideshow').cycle({
		fx: 'fade', speed: 3200 // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	cmsSlideshow();
	
	if (jQuery("#Form-Typ").length) {
		jQuery("#Form-Typ").change(function() {
			jQuery("form:visible").slideUp("fast");
			jQuery("form#"+jQuery(this).val()).slideDown("fast");
		});
	}
	
	
	
	
});
