 // 05/20/2005 VZ: localtime calculation adapted to Mozilla browsers
 
function causefocus() {
	var f = document.forms["signin"];
	f.login.focus();
	f.login.select();
	f.resolution.value = '' + screen.width+"/"+screen.height;
	grayout(f.nodepartment, 'department', true );
	grayout(f.noteam, 'team', true );
	grayout(f.nosub, 'subproject', true );
}

function grayout( el, term, nofocus )
{
	var f = el.form.elements[term];
	f.style.backgroundColor = el.checked? "#FFFFFF": "#d8bfd8";
	f.style.color = el.checked? "#000000": "#d8bfd8";
	if (!nofocus) f.focus();
}
function Sendlog()
{
           nw = new Date();
           var t1;
           var t2;
           var t3;
           var t;
           var t0;
           var ampm;
           t0=nw.getHours();
          if (t0>12){
             t0=t0-12;
             ampm=" pm";
              }
          else
             ampm=" am";
             if (t0==12){
                ampm=" pm";
              }

   tt2=""+nw.getMinutes();
   tt3=""+nw.getSeconds();
   tt1=""+t0;
    
   
   if (tt2.length==1) 
        tt2="0"+tt2;
   if (tt3.length==1) 
        tt3="0"+tt3; 

    
    
  tt1+":"+tt2+ampm;
  ddmm=""+(nw.getMonth()+1);

  var year = nw.getYear();
  if (year < 300)
  {
	  year += 1900;
  }

           document.forms[0].localtime.value= ""+ddmm+"/"+nw.getDate()+"/"+year+" "+tt1+":"+tt2+":"+tt3+ampm;
//--------------------           
     //var s;
     //var w=screen.width;
     //var h=screen.height;
     //var p='shortcut.htm';
     //fbs=window.open(p,'shortcut','directories=no,toolbar=no, menubar=no,scrollbars=no,resizable=yes, width='+w*2/3+', height='+h/8+', top='+h/4+' left='+w/4);
}


function vl(th,th2)
{
	// ---- function returns a plural form of the word

	var m = document.getElementById(th2);
	var w = th.value, w1 = w.substr(w.length-1,1), w2 = w.substr(w.length-2,2);
	if (th2 == 'timekeepers') document.getElementById('timekeeper2').innerHTML = w+' ';
	 
	if(w1=='o' | w1=='s' | w1=='x' | w2=='sh' | w2=='ch') 
		w += 'es';
	else if (w1=='f' | w2=='fe')
		w = w.substr(0,w.length-1)+'ves'; 
	else if (w1=='y')
	{
		if(w.toUpperCase()=='ATTORNEY')
			w = 'Attorneys';
		else 
			w = w.substr(0,w.length-1)+'ies';
	}
	else
		w += 's';

	m.innerHTML = w + ' ';
}

function vl2(f, id)
{
	document.getElementById(id).innerHTML = f.value;
}

