/*
'************************************************************************
'*      JavaScript Client Side Functions                                *
'************************************************************************
'*      Copyright (C) Anthony Serfes 2002,2003,2004, 2005,2006,2007	*
'*      All rights reserved.						*
'*      Written by Anthony Serfes (aserfes@optonline.net)               *
'*      CLIENTSIDE.JS                                                   *
'************************************************************************
*/
var now = new Date();

function SetWCBNo()
{
   var StateID = document.form1.AttyState.options[document.form1.AttyState.selectedIndex].value;
   j=form1.CoverageType.length; //alert(j)
	for (i=0; i<j; i++)
        {
		if(form1.CoverageType[i].checked) var CoverageID = form1.CoverageType[i].value;
	}

   if(StateID=="New York")
   {
	 if(CoverageID=="WorkersCompensation")
	 {
		alert("Please Enter a WCB#");
		checkPink(form1.WCBNo);
		document.form1.WCBNo.focus();
		return false;
	 }
   }

}
var currDivObj = null;
function changeDIV() 
{
	var divObj;
	selValue = 0;
	if (document.form1.isDefenseFirm.checked==true)
		selValue = 1;
		
	if(document.all)
		divObj = eval("window.div" + selValue);
	else
		divObj = document.layers["div" + selValue];

	if(document.all)
	{
		if(currDivObj)
		{
			currDivObj.style.display = "none";
		}
	divObj.style.display = "block";
	}
	else 
	{
		if(currDivObj)
		{
			currDivObj.display = "none";
		}
		divObj.display = "block";
	}
	currDivObj = divObj; 
}
function SetState(obj_checkbox, obj_textarea)
    {  if(obj_checkbox.checked)
       { obj_textarea.disabled = false;
       }
       else
       { obj_textarea.disabled = true;
       }
    }

function validateForm() {
	with (document.form1) {
	var alertMsg = "The following REQUIRED fields\nhave been left empty:\n";
	radioOption = -1;
	
	for (counter=0; counter<SRType.length; counter++) 
	{
		if (SRType[counter].checked) radioOption = counter;
	}
	if ((isDefenseFirm.checked==true)&& (DefenseFirm.value == "")) alertMsg += "\nDefense Firm";	if ((isDefenseFirm.checked==true)&& (FirmRepresentative.value == "")) alertMsg += "\nFirm Representative";
	if (radioOption == -1) alertMsg += "\nService Request Type";		
	if (Carrier.value == "") alertMsg += "\nCarrier";
	if (Representative.value == "") alertMsg += "\nRepresentative";
	if (Email.value == "") alertMsg += "\nEmail";
	if (ClaimNumber.value == "") alertMsg += "\nClaim Number";
	if (ClaimantName.value == "") alertMsg += "\nClaimant Name";
	if ((FilmStatus1.value == "" ) && (FilmStatus2.value == "" )) alertMsg += "\nFilm Status";	
	radioOption2 = -1;
	for (counter=0; counter<ClaimantIsRepresented.length; counter++) 
	{
		if (ClaimantIsRepresented[counter].checked) radioOption2 = counter;
	}
	if (radioOption2 == -1) alertMsg += "\nIs Claimant Represented?";
	if (AttyState.value == "None") alertMsg += "\nJurisdiction (St)";
	if (alertMsg != "The following REQUIRED fields\nhave been left empty:\n") {
	alert(alertMsg);
	return false;
	} else {
	return true;
	} } 
}

      function everify(form) {
        if (form.Email.value == "" ||
            form.Email.value.indexOf('@') == -1 ||
            form.Email.value.indexOf('.') == -1 ||
            form.Email.value.length<6) {
         // same for this alert and the focus issue.
          alert("Not a valid e-mail address!");
         form.Email.value="";
         return;
        }
        // uncomment this to submit the form when all validated.
       return true;
      }

      function validate(object,text) {
          if (object.value.length > 0)
              return true;
          else {
              alert(text + ' is required!');
              if (navigator.appName.indexOf('Netscape') > -1) {
                  //object.focus();
              }
              return false;
          }
      }

      function checkPink(myobject) {
      if ((document.all) && (myobject.value==''))
              { myobject.style.backgroundColor='pink' }
              else
              { if (document.all)
                      myobject.style.backgroundColor='white' }
      }

function EnabRadios (val) {
frm=document.forms[0]

	if(val=="RadiologyReview") 
		{frm.FilmStatus1.disabled=false;frm.FilmStatus2.disabled=false}
	else 
		{frm.FilmStatus1.disabled=true;frm.FilmStatus2.disabled=true}

}

function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}

function noenter() 
{
  return !(window.event && window.event.keyCode == 13); 
}

