jQuery.noConflict();

(function($) {
		  
var gup = gup || {};
gup.Dropdown = gup.Dropdown || {
    init: function() {
		
        $(".dropdown dl").each(function() {
            gup.Dropdown.initDropdown(this);
        });
    },
    initDropdown: function(dropdown) {
        dropdown = $(dropdown);
        var items = dropdown.find("dt, dd"),
            dt = items.filter("dt");

        dropdown
            .data("openHeight", gup.Dropdown.getOrigHeight(items) + "px")
            .data("closedHeight", dropdown.css("height"));

        dt.toggle(
            function() {
                dropdown.stop().animate({
                    height: dropdown.data("openHeight")
                }, {
                    duration: 350
                });
            },
            function() {
                dropdown.stop().animate({
                    height: dropdown.data("closedHeight")
                }, {
                    duration: 350
                });
            }
        );
    },
    getOrigHeight: function(items) {
        var height = 0;
        items.each(function() {
            height += $(this).outerHeight();
        });
        return height;
    }
};

$(function() {

    gup.Dropdown.init();
		
	$(".more")
		.before("<a href=\"#\" title=\"mehr\" class=\"more_link\">mehr</a>");
	
	var initialBox = initialBox || false;
	if(initialBox)
		show($("#"+initialBox));
		
	$(".more_link")
		.click(function() {
			$(".more:visible").slideUp("slow");
			
			var morebox = $(this).next();
			
			if(morebox.is(":hidden")) {
				show(morebox);
			} else if(morebox.is(":visible")) {
				morebox.slideUp("slow", function() {
					$("#wrap").trigger("resize");
				});
			}
			return false;
		});
	
	function show(el) {
		el.slideDown("slow", function() {
			$("#wrap").trigger("resize");
		});
	}
	
});

})(jQuery);

function showIphone(){
	(function($) {
		$(function() {
			$.nyroModalManual({
                            url: '#iphone4',
                            minWidth: 410,
                            minHeight: 800,
                            width: 410,
                            height: 800,
                            resizable: false,
                            autoSizable: false,
                            hideContent: function(elts, settings, callback) {
                                elts.contentWrapper.fadeOut(350, function() {
                                    elts.contentWrapper.hide();
                                    callback();
                                });
                            },
                            closeButton: '<a href="#" class="nyroModalClose" id="iphoneButton" title="schlie&szlig;en"></a>'
                        });
		});
	})(jQuery);	
}
