

function fn()
{
	var Net_sales=f.t1.value;
	var cost_of_good_sold=f.t2.value;
	var gross_profit=Net_sales-cost_of_good_sold;
	//alert(current_ratio);
	f.t3.value=gross_profit;
}

function fn1()
{	
var value=	f.t3.value;
f1.t4.value=value;
}
function fnn()
{
var value1=	f.t1.value;
f1.t5.value=value1;
f2.t8.value=value1;
f3.t13.value=value1;


}
function fn2()
{	


var gross_profit=f1.t4.value;
var net_sales=f1.t5.value;
var gross_margin_ratio=gross_profit/net_sales;
f1.t6.value=Math.round(gross_margin_ratio);

}

function net_profit_margin()
{
	var net_profit_before_tax=f2.t7.value;
	var net_sales=f2.t8.value;
	var net_profit_margin=net_profit_before_tax/net_sales;
	f2.t9.value=Math.round(net_profit_margin);
}

function inventory_turnover_ratio()
{
	var net_sales=f3.t13.value;
	var Average_Inventory_Cost=f3.t14.value;
	var Inventory_Turnover=net_sales/Average_Inventory_Cost;
	f3.t15.value=Math.round(Inventory_Turnover);
}

function Account_Receivable_Turnover_Ratio()
{
	var net_credit_sales=f4.t16.value;
	var total_current_liabilities=f4.t17.value;
	var daily_credit_sales=net_credit_sales/total_current_liabilities;
	f4.t18.value=Math.round(daily_credit_sales);
	f4.t22.value=Math.round(daily_credit_sales);
}

function Return_on_Assets_Ratio()
	{
		var net_credit_sales=f5.t19.value;
		var days=f5.t.value;
		var daily_credit_sales=net_credit_sales/days;
		f5.t20.value=daily_credit_sales;
	}

function Account_receivable_turnover()
	{
		var account_receivable=f4.t21.value;
		var daily_credit_sales=f4.t22.value;
		var daily_credit_sales=account_receivable/daily_credit_sales;
		f4.t23.value=Math.round(daily_credit_sales);
	}
	
function Return_on_Assets()
	{
		var Net_profit_Before_Tax=f6.t24.value;
		var Net_Worth=f6.t25.value;
		var Return_on_Investment=Net_profit_Before_Tax/Net_Worth;
		f6.t26.value=Math.round(Return_on_Investment);
	}
/*
function cal_quick_ratio()
{
	var cash=parseInt(f2.t1.value);
	var govern_sec=parseInt(f2.t2.value);
	var receivable=parseInt(f2.t3.value);
	var tot_cur_lib=parseInt(f2.t4.value);
//alert(f1.t2.value);
	var quick_ratio=parseInt((cash+govern_sec+receivable)/tot_cur_lib);
	f2.t5.value=quick_ratio;
	
}


*/
function Validation()
    {
      with(document.f)
        {
          if(t1.value.length ==0)
            {            
             alert("Net Sales  can not be null");
            t1.focus();
             return false;
            }             
            
          if(t2.value.length ==0)
            {            
             alert("Cost of good sold can not be null");
             t2.focus();
             return false;
            }  
        }   
   } 
   
   
function Validation1()
    {
      with(document.f2)
        {
          if(t7.value.length ==0)
            {            
             alert("Net Profit Before Tax  can not be null");
            t7.focus();
             return false;
            }             
            
          /*if(t5.value.length ==0)
            {            
             alert("Goverment Securities  can not be null");
             t5.focus();
             return false;
            }  
			
			     if(t3.value.length ==0)
            {            
             alert("Receivables can not be null");
             t3.focus();
             return false;
            }  
			*/

        }   
   } 
   
   function Validation2()
    {
      with(document.f3)
        {
          if(t14.value.length ==0)
            {            
             alert("Average Inventory at Cost  can not be null");
            t14.focus();
             return false;
            }             
            
        

        }   
   } 
  
  
    function Validation3()
    {
      with(document.f4)
        {
          if(t16.value.length ==0)
            {            
             alert("Net Credit sales/Year  can not be null");
            t16.focus();
             return false;
            }             
            
        if(t17.value.length ==0)
            {            
             alert("Total current Liabilities  can not be null");
            t17.focus();
             return false;
            }     

        }   
   } 
  
  var theObj="";

function toolTip(text,me) {
  theObj=me;
  theObj.onmousemove=updatePos;
  document.getElementById('toolTipBox').innerHTML=text;
  document.getElementById('toolTipBox').style.display="block";
  window.onscroll=updatePos;
}

function updatePos() {
  var ev=arguments[0]?arguments[0]:event;
  var x=ev.clientX;
  var y=ev.clientY;
  diffX=24;
  diffY=0;
  document.getElementById('toolTipBox').style.top  = y-2+diffY+document.body.scrollTop+ "px";
  document.getElementById('toolTipBox').style.left = x-2+diffX+document.body.scrollLeft+"px";
  theObj.onmouseout=hideMe;
}

function hideMe() {
  document.getElementById('toolTipBox').style.display="none";
}

