var WpvFileHandler_538 = {
    intervalId: 0,
    
    mouseOverCell: function (cell) {
        cell.style.borderWidth = "0px";
        cell.style.borderColor = "#0000ff";
        cell.style.backgroundColor = "#ffffff";
        cell.style.cursor = "pointer";
    },

    mouseOutCell: function (cell) {
        cell.style.borderWidth = "0px";
        cell.style.borderColor = "#ffffff";
        cell.style.backgroundColor = "#ffffff";
        cell.style.cursor = "default";
    },

    downloadFile: function (sRequest) {
        self.location.href = "http://artydandy.com/main/?" + sRequest;
    },

    showImage: function (file_id, post_id, action_type, hash) {
        var oParameters = new XmlRequestParameters();
        
        oParameters.add("wpv-image-display", true);
        oParameters.add("file_id", file_id);
        oParameters.add("post_id", post_id);
        oParameters.add("action_type", action_type);
        oParameters.add("hash", hash);
        WpvDialog.onLoad = WpvFileHandler_538.checkImageLoad;
        WpvDialog.openDialog("http://artydandy.com/main/", "POST", oParameters, "wpv-modal-dialog-538");
    },

    doDefault: function (sRequest) {
        self.location.href = "http://artydandy.com/main/?" + sRequest;
    },
    
    checkImageLoad: function () {
        WpvFileHandler_538.intervalId = setInterval(
            function() {
                var oImage;
                var sLoadedImage = "wpv-loaded-image-538";
                
                if ((oImage = document.getElementById(sLoadedImage)) != null) {
                    if (typeof(oImage.complete) == "boolean") {
                        if (oImage.complete) {
                            var oFadeable = new FadeableObj(oImage);
                            
                            document.getElementById("wpv-image-loading-538").style.display = "none";
                            oFadeable.fadeIn();
                            clearInterval(WpvFileHandler_538.intervalId);
                        }
                    }
                    else {
                        clearInterval(WpvFileHandler_538.intervalId);
                        FadeableObj.makeFadeable(oImage, 1.0);
                    }
                }
            }, 500
        );
    }
}
