$(document).ready(function(){
jQuery.fn.fadeIn = function(speed, callback) { 
    return this.animate({opacity: 'show'}, speed, function() { 
        if (jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (jQuery.isFunction(callback)) 
            callback();  
    }); 
}; 
 
jQuery.fn.fadeOut = function(speed, callback) { 
    return this.animate({opacity: 'hide'}, speed, function() { 
        if (jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (jQuery.isFunction(callback)) 
            callback();  
    }); 
}; 
 
jQuery.fn.fadeTo = function(speed,to,callback) { 
    return this.animate({opacity: to}, speed, function() { 
        if (to == 1 && jQuery.browser.msie)  
            this.style.removeAttribute('filter');  
        if (jQuery.isFunction(callback)) 
            callback();  
    }); 
}; 


$('#button').click(function () { 
				$('.overlay').fadeIn();
				$('#calculator').fadeIn();
});

$('#button2').click(function () { 
				$('.overlay').fadeIn();
				$('#calculator2').fadeIn();
});

$('.overlay').click(function(){
				$('.overlay').fadeOut();
				$('#calculator').fadeOut();
                                $('#calculator2').fadeOut();
});
$('#closebutton').click(function(){
				$('.overlay').fadeOut();
				$('#calculator').fadeOut();
});

$('#closebutton2').click(function(){
				$('.overlay').fadeOut();
				$('#calculator2').fadeOut();
});
						   }); 
