// JavaScript Document

jQuery.fn.center = function (altleft,alttop) { 
		if(isNaN(alttop)){var alttop=0;}
		if(isNaN(altleft)){var altleft=0;}
    this.css("position","absolute");
    this.css("top", ($(window).height()-this.height())/2+$(window).scrollTop() + alttop + "px"); 
    this.css("left", ($(window).width()-this.width())/2+$(window).scrollLeft() + altleft + "px"); 
    return this; 
};

jQuery.fn.modal = function () {
			document.documentElement.style.overflow="hidden";
			this.attr("modal","true");
			this.center();
			this.css("zIndex","201");
			this.fadeIn("slow");
			document.getElementById('modal').style.top=$(window).scrollTop()+'px';
			$("#modal").fadeTo("slow",0.75);
};

jQuery.fn.demodal = function () {
			this.attr("modal","false");
			$("#modal").fadeOut("fast");
			$(this).fadeOut("fast");
			document.documentElement.style.overflow="auto";
};


