$(document).ready(function(){
							
        //Animation Bug Workaround for IE + Safari: positioning from top instead of bottom
	//Occured only with slide from bottom effect
	/*
        if($.browser.msie || $.browser.safari) {

                $(".outfitLinks").each(function() {
                
                        bottom = parseFloat($(this).css("bottom"));
                        padding = parseFloat($(this).css("paddingBottom")) + parseFloat($(this).css("paddingTop"));
                        border = parseFloat($(this).css("borderBottomWidth")) + parseFloat($(this).css("borderTopWidth"));	
                        distance = bottom + padding + border;

                        $(this).css({
                                "bottom" : "auto",
                                "top" : ($(this).parent().height() - $(this).height() - distance) + "px",
                                "visibility" : "visible"
                        });
                });
        } 
	*/
	
        $(".content_onlinemag_3outfits a").click(function() {
		
                //if no animation is running..
                if (!$(".outfitLinks").is(':animated')) {
			
                        showLayer = $("#" + $(this).attr("rel"));
                        currentLayer = $(".outfitLinks.visible");
                
                        //if there is already a visible layer..
                        if(currentLayer.length) {
                                currentLayer.fadeOut(500, function() {
					
                                        $(this).removeClass("visible");
                                        
                                        //if the visible layer isn't the clicked one..
                                        if(showLayer[0] != currentLayer[0]) {
                                                showLayer.fadeIn(500, function() {
                                                        showLayer.addClass("visible");
                                                });    
                                        }
                                });
                        
                        } else {
				
                                showLayer.fadeIn(500, function(){
                                        showLayer.addClass("visible");
                                });
                        }
                }          
                
                return false;
        });
        
        $(".outfitLinks .closelink").click(function() {
                $(this).parent().fadeOut(500, function() {
                        $(this).removeClass("visible");
                });
                
                return false;
        });
        
});