jQuery(function() {
	// Ressource Bilder
  jQuery('#picture').cycle({
	fx: 'fade',
	speed: 2000,
	timeout: 2000
  });
});

jQuery(document).ready(function() {

  // Image
  jQuery("a.lightbox").fancybox({
    'zoomSpeedIn': 300,
    'zoomSpeedOut': 300,
	'overlayColor': '#444',
    'overlayShow': true,
	'hideOnOverlayClick': false,
	'titlePosition': 'over'
  });

  // iFrame Content
  jQuery("a.popupAntrag").fancybox({
    'padding': 0,
    'zoomSpeedIn': 300,
    'zoomSpeedOut': 300,
	'overlayColor': '#444',
    'overlayShow': true,
    'width': 700,
    'height': 470,
    'titleShow': false,
    'autoScale' : true,
    'scrolling': 'no',
	'hideOnOverlayClick': false,
    'type': 'iframe'
  });

  // iFrame Content
  jQuery("a.popupAdresse").fancybox({
    'padding': 0,
    'zoomSpeedIn': 300,
    'zoomSpeedOut': 300,
	'overlayColor': '#444',
    'overlayShow': true,
    'width': 700,
    'height': 570,
    'titleShow': false,
    'autoScale' : true,
    'scrolling': 'no',
	'hideOnOverlayClick': false,
    'type': 'iframe'
  });
  
    // iFrame Content
  jQuery("a.popupGutschein").fancybox({
    'padding': 0,
    'zoomSpeedIn': 300,
    'zoomSpeedOut': 300,
	'overlayColor': '#444',
    'overlayShow': true,
    'width': 720,
    'height': 410,
    'titleShow': false,
    'autoScale' : true,
    'scrolling': 'no',
	'hideOnOverlayClick': false,
    'type': 'iframe'
  });
  
  // Filialen / Check if map exists
  if(jQuery('#map')) {
    // Loop through each AREA in the imagemap
    jQuery('#map area').each(function() {
      // Assigning an action to the mouseover event
      jQuery(this).mouseover(function(e) {
        var areaId = jQuery(this).attr('id').replace('area_', '');
        jQuery('#'+areaId).show();
      });

      // Assigning an action to the mouseout event
      jQuery(this).mouseout(function(e) {
        var areaId = jQuery(this).attr('id').replace('area_', '');
        jQuery('#'+areaId).hide();
      });
    });
  }
  
  jQuery("#band").imageScroller({
    loading:'Bilder werden geladen...'
  });
}); 
