// Fonction de rollover
function rollover_tjs(nom,src) {	
	// nom est le nom de l'image
	// src est l'adresse du fichier d'image
	document.images[nom].src=src;
}

// Fonctions de pr?load
function load() {
	if (document.images) {
		this.length=arguments.length;
		for (var i=0;this.length>i;i++) {
			this[i+1]=new Image();
			this[i+1].src=arguments[i];
		}
	}
}

function getElm(id,doc) {
	if(!doc) doc=document;
  	var elm = null;
  	if (doc.getElementById){
    	elm = doc.getElementById(id);
  	} else {
    	elm = doc.all[id];
  	}
  	return elm;
}

function submitenter(myfield,e) {
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	if (keycode == 13) {
   		myfield.form.submit();
   		return false;
   	} else
   		return true;
}

function genhx() {
	var hx=Math.random();
	hx=hx.toString();
	return hx;
}

function getCookie(name) {
  	var dc = document.cookie;
  	var prefix = name + "=";
  	var begin = dc.indexOf("; " + prefix);
  	if (begin == -1) {
    	begin = dc.indexOf(prefix);
    	if (begin != 0) return null;
  	} else
    	begin += 2;
  	var end = document.cookie.indexOf(";", begin);
  	if (end == -1)
    	end = dc.length;
  	return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name, path, domain) {
  	if (getCookie(name)) {
    	document.cookie = name + "=" +
    	((path) ? "; path=" + path : "") +
    	((domain) ? "; domain=" + domain : "") +
    	"; expires=Thu, 01-Jan-1970 00:00:01 GMT";
  	}
}

function largeur_fenetre() {
 	if (window.innerWidth) return window.innerWidth;
 	else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
 	else return 0;
}
