 
function layoutResize(){
    if ($(window).width() <= '1280'){
        $("h1").css({
            "font-size": "15pt"
        });

        $("section strong").css({
            "font-size" : "7pt"
        });

        $("section p").css({
            "font-size" : "8pt",
            "lineHeight" : "14pt"
        });
    } else {
        $("h1").css({
            "font-size": "17pt"
        });

        $("section strong").css({
            "font-size" : "8pt"
        });
        $("section p").css({
            "font-size" : "9pt",
            "lineHeight" : "15pt"
        });
    }
	
    var agent = navigator.userAgent.toLowerCase();
    var is_iphone = (agent.indexOf('iphone')!=-1);
    if (is_iphone) {
         
        $(".font-nav2").css({
            "font-size" : "7pt"
        });


        $("section strong, .weiterlesen, .schliessen").css({
            "font-size" : "4pt"
        });

        $("h1").css({
            "font-size": "14pt"
        });
    }
}
 
$(document).ready(function() {
    /*
      * Aufloesungseinstellungen 
      */
    layoutResize();
	
    $(window).resize(function() {
        layoutResize();
    });
  	
    /*
	* Anpassen der Fenstergroesse
	*/
	
    $(window).resize(function() {
        layoutResize();
    });
    /*
      * Scrollfunktionalitaet
      */

      
    $(".scroll").click(function(event){
        //prevent the default action for the click event
        event.preventDefault();

        //get the full url - like mysitecom/index.htm#home
        var full_url = this.href;

        //split the url by # and get the anchor target name - home in mysitecom/index.htm#home
        var parts = full_url.split("#");
        var trgt = parts[1];

        //get the top offset of the target anchor
        var target_offset = $("#"+trgt).offset();
        var target_top = target_offset.top - 31;

        //goto that anchor by setting the body scroll top to anchor top
        $('html, body').animate({
            scrollTop:target_top
        }, 1000);
    });

    /*
 * weiterlesen / schliessen Animation
 */
    $(".weiterlesen").click(function(){
        var $bild = $(this).parent().prev();
        var $untertitel = $bild.prev();
        var $img = $bild.children();
        var $rightColumn = $(this).prev();
        var $leftColumn = $rightColumn.prev();
        var $newLeftColumn = $(this).next();
        var $newRightColumn = $newLeftColumn.next();
        var $close = $newRightColumn.next();
                            
        $(this).hide();
        // linke Spalte verstecken
        $leftColumn.hide();
        // rechte Spalte verstecken
        $rightColumn.hide();

        // versteckte Spalte sichtbar machen
        // linke Spalte
        $newLeftColumn.css({"display":"none"}).removeClass("visuallyhidden").fadeIn(2500);
        // rechte Spalte
        $newRightColumn.css({"display":"none"}).removeClass("visuallyhidden").fadeIn(2500);

        $close.show();

        // Untertitel verstecken
        $($untertitel).hide();
        $($untertitel).css({
            "width": "49%",
            "top": "467px"
        });

        // Bild vergroeßern
        if ($(window).width() <= '1280'){
            
            $($bild).animate({
                "height": "467px",
                "width": "49%"                
            },1000);

            $($img).animate({
                "height": "467px",
                "width": "696px",
                "marginLeft" : "-140px"
            },1000);
        } else {
            
                $($bild).animate({
                    "height": "467px",
                    "width": "49%"
                },1000);

                $($img).animate({
                    "height": "467px",
                    "width": "696px"
                },1000);
            
        }

        $($untertitel).fadeIn(2000);
        
      
                            
    });

    $(".schliessen").click(function(){
        var $bild = $(this).parent().prev();
        var $untertitel = $bild.prev();
        var $img = $bild.children();
        var $rightColumn = $(this).prev();
        var $leftColumn = $rightColumn.prev();
        var $newRightColumn = $leftColumn.prev().prev();
        var $newLeftColumn = $newRightColumn.prev();
        var $weiterlesen = $leftColumn.prev();
        // Bild vergroeßern
                // Untertitel verstecken
        $($untertitel).hide();
        $($untertitel).css({
            "width": "320px",
            "top": "160px"
        });
         $($img).animate({
                "height": "215px",
                "width": "320px",
                "marginLeft" : "0px"

            },500);

            $($bild).animate({
                "height": "160px",
                "width": "320px"
            },500);
       
        // linke Spalte verstecken
        $(this).hide();
        $leftColumn.hide();
        // rechte Spalte verstecken
        $rightColumn.hide();
                            
        // versteckte Spalte sichtbar machen
        // linke Spalte
        $newLeftColumn.fadeIn(2200);
        // rechte Spalte
        $newRightColumn.fadeIn(2200);
        $weiterlesen.show();
        $($untertitel).fadeIn(1200);
                            

    });
});
