/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| Scripting für www.bms-group.de
| fasc | 2009-02-13
| 
| Inhaltsverzeichnis:
| - ==carousel            Initialisierung und Konfiguration des Carousels
| - ==layout              Ein kleiner Layout-Fix, der die Seite aufspannt
| - ==gallery             Galerie-Script für die Vergröerung
| - ==print               Druckfunktion
| - ==popup               Popup-Fenster
| - ==approach            Anfahrt
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */


getHeight = function() {
  height = jQuery(document).height() - jQuery('#page').height();
  height = height < 80 ? 80 : height;

  return height;
}

jQuery(window).load(function() {
  jQuery('#utilities').css('height', getHeight()+'px');
});


jQuery.noConflict();
var wh = 0;
jQuery(document).ready(function() {
  
  
  
  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ==gallery */
  jQuery('.image-big img:gt(0)').css('display', 'none');
  jQuery('#gallery li a:eq(0)').addClass('active');
  jQuery('#gallery li a').click(function() {
    
    jQuery('#gallery li a').removeClass('active');
    jQuery(this).addClass('active');
        
    var bigImage = jQuery('#gallery-projector .image-big img');
    bigImage.attr('src', this.href);  
    bigImage.attr('alt', this.title);
    return false;
  });
  
  
  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ==layout */
  getHeight = function() {
    height = jQuery(document).height() - jQuery('#page').height();
    height = height < 80 ? 80 : height;

    return height;
  }

  jQuery(window).load(function() {
    jQuery('#utilities').css('height', getHeight()+'px');
  });

  jQuery(window).resize(function() {
    jQuery('#utilities').css('height', getHeight()+'px');
  });

  
  
  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ==print */
  jQuery('.print a').click(function() {
    window.print();
    return false;
  });
  
  
  
  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ==popup */
  jQuery('a.internal-link-new-window').click(function() {
    window.open(this.href, '', 'width=475,height=600,locationbar=no,menubar=no,statusbar=no,toolbar=no,scrollbars=yes');
    return false;
  });
  
  jQuery('a.external-link-new-window').click(function() {
    window.open(this.href);
    return false;
  });
  
  jQuery('div.partners li a').click(function() {
    window.open(this.href);
    return false;
  });
  
  
  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ==contact */
    
  jQuery('input.powermail_uid66').blur(function() {
    if(jQuery('input.powermail_uid79').attr('value') == '')
      jQuery('input.powermail_uid79').attr('value', jQuery('input.powermail_uid66').attr('value'));
  });
  
  jQuery('#powermaildiv_uid35').click(function() {
    jQuery('#files_list').html('');
    jQuery('.powermail_mandatory_js').remove();
    jQuery('.validation-failed').removeClass('validation-failed');
  });
  
  
  
  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ==approach */
  jQuery('#navigation-approach li').click(function() {
    window.location.href = jQuery('base').attr('href')+jQuery(this).find('a').attr('href');
  });
  
  
  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ==approach */
  if(window.flashembed && window.flashembed.isSupported([9, 0])) {
    jQuery('.no-flash').removeClass('no-flash');
  }
});