﻿

(function($) {

    var XComplica = {
        initialize: function() {

            // clickable boxes
            $('.projectBox').projectHighlight();
            $('.projectBox').projectDisplay();

        }
    };

    /**
    Project MouseOvers
    */
    $.fn.projectHighlight = function(settings) {

        this.mouseover(function() {

            $(".projectTextBar", this).css("background-image", "none");
            $(".projectTextBar", this).css("background-color", "#fd9c09");

        })
        this.mouseout(function() {
            $(".projectTextBar", this).css("background-color", "#000000");
            $(".projectTextBar", this).css("background-image", "url('/Content/Images/TopMenuBack.png')");
        });


    }

    $.fn.projectDisplay = function(settings) {
        // generate random number between 0 and 20
        var randomoffset = Math.floor(Math.random() * 21) + 10 + "%";
        
        this.click(function(e) {
            e.preventDefault();
            $("#projectDetails", this).modal({ opacity: 75, overlayClose: true, position: ["0%", ], onOpen: function(dialog) {
                dialog.overlay.fadeIn('fast', function() {
                    dialog.container.slideDown('slow', function() {
                        dialog.data.slideDown();
                    });
                });
            }

            });
        });

    }


    /**
    * Init
    */
    $(function() {
        XComplica.initialize();
    });

})(jQuery) 
    