// JavaScript Document

var tooltip1msg="<table width='200' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='TCC_QuickCalc/js/bt_top.gif'></td></tr><tr><td style='background-image:url(TCC_QuickCalc/js/bt_bg.gif); padding-left:10px; padding-right:10  ' class='tooltip' >Add up the parents, kids, and anyone who gets at least 50% of their financial support from you.</td></tr><tr><td><img src='TCC_QuickCalc/js/bt_bottom.gif'></td></tr></table>";

var tooltip2msg="<table width='200' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='TCC_QuickCalc/js/bt_top.gif'></td></tr><tr><td style='background-image:url(TCC_QuickCalc/js/bt_bg.gif); padding-left:10px; padding-right:10  ' class='tooltip'>This  number applies to the student, not parents. If the student filed taxes, enter either: the number on line 37 of IRS Form 1040, or the bottom line on page one of the 1040, or line 21 of form 1040A, or line 4 of form 1040EZ.</td></tr><tr><td><img src='TCC_QuickCalc/js/bt_bottom.gif'></td></tr></table>";

var tooltip3msg="<table width='200' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='TCC_QuickCalc/js/bt_top.gif'></td></tr><tr><td style='background-image:url(TCC_QuickCalc/js/bt_bg.gif); padding-left:10px; padding-right:10' class='tooltip'>Add up the total of cash, checking, savings, and investments (including stocks, bonds, mutual funds, UGMAs, & UTMAs).Do not include retirement assets (IRAS, 401Ks, etc.).</td></tr><tr><td><img src='TCC_QuickCalc/js/bt_bottom.gif'></td></tr></table>";

var tooltip4msg="<table width='200' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='TCC_QuickCalc/js/bt_top.gif'></td></tr><tr><td style='background-image:url(TCC_QuickCalc/js/bt_bg.gif); padding-left:10px; padding-right:10' class='tooltip'>Choose the correct status of the student's custodial parent(s).If the custodial parent is remarried, choose the option 'Married'.</td></tr><tr><td><img src='TCC_QuickCalc/js/bt_bottom.gif'></td></tr></table>";

var tooltip5msg="<table width='200' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='TCC_QuickCalc/js/bt_top.gif'></td></tr><tr><td style='background-image:url(TCC_QuickCalc/js/bt_bg.gif); padding-left:10px; padding-right:10' class='tooltip'>Older parents get a greater allowance, resulting in a lower Expected Family Contribution for college.</td></tr><tr><td><img src='TCC_QuickCalc/js/bt_bottom.gif'></td></tr></table>";

var tooltip6msg="<table width='200' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='TCC_QuickCalc/js/bt_top.gif'></td></tr><tr><td style='background-image:url(TCC_QuickCalc/js/bt_bg.gif); padding-left:10px; padding-right:10' class='tooltip'>Enter adjusted gross income. If the parents filed taxes, enter either: the number on line 37 of IRS Form 1040, or the bottom line on the first page of the 1040, or line 21 on 1040A, or line 4 on 1040EZ.</td></tr><tr><td><img src='TCC_QuickCalc/js/bt_bottom.gif'></td></tr></table>";

var tooltip7msg="<table width='200' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='TCC_QuickCalc/js/bt_top.gif'></td></tr><tr><td style='background-image:url(TCC_QuickCalc/js/bt_bg.gif); padding-left:10px; padding-right:10' class='tooltip'>Enter either: The number on line 57 of IRS From 1040 or line 35 on Form 1040A or line 11 of Form 1040EZ</td></tr><tr><td><img src='TCC_QuickCalc/js/bt_bottom.gif'></td></tr></table>";

var tooltip8msg="<table width='200' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='TCC_QuickCalc/js/bt_top.gif'></td></tr><tr><td style='background-image:url(TCC_QuickCalc/js/bt_bg.gif); padding-left:10px; padding-right:10' class='tooltip'>Enter all untaxed income and benefits including earned income credit, pre-tax contributions to retirement, child support received, etc.</td></tr><tr><td><img src='TCC_QuickCalc/js/bt_bottom.gif'></td></tr></table>";

var tooltip10msg="<table width='200' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='TCC_QuickCalc/js/bt_top1.gif'></td></tr><tr><td style='background-image:url(TCC_QuickCalc/js/bt_bg.gif); padding-left:10px; padding-right:10' class='tooltip'>Enter the market value of your home, but first subtract the debt against it (such as mortgages, liens, or equity lines of credit)</td></tr><tr><td><img src='TCC_QuickCalc/js/bt_bottom1.gif'></td></tr></table>";

var tooltip9msg="<table width='200' border='0' cellspacing='0' cellpadding='0'><tr><td><img src='TCC_QuickCalc/js/bt_top1.gif'></td></tr><tr><td style='background-image:url(TCC_QuickCalc/js/bt_bg.gif); padding-left:10px; padding-right:10' class='tooltip'>	<ul><li class='proTip_hdr'>Include:</li><li>Cash, checking, savings <li>The net value of second homes and rental properties (market value minus debt).<li>Investments such as stocks, bonds, mutual funds, and 529 plans (minus cost of liquidation- capital gains taxes, brokers' fees, etc.).</ul><ul><li class='proTip_hdr'>Don't Include:</li><li>Any retirement assets such as IRAs, 401Ks, etc. <li>Value of your home<li>Stock options you have yet to exercise</ul></td></tr><tr><td><img src='TCC_QuickCalc/js/bt_bottom1.gif'></td></tr></table>";



function btn_calculate_click()
{
 document.frm_calc.submit();
}

function validNum(event) {


if(document.all)
{
var keyCode = (document.layers) ? keyStroke.which : event.keyCode;
if(parseInt(keyCode)==46)
return true;
if((parseInt(keyCode)>=48&&parseInt(keyCode)<=57)==false)
event.keyCode = -1;
}
else
{
 keyCode=event.which;
 if(parseInt(keyCode)==46)
return true;
if(parseInt(keyCode)==8 || parseInt(keyCode)==0)
return true;
else if((parseInt(keyCode)>=48&&parseInt(keyCode)<=57)==false)
    return false;

}}

function setVisibility()
{
 
 //document.getElementById("parentsMaritalStatuslist").value="Divorced";
 document.getElementById("parentsMaritalStatuslist").style.visibility="hidden";
}

function makeVisible()
{
 document.getElementById("parentsMaritalStatuslist").style.visibility="visible";
}

function trapFocus(iname)
{
 document.getElementById("cursorpos").value=iname;
}

function removeFocus()
{
 if(document.getElementById("cursorpos").value!="")
 {
 iname=document.getElementById("cursorpos").value;
 document.getElementById(iname).blur();
 }
}

function setFocus()
{
  if(document.getElementById("cursorpos").value!="")
 {
 iname=document.getElementById("cursorpos").value;
 document.getElementById(iname).focus();
 }
}

function xstooltip_show(tooltipId, parentId, posX, posY)
{
  var newdiv = document.createElement('div');
   newdiv.setAttribute('id', tooltipId);
   newdiv.style.width = 200;
   newdiv.style.position = "absolute";
   newdiv.font="lighter 11px/1.3 Arial,sans-serif";
   
   if(tooltipId=="tooltip1")
   {newdiv.innerHTML = tooltip1msg;}
   else if(tooltipId=="tooltip2")
   {newdiv.innerHTML = tooltip2msg;}
   else if(tooltipId=="tooltip3")
   {newdiv.innerHTML = tooltip3msg;}
   else if(tooltipId=="tooltip4")
   {newdiv.innerHTML = tooltip4msg;}
   else if(tooltipId=="tooltip5")
   {newdiv.innerHTML = tooltip5msg;}
   else if(tooltipId=="tooltip6")
   {newdiv.innerHTML = tooltip6msg;}
   else if(tooltipId=="tooltip7")
   {newdiv.innerHTML = tooltip7msg;}
   else if(tooltipId=="tooltip8")
   {newdiv.innerHTML = tooltip8msg;}
   else if(tooltipId=="tooltip9")
   {newdiv.innerHTML = tooltip9msg;}
   else if(tooltipId=="tooltip10")
   {newdiv.innerHTML = tooltip10msg;}
   


        
        img = document.getElementById(parentId); 
    
        // if tooltip is too wide, shift left to be within parent 
       // if (posX + it.offsetWidth > img.offsetWidth) posX = img.offsetWidth - it.offsetWidth;
       // if (posX < 0 ) posX = 0; 
        
       // alert(posX);
		x = xstooltip_findPosX(img) - posX;
        y = xstooltip_findPosY(img) +posY;
        
       // it.style.top = y + 'px';
       // it.style.left = x + 'px';
	    newdiv.style.left = x + 'px';
     
           newdiv.style.top = y + 'px';


   document.body.appendChild(newdiv);
}

function xstooltip_hide(id)
{
    newdiv = document.getElementById(id);
	if(newdiv) {
     document.body.removeChild(newdiv);
	}
}

function xstooltip_findPosX(obj) 
{
  var curleft = 0;
  if (obj.offsetParent) 
  {
    while (obj.offsetParent) 
        {
            curleft += obj.offsetLeft
            obj = obj.offsetParent;
        }
    }
    else if (obj.x)
        curleft += obj.x;
    return curleft;
}

function xstooltip_findPosY(obj) 
{
    var curtop = 0;
    if (obj.offsetParent) 
    {
        while (obj.offsetParent) 
        {
            curtop += obj.offsetTop
            obj = obj.offsetParent;
        }
    }
    else if (obj.y)
        curtop += obj.y;
    return curtop;
}

function setMaritalStatusName()
{
  var abc = document.getElementById("parentsMaritalStatuslist");
 document.getElementById("parentsMaritalStatusName1").value=abc[abc.selectedIndex].text;	
}