$(document).ready(function(){
	
     //Adjust height of overlay to fill screen when page loads  
    $("#fuzz").css("height", $(document).height());
    $("#fuzz").css("width", $(document).width());    
   
    //When the link that triggers the message is clicked fade in overlay/msgbox  
    $(".alert").click(function(){  
       $("#fuzz").fadeIn();  
       return false;  
    });  
   
    //When the message box is closed, fade out  
    $(".close").click(function(){  
       $("#fuzz").fadeOut();  
       return false;  
    });



	/*
	// adjust height of overly to fill screen when page loads
	
	$("#fuzz").css("height", $(document).height());
	
	// when the link that triggers the message is clicked fade in overly
	
	$('.alert').click(function(){
		$('#fuzz').fadeIn();
		return false;
	});
	
	// when the message box is closed fade out
	
	$('.close').click(function(){
		$('#fuzz').fadeOut();
		return false;
	});
	*/
	
	
	$('#profitform').submit(function(){
		$.ajax({
			data: $(this).serialize(),
			type: $(this).attr('method'),
			url: "/pages/atmprocalc/calculator.php",
			success: function(response){
				$('#calcmsgbox').animate({height:"275px"},750, function(){
					$('#calcbox1').html(response);
					}
				);
			}
		});
		return false;
	});
	
	/*	
	$('#calculate1').click(function() {
		var custperdayVal = parseInt($('custperday').val());
		var transfeeVal = parseInt($('transfee').val());
		
		
			
		
			
		
		$.post("/home/mark/www/mrcash/pages/atmprocalc/calculator.php",
			{ custperday: custperdayVal, transfee: transfeeVal, calculate1: true },
			function(html){
				$("#calcbox1").innerHTML = html;
			}
		);
		
	*/	
	/*
		var custperday = parseInt($('custperday').val());
		var numdays = parseInt($('numdays').val());
		var custpermonth = parseInt($('custpermonth').val());
		var percentcust = parseInt($('percentcust').val());
		var transpermonth = parseInt($('transpermonth').val());
		var transfee = parseInt($('transfee').val());
		var profit1 = parseInt($('profit1').val());
		
		custpermonth = custperday * numdays;
		transpermonth = custpermonth * (percentcust / 100);
		profit1 = transpermonth * transfee;
		
		$('custpermonth').val('custpermonth');
		$('transpermonth').val('transpermonth');
		$('profit1').val('profit1');
	*/
	/*	
		return false;
	});
	*/
	
	
	
});

// adjust height of overlay to fill screen when browser gets resized
$(window).bind("resize", function(){
	$("#fuzz").css("height", $(window).height());
});
