﻿/// <reference path="jquery-1.4.1-vsdoc.js" />

$.fn.showcase = function(options) {
    //var settings = $.extend({}, options);

    //global
    var t = $(this);
    var tl = t.find('a');
    var reduce = 0.8;
    var sh = Math.floor(parseInt($(window).height()) * reduce);
    var sw = Math.floor(parseInt($(window).width()) * reduce);

    if (sh < sw) { //normal
        tl.each(function() {
            this.href = '/gi.aspx?f=' + this.href.substring(this.href.indexOf('/assets')) + '&s=' + sh;
        });
    }
    if (sh > sw) {
        tl.each(function() {
            this.href = '/gi.aspx?f=' + this.href.substring(this.href.indexOf('/assets')) + '&s=' + sw;
        });
    }

    //setting lightBox
    tl.lightBox();

    return this;
}