/*    function isFilled(elm) {
    if (elm.value == "" || elm.value == null)
    return false;
    else return true;
    }
   */ 
  
function chgTerm1(sForm) {
var anyTerm = document.getElementById('any');
anyTerm.checked=false;
}

function chgTerm2(sForm) {
var anyTerm = document.getElementById('any');
anyTerm.checked=false;
}

function chgTerm3(sForm) {
var anyTerm = document.getElementById('any');
anyTerm.checked=false;
}
function chgTerm4(sForm) {
var anyTerm = document.getElementById('any');
anyTerm.checked=false;
}

function chgTerm5(sForm) {
var anyTerm = document.getElementById('any');
anyTerm.checked=false;
}

function chgTerm6(sForm) {
var anyTerm = document.getElementById('any');
anyTerm.checked=false;
}

function chgTerm7(sForm) {
var anyTerm = document.getElementById('any');
anyTerm.checked=false;
}

function chgTermANY(sForm) {
var anyTerm = document.getElementById('any');
 var t1 = document.getElementById('term1');
 var t2 = document.getElementById('term2');
 var t3 = document.getElementById('term3');
 var t4 = document.getElementById('term4');
 var t5 = document.getElementById('term5');
 var t6 = document.getElementById('term6');
 var t7 = document.getElementById('term7');
if (anyTerm.checked=true) { 
t1.checked=false;
t2.checked=false;
t3.checked=false;
t4.checked=false;
t5.checked=false;
t6.checked=false;
t7.checked=false;
}
}

/*
function chgCred1(sForm) {
var eitherCred = document.getElementById('credit3');
var cred2 = document.getElementById('credit2');
cred2.checked = false;
eitherCred.checked=false;
}

function chgCred2(sForm) {
var eitherCred = document.getElementById('credit3');
var cred1 = document.getElementById('credit1');
cred1.checked = false;
eitherCred.checked=false;
}

function chgCred3(sForm) {
var eitherCred = document.getElementById('credit3');
var cred1 = document.getElementById('credit1');
var cred2 = document.getElementById('credit2');
if (eitherCred.checked=true) { 
cred1.checked = false;
cred2.checked = false;
}
}
*/

function isReady(sForm) { // CATALOG SEARCH FORM

//alert('test');  return false;

 CtyChoice = document.sForm.country.selectedIndex
 RegChoice = document.sForm.region.selectedIndex
InstChoice = document.sForm.sponsor.selectedIndex
FOSopt = document.sForm.curric.selectedIndex

//if ( (document.sForm.country[CtyChoice].value != "") &&  (document.sForm.region[RegChoice].value != "") ) {
//alert("Please select either a Country or Continent\n Not both.");
//return false;
//}

   var totalTerm = 8;  //  TERMS AVAIL.
   
 if(document.sForm["term1"].checked == false){ totalTerm -=1; }
 if(document.sForm["term2"].checked == false){ totalTerm -=1; } 
 if(document.sForm["term3"].checked == false){ totalTerm -=1; } 
 if(document.sForm["term4"].checked == false){ totalTerm -=1; }
 if(document.sForm["term5"].checked == false){ totalTerm -=1; } 
 if(document.sForm["term6"].checked == false){ totalTerm -=1; } 
  if(document.sForm["term7"].checked == false){ totalTerm -=1; }
 if(document.sForm["term8"].checked == false){ totalTerm -=1; } 
 
//if(totalTerm == 0){
//alert("Please select at least one USG Sponsor for this program.");
 //return false;
//}

 // THE USER MUST SELECT SOMETHING TO SEARCH
/*
if ( (document.sForm.country[CtyChoice].value == "") &&  (document.sForm.region[RegChoice].value == "") &&  (document.sForm.sponsor[InstChoice].value == "") && (document.sForm.curric[FOSopt].value == "") && (document.sForm.pnum.value == "") && (totalTerm == 0) ) {

		alert("Please select at least one of the following:\n- Location\n- Sponsor\n- Subject\n- Term Available\n- Program number");
	return false;
}     
*/

return true;

}


function chgRegion(sForm) {

var Cty = document.getElementById('country');
var Reg = document.getElementById('region');

if (Cty.selectedIndex != '') {
Reg.selectedIndex = 0;
return false;
}
}

function chgCountry(sForm) {

var Cty = document.getElementById('country');
var Reg = document.getElementById('region');

if (Reg.selectedIndex != '') {
Cty.selectedIndex = 0;
return false;
}
}

function checkAll(showDetails,exby) {

var ckBoxes = document.showDetails.getElementsByTagName("input");

//alert(ckBoxes.length);

  for (i = 0; i < ckBoxes.length; i++)
  ckBoxes[i].checked = exby.checked? true:false
}

// <input type="checkbox" name="all" onClick="checkAll(document.frm_select.reptNum,this)" />

