﻿﻿function hasNoError(errorMsg) {
	if (document.getElementById('champRecherche').value != '' && document.getElementById('champRecherche').value != errorMsg) {
		return true;
	} else {
		document.getElementById('champRecherche').value = errorMsg;
		document.getElementById('champRecherche').className = "champ motCle";
		document.getElementById('champRecherche').blur();
		return false;
	}
}

function submitSearchBox(errorMsg) {
    //Enforces http request on IE 6  to prevent http security popin
    if( /MSIE 6/i.test(navigator.userAgent) && "https:' == window.location.protocol"  && "http:" != document.searchBoxForm.action.substr(0,5) ){
        document.searchBoxForm.action="http://"+window.location.host+document.searchBoxForm.action;
    }

    if (hasNoError(errorMsg)) {
        document.searchBoxForm.submit();
	}
}   
