/**
* Modal Boxes JS
*
* @author Euan T. <euan@euantor.com>
* @version 1.0.0
*/
jQuery.noConflict();
jQuery(document).ready(function($)
{
jQuery('#csboard_box input[name="url"]').attr("value", window.location);
// Modal Boxes //
jQuery('a[name="csboard"]').on('click', function(event)
{
event.preventDefault();
var target = $(this).attr('rel');
// Set up the shadowing
var maskHeight = jQuery(document).height();
var maskWidth = jQuery(window).width();
jQuery('#mask').css({'width': maskWidth, 'height': maskHeight});
jQuery('#mask').fadeIn(800);
jQuery('#mask').fadeTo("slow", 0.5);
// Position the actual modal
var winH = jQuery(window).height();
var winW = jQuery(window).width();
jQuery(target).css('top', (winH / 2) - (jQuery(target).height() / 2));
jQuery(target).css('left', (winW / 2) - (jQuery(target).width() / 2));
jQuery(target).fadeIn(600);
});
jQuery('.csboard_box a[rel="close_csboard"]').on('click', function(event)
{
event.preventDefault();
jQuery('#mask, .csboard_box, csboard_box_box').fadeOut(600);
});
jQuery('#mask').on('fadeOut(800)', function ()
{
jQuery(this).hide();
jQuery('.csboard_box').hide();
});
});