function Hospital(cntrl)
{
	var hospital = {};
	hospital = new NET(cntrl);// inherit net class
	
	/* Attributes */
	
	/* EOF Attributes */
	
	/* Function Declaration */
	
	hospital.heal = heal;
	hospital.healHealth = healHealth;
	hospital.healHealthCallback=healHealthCallback;
	hospital.loadPage = loadPage;
	hospital.refreshAmt = refreshAmt;
	
	/* EOF Function Declaration */
	
	/* Function Definition */
	
	function heal()
	{
		var amt = $('#hospital_heal_per').val(); 
		var level=owner.level;
		var max_health=owner.max_health;
		var fav_point=owner.favour_point;
		var cash_in_bank=owner.cash_in_bank;
		if(amt<=70)
		{
		var totalCost=0.1 * level * max_health * amt;
		var needAmt = Math.floor(totalCost-cash_in_bank);
			if(cash_in_bank < totalCost)
			{
			hospital.outputMessage('You need <span class="gold"> '+numberFormat(needAmt)+' g </span> more to heal. Deposit more <span class="gold">gold</span> to your <a href="javascript:app.loadPage(\'bank\')">Treasury</a>!','i');
			return;
			}
		}
		else if(fav_point<10)
			{
				hospital.outputMessage('You donot have enough <a href="javascript:app.loadPage(\'godfather\')">Coins</a> in your account.','i');
				return;
			}
		hospital.healHealth(amt);
	};
	
	function healHealth(amt)
	{
	hospital.makeRequest();
	};
	
	function healHealthCallback(xml)
	{
	var message=$('data',xml).find('message').text(); 
	hospital.outputMessage(message,'s');

	};
	function loadPage()
	{
		hospital.clearMessage();
		hospital.adjustWindowHeight();		
		refreshAmt();
		//hover();
	};
	
	function refreshAmt()
	{
		var per = $('#hospital_heal_per').val();
		var level = owner.level;
		var max_health = owner.max_health;
		$('#hospital_per').html(per);
		if(per>70)
		{
		$('#doller').hide();
		$('#hospital_amt').html('10 Coins');
		}
		else
		$('#hospital_amt').html(numberFormat(parseInt(0.1*level*max_health*per))+" g");
		
	};
	/* EOF Function Definition */
	
	return hospital;
}