this.tooltip = function(){	

		/* CONFIG */	

			xLeftOffset = 130;

			xOffset = 85;

			yOffset = -60;		

			// these 2 variable determine popup's distance from the cursor

			// you might want to adjust to get the right result		

		/* END CONFIG */

		

		$("#left-pane th[class='sq-foot-hint']").hover(function(e){											  

			this.t = this.title;

			//this exception was added later to account for this bubble's html insite the bubble

			$("body").append("<div class='hint-large'><p>Druckgeschwindigkeit mit der Sie produzieren wollen in qm pro Stunde. Hilfestellung:<br />Fine-Art Produktion: 7 qm pro Stunden, Fahrzeugbeschriftung: 9 qm pro Stunden, Werbedrucke: 18 qm pro Stunden.</p></div>");

			$(".hint-large").css("top",(e.pageY - xLeftOffset) + "px").css("left","75px")

		},

		function(){

			this.title = this.t;

			$(".hint-large").remove();

		});

		

		$("#left-pane th[class='']").hover(function(e){											  

			this.t = this.title;

			$("body").append("<div class='hint'><p>"+ this.t +"</p></div>");

			$(".hint").css("top",(e.pageY - xOffset) + "px").css("left","75px")

		},

		function(){

			this.title = this.t;

			$(".hint").remove();

		});

		

		$("#right-pane th.tip").hover(function(e) {											  

			this.t = this.title;										

			//alert(thisText);

			$("body").append("<div class='hint'><p>"+ this.t +"</p></div>");

			$(".hint").css("top",(e.pageY - xOffset) + "px").css("left","375px")	

		},

		function(){

			$(".hint").remove();

		});	

		

		$("th.large").hover(function(e) {											  

			this.t = this.title;

			$("body").append("<div class='hint-large'><p>"+ this.t +"</p></div>");

			$(".hint-large").css("top",(e.pageY - xOffset  - 50) + "px").css("left","375px")		

		},

		function(){

			$(".hint-large").remove();

		});



};





$(document).ready(function() {



	//Default is to hide lease fields

	$("*.lease").hide();

	$("div.tooltip").hide();



	//When purchase is clicked

	$("input#purchase").click(function()

	{

		$("*.purchase").show();

		$("*.lease").hide();

		$("#total_costs").empty().append(purchaseCosts);

		var clearResults = "";

	});

	

	//When lease is clicked

	$("input#lease").click(function()

	{

		$(".purchase").hide();

		$(".lease").show();

		$("#total_costs").empty().append(leaseCosts);

	});



	//Activate submit on click

	$("#calculate").click(function(event)

	{ 

		event.preventDefault();  

		$("div.usd").show();

		$(this).parents('form')[0].submit();

	});

	

	//Activate submit on click

	$("#calculator_reset").click(function(event)

	{ 

		event.preventDefault();  

		

		$("div.usd").hide();

		var clearResults = "";

		

		$('span').text(clearResults);

		$('table#revenue span#total_printed_media').text(clearResults);

		$('table#revenue span#sellable_output').text(clearResults);

		$('table#profit td#break_even').text(clearResults);

		$('table#revenue span#total_production_hours').text(clearResults);

		$('table#revenue span#lease_payments').text(clearResults);

		$('table#revenue span#null1').text(clearResults);

		$('tr.total td#monthly_gross_revenue').text("");

		$('tr.total td#total_costs').text("");

		

		//reset the inputs too

		$("#purchase_dollars").val("21999");

		$("#lease_dollars").val("650");

		$("#avg_selling_dollars").val("20");

		$("#avg-selling-cents").val("00");

		$("#print_rate").val("7");

		$("#waste_integer").val("10");

		$("#waste_tenth").val("0");

		$("#media_dollars").val("5");

		$("#media_cents").val("00");

		$("#ink_dollars").val("0");

		$("#ink_cents").val("25");

		$("#labor_dollars").val("20");

		$("#labor_cents").val("00");

		$("#kwh_dollars").val("0");

		$("#kwh_cents").val("22");

		$("#printing_hours").val("6.0");

		$("#working_days").val("20");

	});

	

	// alert($("#ink_dollars").val());

	// 	$("#ink_dollars").val("99");

	// 	alert($("#ink_dollars").val());

	

	tooltip();



});




