
<!--
function NewWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=yes';
	url=''
	if (mypage=='do_recherche_libre') {	
		search_value=document.form1.recherche_libre.value;
		search_value=escape(search_value);
		if (search_value==""){
			alert("Veuillez saisir votre critere de recherche");
			document.form1.recherche_libre.focus();
		} else {
			url = mypage+'?search='+search_value;}
	
	} else {
	
		url = mypage
	
	}
	
	if (url!=""){
	
		win = window.open(url, myname, winprops);
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}
	
}


function openSubscribeForm() {
    NewWindow('inscription_user', 'inscription_user', 490, 560, 'yes');
}


function validLogin() {
    document.loginForm.login.value = document.loginForm.__ac_name.value;
    document.loginForm.password.value = document.loginForm.__ac_password.value;
    document.loginForm.submit();
}


//-----------------------------------------------------------------------------
// Soumettre le formulaire de recherche libre avec la touche "Entrée"
//-----------------------------------------------------------------------------

// flag pour le focus du champ texte de la recherche libre
isFocusSearch = false;
// flag pour le focus des champs texte du formulaire de login
isFocusLogin = false;

// detecter la touche "Entrée"
IE5 = document.all? 1:0;
// doit capturer l'événement si NS6.0 et NS4.0+ 
if (!IE5) {
    document.captureEvents(Event.KEYPRESS);
}
// quand une touche est tapée, éxecuter la fonction testKey()
document.onkeypress = testKey;

function testKey(e) {
    // obtenir le code ASCII de la touche tapée
    whKey = !IE5? e.which:event.keyCode;
    
    // si le focus est sur le champ texte de la recherche libre
    if (whKey == 13 && isFocusSearch) {
        // ouvrir le popup de recherche libre
        NewWindow('do_recherche_libre','name','600','570','yes');
    }
    
    // si le focus est sur les champs texte du formulaire de login
    if (whKey == 13 && isFocusLogin) {
        // valider le formulaire de login
        validLogin();
    }
}


function xt_clic(typecl,section,page,url,nvlle)
{
Xt_r = document.referrer;
Xt_h = new Date();
xt_img = new Image();
Xt_i = 'http://logi7.xiti.com/hit.xiti?s=145609&s2='+section;
Xt_i += '&p='+page+'&clic='+typecl+'&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
if(parseFloat(navigator.appVersion)>=4)
{Xiti_s=screen;Xt_i += '&r=' + Xiti_s.width + 'x' + Xiti_s.height + 'x' + Xiti_s.pixelDepth + 'x' + Xiti_s.colorDepth;}
Xt_i += '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$');
xt_img.src = Xt_i;
if ((url != null)&&(url!=undefined))
{ if ((nvlle=='')||(nvlle==null)) { document.location = url;} else {xfen = window.open(url,'xfen',''); xfen.focus();}}
else
{return;}
}


//-------------------------------------------------------------------
// isCodePostal(value)
//   Returns true if value is a code postal
//-------------------------------------------------------------------
function isDigit(value) {
        if (value.length>1){return false;}
        var string="1234567890";
        if (string.indexOf(value)!=-1){;return true;}
        return false;
        }

function isCodePostal(val){
        if (val=='' | val.length!=5){return false;}
        for(var i=0;i<val.length;i++){
                if(!isDigit(val.charAt(i))){return false;}
                }
        return true;
        }

function printDocument() {
    querystring = '';
    if (document.location.search) {
        querystring += document.location.search;
    } else {
        querystring += '?';
    }
    querystring += '&imprimer=1';

    NewWindow(document.location.pathname + querystring,'name','660','730','yes');
}
//-->
