﻿//*************************************************************************************
// File     : djdiFunctions.js
// Version  : 1.2
// Requires : jquery.js (version 1.2.6+), braingnat.js (version 0.1.2+)
// Author   : Janae Wiedmaier (jw), Kyle Weems (ksw)
// Origin   : mindfly.com
// Created  : November 17, 2008
// Modified : January 15, 2009
//*************************************************************************************

$(document).ready(function() {
    BrainGnat.setContentHeight(35);
    homeCoupon();
});


function homeCoupon() {
    $('.home #subBox1 p').bind('click', function() {
        $.get('/Controls/DJDI/Coupon.ashx', function(data) {
            $('body').attr('class', 'home hasCoupon');
            var coupon = $('<div></div>').attr('id', 'coupon');
            var wrapper = $('<div></div>').attr('class', 'wrapper');
            var close = $('<span></span>').attr('class', 'close').append($('<a></a>').attr('href', '/').attr('title', 'close').html('[x]'));
            var printCoupon = $('<span></span>').attr('class', 'printCoupon').append($('<a></a>').attr('href', '#').attr('title', 'print').html('[print]'));
            wrapper.append(close);
            wrapper.append(data);
            wrapper.append(printCoupon);
            coupon.append(wrapper);
            $('body').append(coupon);
            $('.printCoupon a').bind('click', function() { window.print(); return false; });
            $(this).unbind('click');
        });
    });
}
