/* Gleich hohe DIVs auf Startseite */

function SameHeight(selektor){
  var element = $(selektor);
  var height = 0;
  for(i=0;i<element.length;i++){
  	var ThisHeight = $(element[i]).height();
  	if(ThisHeight>height){
  		height = ThisHeight;
  	} else {
  		height = height;
  	}
  }
  element.css("height",height);
}

//Elemente mittels des CSS-Selektos ansprechen
jQuery(document).ready(function() {	SameHeight('.newsBlock .inhalt' );});



/* startseite img gallery
http://www.queness.com/post/152/simple-jquery-image-slide-show-with-semi-transparent-caption
*/
$(document).ready(function() {slideShow();});

function slideShow() {
    $('#gallery a').css({opacity: 0.0});
    $('#gallery a:first').css({opacity: 1.0});
   // $('#gallery .caption').css({opacity: 0.7});
    $('#gallery .caption').css({width: $('#gallery a').find('img').css('width')});
    $('#gallery .content').html($('#gallery a:first').find('img').attr('rel'))
   // .animate({opacity: 0.7}, 400);
    setInterval('gallery()',10000);

}

function gallery() {
    var current = ($('#gallery a.show')?  $('#gallery a.show') : $('#gallery a:first'));
    var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery a:first') :current.next()) : $('#gallery a:first'));   
    var caption = next.find('img').attr('rel'); 
    next.css({opacity: 0.0})
    .addClass('show')
    .animate({opacity: 1.0}, 1000);
    current.animate({opacity: 0.0}, 1000)
    .removeClass('show');
    //$('#gallery .caption').animate({opacity: 0.0}, { queue:false, duration:0 }).animate({height: '1px'}, { queue:true, duration:300 }); 
   	$('#gallery .caption').animate({height: '100px'},1000 );
   // $('#gallery .caption').animate({opacity: 0.7},100 ).animate({height: '100px'},500 );
    $('#gallery .content').html(caption);
}






/* ############################## GALERY 2 BY sg@gutknecht-informatik.com ############################## START */
/* jquery lightbox1 gen */
jQuery(document).ready(function(){
	jQuery('.lightbox .csc-textpic-single-image a').lightBox();
	//jQuery('a[@rel*=lightbox]').lightBox(); 
});


/* jquery cycle plugin 
option page: http://jquery.malsup.com/cycle/options.html
*/

jQuery(document).ready(function(){
	jQuery('#gi_slideshow').cycle({
		fit: 1,
		width:280,
		backwards: true,
		random: 1,
		randomizeEffects: 1
	});
});

/* jQuery lightbox clone prettyPhoto, http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/ */

jQuery(document).ready(function() {
    jQuery("a[rel^='prettyPhoto']").prettyPhoto({

    		/* OPTIONAL: */
    		animation_speed: 'fast', /* fast/slow/normal */
			slideshow: 5000, /* false OR interval time in ms */
			autoplay_slideshow: false, /* true/false */
			opacity: 0.80, /* Value between 0 and 1 */
			show_title: true, /* true/false */
			allow_resize: true, /* Resize the photos bigger than viewport. true/false */
			default_width: 500,
			default_height: 344,			
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'pp_default', /* pp_default /light_rounded / dark_rounded / light_square / dark_square / facebook */
			horizontal_padding: 20, /* The padding on each side of the picture */
			hideflash: true, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
			wmode: 'opaque', /* Set the flash wmode attribute */
			autoplay: true, /* Automatically start videos: True/False */
			modal: false, /* If set to true, only the close button will close the window */
			deeplinking: true, /* Allow prettyPhoto to update the url to enable deeplinking. */
			overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
			keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
			changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
			callback: function(){}, /* Called when prettyPhoto is closed */
			ie6_fallback: true,
			markup: '<div class="pp_pic_holder"> \
						<div class="ppt">&nbsp;</div> \
						<div class="pp_top"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
						<div class="pp_content_container"> \
							<div class="pp_left"> \
							<div class="pp_right"> \
								<div class="pp_content"> \
									<div class="pp_loaderIcon"></div> \
									<div class="pp_fade"> \
										<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
										<div class="pp_hoverContainer"> \
											<a class="pp_next" href="#">next</a> \
											<a class="pp_previous" href="#">previous</a> \
										</div> \
										<div id="pp_full_res"></div> \
										<div class="pp_details"> \
											<div class="pp_nav"> \
												<a href="#" class="pp_arrow_previous">Previous</a> \
												<p class="currentTextHolder">0/0</p> \
												<a href="#" class="pp_arrow_next">Next</a> \
											</div> \
											<p class="pp_description"></p> \
											{pp_social} \
											<a class="pp_close" href="#">Close</a> \
										</div> \
									</div> \
								</div> \
							</div> \
							</div> \
						</div> \
						<div class="pp_bottom"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
					</div> \
					<div class="pp_overlay"></div>',
			gallery_markup: '<div class="pp_gallery"> \
								<a href="#" class="pp_arrow_previous">Previous</a> \
								<div> \
									<ul> \
										{gallery} \
									</ul> \
								</div> \
								<a href="#" class="pp_arrow_next">Next</a> \
							</div>',
			image_markup: '<img id="fullResImage" src="{path}" />',
			flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
			quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
			iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
			inline_markup: '<div class="pp_inline">{content}</div>',
			custom_markup: '',
			/*social_tools: '<div class="pp_social"><div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href='+location.href+'&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div></div>' /* html or false to disable */
			social_tools: ''
		});
	});
	
	
/* ############################## GALERY 2 BY sg@gutknecht-informatik.com ############################## STOP */


/* ############################## Fontresizer gsg ############################## START */

jQuery(document).ready(function(){
  var originalFontSize = jQuery('p.bodytext').css('font-size');
  var originalFontSize1 = jQuery('p.MsoNormal').css('font-size');
    jQuery(".resetFont").click(function(){
    jQuery('p.bodytext').css('font-size', originalFontSize);
    jQuery('p.MsoNormal').css('font-size', originalFontSize1);
  });
  jQuery(".increaseFont").click(function(){
    var currentFontSize = jQuery('p.bodytext').css('font-size');
    var currentFontSize1 = jQuery('p.MsoNormal').css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var currentFontSizeNum1 = parseFloat(currentFontSize1, 10);
    var newFontSize = currentFontSizeNum*1.2;
    var newFontSize1 = currentFontSizeNum1*1.2;
    jQuery('p.bodytext').css('font-size', newFontSize);
    jQuery('p.MsoNormal').css('font-size', newFontSize1);
    return false;
  });
  jQuery(".decreaseFont").click(function(){
    var currentFontSize = jQuery('p.bodytext').css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*0.8;
    var currentFontSize1 = jQuery('p.MsoNormal').css('font-size');
    var currentFontSizeNum1 = parseFloat(currentFontSize1, 10);
    var newFontSize = currentFontSizeNum*0.8;
    var newFontSize1 = currentFontSizeNum1*0.8;
    jQuery('p.bodytext').css('font-size', newFontSize);
    jQuery('p.MsoNormal').css('font-size', newFontSize1);
	return false;
  });
});
/* ############################## Fontresizer ############################## STOP */

