﻿// JScript File

function linkover(id)
{
    img = document.getElementById(id);
    img.src="../images/home/arrow_orange.gif";
}
        
function linkout(id)
{
    img = document.getElementById(id);
    img.src="../images/global/transparent_9x11.gif";
}


function ClientValidate(source, arguments)
{
    arguments.IsValid = false;
	
    //var chkList1 = document.getElementById("cblPositions");
    
    //var arrayOfCheckBoxes= chkList1.getElementsByTagName("input");
    
    var arrayOfCheckBoxes= document.getElementsByTagName("input");
	
    for(var i=0;i<arrayOfCheckBoxes.length;i++)
    {
        if(arrayOfCheckBoxes[i].checked == true)
        {
            arguments.IsValid = true;
        }
    }
}

function getFieldValue(field)
{
   switch(field.type)
   {
      case "text" :
      case "textarea" :
      case "password" :
      case "hidden" :
         return field.value;

      case "select-one" :
         var i = field.selectedIndex;
         if (i == -1)   return "";
         else   return (field.options[i].value == "") ? field.options[i].text : field.options[i].value;

      case "select-multiple" :
         var allChecked = new Array();
         for(i = 0; i < field.options.length; i++)
            if(field.options[i].selected)
               allChecked[allChecked.length] = (field.options[i].value == "") ? field.options[i].text : field.options[i].value;
         return allChecked;

      case "button" :
      case "reset" :
      case "submit" :
         return "";

      case "radio" :
      case "checkbox" :
         if (field.checked) { return field.value; } else { return ""; }
      default :
         if(field[0].type == "radio")
         {
            for (i = 0; i < field.length; i++)
               if (field[i].checked)
                  return field[i].value;

            return "";
         }
         else if(field[0].type == "checkbox")
         {
            var allChecked = new Array();
            for(i = 0; i < field.length; i++)
               if(field[i].checked)
                  allChecked[allChecked.length] = field[i].value;

            return allChecked;
         }
         else
            var str = "";
            for (x in field) { str += x + "\n"; }
            alert("I couldn't figure out what type this field is...\n\n" + field.name + ": ???\n\n\n" + str + "\n\nlength = " + field.length);
         break;
   }
   
   return "";
}
