$(document).ready(function() {
    
     
    
     var weite          = $(window).width();
    var hohe          = $(window).height();

$("#kontaktformular").validate();

	       function adjustStyle(width) {
        width = parseInt(width);
        if (width > 1560) {
            $("#size-stylesheet").attr("href", "1024.css");
        } else {
           $("#size-stylesheet").attr("href", "style.css");
        }
    }
    $(function() {
        adjustStyle($(this).width());
        $(window).resize(function() {
            adjustStyle($(this).width());
        });
    });

        $("div#controller").jFlow({
            slides: "#slides",
            width: "297px",
            height: "200px"
        });


   $('.cycle').cycle({
        fx: 'fade',
        timeout:4000
    });

	/* fancy fuer die galerie */
	$("a.group").fancybox({
	    'padding':0,
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600,
		'speedOut'		:	200,
        'titleShow'        :false,
		'overlayShow'	:	true,
		'cyclic'        :   true
	});

    /* fancy fuer die iframes */
    $(".iframe").fancybox({
        'padding'       :   45,
        'margin'        :   0,
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'titleShow'        :false,
        'speedIn'       :   600,
        'speedOut'      :   200,
        'overlayShow'   :   false,
        'overlayOpacity':   0.4,
        'height'        :   hohe,
        'title'         :   false,
        'type'          :   'iframe'

    });
    $(".iframefull").fancybox({
        'padding'       :   0,
        'margin'        :   50,
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'titleShow'        :false,
        'speedIn'       :   600,
        'speedOut'      :   200,
        'overlayShow'   :   false,
        'overlayOpacity':   0.4,
	'width' 	 :  weite,
        'height'        :   hohe,
        'title'         :   false,
        'type'          :   'iframe'

    });
    


    /* fancy fuer die iframes */
    $(".iframetermin").fancybox({
        'padding'       :   45,
        'margin'        :   0,
        'autoScale'     :   true,
        'autoDimensions'     :   true,
        'titleShow'        :false,

        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   600,
        'speedOut'      :   200,
        'overlayShow'   :   false,
        'overlayOpacity':   0.4,
        'title'         :   false,
        'type'          :   'iframe'

    });
    
    /* fancy fuer die zertifikate */
	$(".zertigal").fancybox({
        'titleShow'        :false,});
	
	
	    /* fancy fuer die zertifikate */
    $(".zertifancy").fancybox({
        'padding'       :   0,
        'margin'        :   0,
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   200,
        'speedOut'      :   200,
        'overlayShow'   :   true,
        'overlayOpacity':   0.9,
        'width'        :   960,
        'height'        :   600,
        'titleShow'         :   false,
        'type'          :   'iframe'

    });
	

	/* Startseitenflashfilm */
    $(".flashfilm").fancybox({
	    'padding'           : 0,
	    'overlayOpacity'    : .8,
        'titleShow'        :false,
	    'overlayColor'      : '#000',
        'autoScale'     	: false,
        'transitionIn'		: 'fast',
        'speedIn'		    :	200,
		'speedOut'		    :	200,
		'overlayShow'       : true,
		'transitionOut'		: 'fast'
	});

   	/* Impressum */
	$(".impressum").hide();
    $(".openimpressum").toggle(
   function () {
      $(this).html('&raquo; Impressum einklappen');
      $(".impressum").show(500);
      },
   function () {
      $(this).html('&raquo; Impressum anzeigen');
      $(".impressum").hide(500);
      }
   )

   	/* Sprachauswahl*/
    $(".sprachen").fadeTo(1,0.3);
    $(".opensprachen").hover(
   function () {
      $(".sprachen").stop().fadeTo(500,1);
      },
   function () {
      $(".sprachen").stop().fadeTo(100,0.3);
      }
   )

   	/* Vita Accordion*/
   	$(".vitadiv").hide();
    $(".vitap").toggle(
   function () {
      $(this).removeClass("vitap").addClass("vitapaktiv");
      $(this).next(".vitadiv").show(500);
      },
   function () {
      $(this).removeClass("vitapaktiv").addClass("vitap");
      $(this).next(".vitadiv").hide(500);
      }
   )

   	/* Lebenslauf Assistenten */
   	$(".lebenslauf").hide();
    $(".opennext").toggle(
   function () {
      $(this).next(".lebenslauf").show(500);
      },
   function () {
      $(this).next(".lebenslauf").hide(500);
      }
   )


});/* ENDE von document ready */


