function funAdjChckBox(fld, i) {	
	if (i == "Tous" || i == "All") { 
		if (fld[0].checked == true) { 
			for (j = 1; j < fld.length; j++) 
			fld[j].checked = false;
   		}
	}
	else  {  fld[0].checked = false; }
}

function funVerifyDropDownList( fld, errMsg ) {
	var i = "";
	var nbrOfVal = fld.length;
	var valOk = true;

	if ( fld.selectedIndex == 0 ) {
    // the user did not make a selection
    	valOk = false;
		alert( errMsg );
	}

	return valOk;
}

function funVerifyChckBox( fld, errMsg ) {
	var i = "";
	var nbrOfVal = fld.length;
	var valOk = false;

	for ( i = 0; i < nbrOfVal; i ++ ) {
		if ( fld[i].checked == true ) {
		// the user selected at least one value
			valOk = true;
			break;
		}
	}

	if ( valOk == false ) {
		alert( errMsg );
	}
	
	return valOk;
}

function funOpenWindow( tUrl ) {
// Open a printable version of a document
	if(tUrl != "") {
		window.open(tUrl);
	}
}

function funRedirect( tUrl ) {
// Open a printable version of a document
	if(tUrl != "") {
		window.location.href(tUrl);
	}
}

function funSwitchLang( AltnLang ) {
// Switch to the alternate language
	if(AltnLang != "") {
		parent.window.location = AltnLang;
	}
}

function funReplaceTwistieAlt( lang ) {
// This is to overwrite the default English (only) alt text for the twisties
	var images = document.images;
	var imgSource;

	for (i=0;i<images.length;i++) {
		imgSource = images[i].src.toLowerCase();
		if ( imgSource.indexOf('triangle-bl.gif') > -1 ) {
			if ( lang == "fr" ) {
				images[i].alt = "Condenser / Détailler";
			}
			else {
				images[i].alt = "Collapse/Expand";
			}
		}
	}
}

