function Is() {
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4b = (this.ns && (this.minor < 4.04));
    this.ns4 = (this.ns && (this.major >= 4));
    this.ie   = (agent.indexOf("msie") != -1);
    this.ie3  = (this.ie && (this.major == 2));
    this.ie4  = (this.ie && (this.major >= 4));
    this.op3 = (agent.indexOf("opera") != -1);
    this.win   = (agent.indexOf("win")!=-1);
    this.mac   = (agent.indexOf("mac")!=-1);
    this.unix  = (agent.indexOf("x11")!=-1);
}

var is = new Is();

if(is.ns4) 
{
    doc = "document.layers";
    sty = "";
    htm = ".document"
   xpos = "e.pageX";
   ypos = "e.pageY";
} 
else if(is.ie4) 
{
    doc = "document.all";
    sty = ".style";
    htm = ""
   xpos = "event.x";
   ypos = "event.y"; 
}

function showLayer(LayerName)
{
	FullLayerName = eval(doc + '["' + LayerName + '"]' + sty);
	
	if(is.ns4)
	{	
		FullLayerName.visibility = 'show';
	}
	else if (is.ie4)
	{		
		FullLayerName.visibility = 'visible';
	}
}

function hideLayer(LayerName)
{	
	FullLayerName = eval(doc + '["' + LayerName + '"]' + sty);			
	if(is.ns4)
	{		
		FullLayerName.visibility = 'hide';
	}
	else if (is.ie4)
	{		
		FullLayerName.visibility = 'hidden';				
	}
}

function ShowHelper(layername,id)
{
//	showLayer('Helper')
//	showLayer('H' + layername)
//	fullname = eval('document.all.' + layername + ".style")
//	document.all.Helper.style.top = fullname.top
//	helpname = eval('document.all.H' + layername + ".style")
}

function HideHelper(layername)
{
	hideLayer('Helper')
	hideLayer('H' + layername)
}

function tcode()
{
	alert("from .js file");
}


function CalculateTaxPayable(Type1,Income)
{
	//alert("in js")
	if (Type1 == 0 || Type1 == 2)
	{
		if (Income <= 50000) 
			return 0

		if (Income > 50000 &&  Income <= 60000) 
			 return (10/100*(Income -50000))
		
		if (Income > 60000 && Income <= 150000) 
		{
			x=(1000+20/100*(Income - 60000))
			y=x*5/100
			z=x+y
			
			return(z)
		}

		if (Income >= 150000)
		{
			x=(1000+18000+30/100*(Income-150000))
			y=x*5/100;
			z=x+y
			return(z)
		}
	}

	if (Type1 == 1) 
	{
		y=(Income*35/100)
		z=y*5/100
		ans=y+z
		return(ans)
	}

	
	if (Type1 == 3)
	{
		amount = 40/100*Income
		return amount

	}
}

function effratecal(loan,tenure_mm,emi,adv_emi)
{
		
		var EffRate,NetLoan
		TenureRem = tenure_mm - adv_emi
		
		NetLoan = (loan - emi*adv_emi)
		EffRate = (emi*TenureRem - NetLoan)*100/(NetLoan*TenureRem/12) 
		count = 1	
		while(true)
		{
		
				
			amt = emi*((1-Math.pow((1+EffRate/1200),(-1*TenureRem)))/(EffRate/1200))
					
			
			if (Math.abs(amt-NetLoan) > 5.0 && count < 100)
			
			{
				EffRate = EffRate + (amt - NetLoan)/(NetLoan*TenureRem/12)*100
				count++
			}
			else
			{
				return (Math.round(EffRate*100)/100)
				
			}
		}
		
}