/**
 *  jQuery Light Modal Box system
 *  Copyright (c) 2009  Jonathan Biddle
 *  http://www.digitalbreaker.com
 */
(function($){$.modal=function(a,b){var c={modalClass:"modalBox",closeClass:"modalClose",displayOverlay:true,overlayClose:true};if(typeof(a)=='object'){b=a};var b=$.extend(c,b);var d=$(window);var f=$(document);var g=$("<div></div>");var h=$("<div class=\""+b.modalClass+"\"></div>");h.html(a);g.css({opacity:0.6,backgroundColor:"#000000",display:"none",position:"absolute",top:0,left:0,height:f.height(),width:f.width(),zIndex:9998});h.css({position:"absolute",display:"none",zIndex:9999});if(b.displayOverlay){$("body").append(g)}$("body").append(h);var i=function(){var x=(d.width()*0.5)-(h.width()*0.5)+(d.scrollLeft());var y=(d.height()*0.5)-(h.height()*0.5)+(d.scrollTop());h.css({top:y,left:x})};var j=function(){h.fadeIn();g.fadeIn()};var k=function(){h.fadeOut(300);g.fadeOut(300,function(){g.remove();h.remove()})};d.scroll(function(){if(d.height()>h.height()){i()}});d.resize(function(){i()});if(b.overlayClose){g.click(function(){k()})}$("."+b.closeClass).click(function(e){e.preventDefault();k()});h.center=function(){i()};h.close=function(){k()};h.show=function(){j()};i();j();return h}})(jQuery);
