﻿$(document).ready(function(){

    fancyZoom = function(selector) {
        links = $(selector).replaceWith("<div class=\"fancyZoom\"></div>");
        links.each(function(){
            $(".fancyZoom:empty:first").append(this);
        });
        
        images = $(selector + " img").replaceWith("");
        images.each(function(){
            $(".fancyZoom:not(:has(img)):first").append(this);
        });
        
        $(".fancyZoom a").fancybox();
    };
    
    //$(".fancyZoom a").fancybox();
    fancyZoom(".fancyBoxFancyZoom");
    
    
    $(".wpp-right .accordion .expand .topshow a").click(function(){
        $(".wpp-right .accordion .expand .topshow a").css("visibility", "visible");
        $(this).css("visibility", "hidden");
        
        lol = this;
        
        $(".wpp-right .accordion .expand .more").hide(function(){
            setTimeout(function() { $(".more", $(lol).parent().parent()).show(); }, 100);
        });
        
    });
    
    if($("#wpp .wpp-right *").size() == 0) {
        $("#wpp .wpp-middle").css("border-right", "0 none");
    }
    
});