// JavaScript Document

function isIE()
{
	var ie = document.all;
	if (ie!=null){
		return "";
	}else{
		return "color='#FFFFFF'";
	}
}


function isNN()
{
	var nn4 = document.layers;
	var nn6 = document.getElementById && !document.all;
	if(nn4!=null){
		return true;
	} else if(nn6!=null){
		return true;
	} else{
		return false;
	}
}


function resetForm(formName)
{
	window.document.forms(formName).reset();
}


function submitForm(formName)
{
	window.document.forms(formName).submit();
}


function submitForm(formName,actionFile)
{
	window.document.forms(formName).submitTo.value=actionFile;
	window.document.forms(formName).action=actionFile.concat(".jsp");
	window.document.forms(formName).submit();
}


function goBack()
{
	history.back();
}


function submitThis(form)
{
	document.forms[0].method="get";
	document.forms[0].submit();
}


function setfocus()
{
// kludge required to avoid not going to the top of the page (applies to p5.jsp and onwards);
if (document.forms[0] != null && 
    document.forms[0].name != "transferableSkillsForm" && 
    document.forms[0].name != "reviewForm")
{
  if (document.forms[0] != null && document.forms[0].elements != null)
  {
    for(var i=0; i< document.forms[0].elements.length; i++)
    {
      if(document.forms[0].elements[i].type != 'hidden')
      {
       document.forms[0].elements[i].focus();
       break;
      }
    }
  }
}
}



function uncheckAll()
{
  if (document.forms[0] != null && document.forms[0].elements != null)
  {
    for(var i=0; i< document.forms[0].elements.length; i++)
    {
      if(document.forms[0].elements[i].type != 'checkbox')
      {
        document.forms[0].elements[i].checked = false;
        alert('unchecked elem ' + i);
      }
    }
  }
}

