function SearchBox(field,action,defaultWord)
	{
		if (action == 'focus'){
			if (field.value==defaultWord)
				field.value='';
		}else{
			if (field.value=='')
				field.value=defaultWord;
		}
	}

function UpdateSelect(aValue,aName,FieldName)
 { 

  cont = aValue.length;
  
  var Liste = eval('document.forms[0].'+FieldName);
  
  //Flush le contenu du DDL
  for (i=0;i<Liste.options.length;i++)
  {
   Liste.options[i]=null;        
  }
  
  // Pour une raison inconnue, il reste parfois des items dans le select même après
  // l'Avoir vidé, on recommence la routine et ça le vide pour vrai.
  if (Liste.options.length > 0)
	for (i=0;i<Liste.options.length;i++)
	{
		Liste.options[i]=null;        
	}
 
  //Remplir de DropDown
  for (i=0;i<cont;i++)
  {
   // On n'ajoute pas un item si il est vide.
   if (aName[i] != ""){
	var AddOption = new Option(aName[i],aValue[i]);
	Liste.options[i]=AddOption;
   }
  }
 }
 
 function changeCat(selectValue)
 {
	if (selectValue==214)
		UpdateSelect(arrSubCatIDs214, arrSubCat214, 'selectSubCat');
	else if (selectValue==206)
		UpdateSelect(arrSubCatIDs206, arrSubCat206, 'selectSubCat');
	else if (selectValue==207)
		UpdateSelect(arrSubCatIDs207, arrSubCat207, 'selectSubCat');
	else if (selectValue==208)
		UpdateSelect(arrSubCatIDs208, arrSubCat208, 'selectSubCat');
	else if (selectValue==209)
		UpdateSelect(arrSubCatIDs209, arrSubCat209, 'selectSubCat');
	else{
		if (window.location.toString().indexOf("FR-CA") > -1)
			UpdateSelect(Array(-1, -1), Array('Sous-Cat&eacute;gories', ''), 'selectSubCat');
		else
			UpdateSelect(Array(-1, -1), Array('Sub-Categories', ''), 'selectSubCat');
	}	
 }
 
 
 function coveoSubmit()
 {
	//////////////////////////////////////////////////////////////////////////////
	var coveoSearchAddress = "http://www.cqib.org/pages/recherche.aspx";
	//////////////////////////////////////////////////////////////////////////////
	
	
	// LANGUE
	var coveoLocation = coveoSearchAddress + "?LANG="
	if (window.location.toString().indexOf("EN-CA") > -1)
		coveoLocation += "EN-CA";
	else
		coveoLocation += "FR-CA";
	
	// QUERY
	if (document.forms[0].query.value == "" || document.forms[0].query.value == "Key Word(s)" || document.forms[0].query.value == "Saisir un mot clé")
		coveoLocation += "&q=@uri";
	else	
		coveoLocation += "&q=" + document.forms[0].query.value;
	
	// SYSLANGUAGE FIELD
	if (coveoLocation.indexOf("FR-CA") > -1)
		coveoLocation += " and @syslanguage=french";
	else
		coveoLocation += " and @syslanguage=english";
		
	// REDIRECTION
	window.location.href=coveoLocation;
 }
 
function noenter(key_event) 
{
  checkCoveoSubmit(key_event);  
  return !(keypress_handler(key_event,13)); 
}

function checkCoveoSubmit(key_event)
{
	if (keypress_handler(key_event,13)){
		coveoSubmit();
		return false;
	}
	else
		return true;
}

function keypress_handler(key_event, keyPress) {    
    if (document.all) {
        //Probably Internet Explorer 4 and later
        return (event.keyCode==keyPress)
    }
    else if (document.getElementById) { 
        // Probably Netscape 6 and later
        return (key_event.which==keyPress)
    }
    else if (document.layers) {
        // Probably Netscape 4
        return (key_event.which==keyPress)
    }
    
    return false;
}
