
function fn()
{
	var Total_cu_Assets=f1.t1.value;
	var Total_cu_Liab=f1.t2.value;
	var Current_Ratio=Total_cu_Assets/Total_cu_Liab;
	//alert(current_ratio);
	f1.t3.value=Math.round(Current_Ratio);
}

function fill_assets()
{	
var value=	f1.t1.value;
f3.t9.value=value;
}


function fill_lib()
{
	var value_Lib=f1.t2.value;
	f2.t7.value=value_Lib;
	f3.t10.value=value_Lib;
	f4.t12.value=value_Lib;
}

function Quick_Ratio()
{
	var Cash=f2.t4.value;
	var Goverment_Securities=f2.t5.value;
	var Receivables=f2.t6.value;
	var Toatal_Current_Liabilities=parseInt(f1.t2.value);
	
	
	///alert(Toatal_Current_Liabilities);
	
var quick_ratio=(Cash+Goverment_Securities+Receivables)/Toatal_Current_Liabilities ;
	f2.t8.value=Math.round(quick_ratio);
}

function Working_Capital()
{
	var Total_current_Assets=f3.t9.value;
	var Total_current_Liabilities=f3.t10.value;
	var Working_Capital=Total_current_Assets-Total_current_Liabilities;
	f3.t11.value=Working_Capital;
}

function Worth_Ratio()
{
	var Total_Liabilities=f4.t12.value;
	var Net_Worth=f4.t13.value;
	var Worth_Ratio=Total_Liabilities/Net_Worth;
	f4.t14.value=Math.round(Worth_Ratio);
}




//validation

function Validation()
    {
      with(document.f1)
        {
          if(t1.value.length ==0)
            {            
             alert("Total current Assets can not be null");
            t1.focus();
             return false;
            }             
            
          if(t2.value.length ==0)
            {            
             alert("Total current Liabilities can not be null");
             t2.focus();
             return false;
            }  
        }   
   } 
   
   
function Validation1()
    {
      with(document.f2)
        {
          if(t4.value.length ==0)
            {            
             alert("Cash can not be null");
            t1.focus();
             return false;
            }             
            
          if(t5.value.length ==0)
            {            
             alert("Goverment Securities  can not be null");
             t2.focus();
             return false;
            }  
			
			     if(t6.value.length ==0)
            {            
             alert("Receivables can not be null");
             t3.focus();
             return false;
            }  
			

        }   
   } 
   
   function Validation2()
    {
      with(document.f4)
        {
          if(t12.value.length ==0)
            {            
             alert("Net Worth  can not be null");
            t12.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";
}







/*function fn()
{
	var Total_current_Assets=f1.t1.value;
/var Total_current_Liabi=f1.t2.value;
	var Current_Ratio =Total_current_Assets/Total_current_Liabi;
	//alert(current_ratio);
f.t3.value=Current_Ratio;
//alert(Total_current_Assets);

}

function fill_assets()
{	
var value=	f1.t1.value;
f3.t9.value=value;
}

function fill_lib()
{
	var value_Lib=f1.t2.value;
	f2.t7.value=value_Lib;
	f3.t10.value=value_Lib;
	f4.t12.value=value_Lib;
}

function Quick_Ratio ()
{
	var Cash=f2.t4.value;
	var Goverment_Securities=f2.t5.value;
	var Receivables=f2.t6.value;
	var Toatal_Current_Liabilities=f2.t7.value;
	
	var quick_ratio=(Cash+Goverment_Securities+Receivables)/Toatal_Current_Liabilities ;
	f2.t8.value=Math.round((quick_ratio);
}
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=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=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=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=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=f5.t21.value;
		var daily_credit_sales=f5.t22.value;
		var daily_credit_sales=account_receivable/daily_credit_sales;
		f5.t23.value=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=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 Worth_Ratio()
{
	var tot_lia=f4.t1.value;
	var net_worth=f4.t2.value;
	
	f4.t3.value=tot_lia/net_worth;
	
}

//validation

function Validation()
    {
      with(document.f1)
        {
          if(t1.value.length ==0)
            {            
             alert("Total current Assets can not be null");
            t1.focus();
             return false;
            }             
            
          if(t2.value.length ==0)
            {            
             alert("Total current Liabilities can not be null");
             t2.focus();
             return false;
            }  
        }   
   } 
   
   
function Validation1()
    {
      with(document.f2)
        {
          if(t1.value.length ==0)
            {            
             alert("Cash can not be null");
            t1.focus();
             return false;
            }             
            
          if(t2.value.length ==0)
            {            
             alert("Goverment Securities  can not be null");
             t2.focus();
             return false;
            }  
			
			     if(t3.value.length ==0)
            {            
             alert("Receivables can not be null");
             t3.focus();
             return false;
            }  
			

        }   
   } 
   
   function Validation2()
    {
      with(document.f4)
        {
          if(t2.value.length ==0)
            {            
             alert("Net Worth  can not be null");
            t2.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";
}

*/