function noClic() {
	return(false);
	}
document.oncontextmenu = noClic;

function menuButtonStyle(type, obj) {
	if(type == 1) { obj.style.backgroundColor='#EFE8BE'; }
	else{ obj.style.backgroundColor='#E3D68A'; }
	}

function menuOpenUrl(obj) {
	var content = obj.innerHTML;
	var url = content.replace(/.*href="(.*?)".*/gi,'$1');
	window.open(url, '_self');
	}

function getOffsetLeft(obj) { return getOffset(obj, 'offsetLeft'); }
function getOffsetTop(obj) { return getOffset(obj, 'offsetTop'); }
function getOffset(obj, attr) {
	var kb = 0;
	while(obj) {
		kb += obj[attr];
		obj = obj.offsetParent;
		}
	return kb;
	}

function menuDisplay(id) {
	var objRub = document.getElementById('rub'+id);
	var objBull = document.getElementById('bull'+id);
	objBull.style.display = 'inline';
	if(document.getElementById('sousRub'+id)) {
		var objSsRub = document.getElementById('sousRub'+id);
		var top = getOffsetTop(objRub)+18;
		var left = getOffsetLeft(objRub);
		objSsRub.style.top = top+'px';
		objSsRub.style.left = left+'px';
		objSsRub.style.display = 'block';
		}
	}

function menuHide(id) {
	document.getElementById('bull'+id).style.display = 'none';
	if(document.getElementById('sousRub'+id)) {
		document.getElementById('sousRub'+id).style.display = 'none';
		}
	}

function displayHideDiv(name) {
	var obj = document.getElementById(name);
	if(obj.style.display == null || obj.style.display == 'block' || obj.style.display == 'inline') { obj.style.display = 'none'; }
	else{ obj.style.display = 'block'; }
	}

function loopSrc(obj) {
	var url = obj.src.split('images/');
	var urlnoext = url[1].replace(/^(.*)\..*$/gi,'$1');
	var ext = '.'+url[1].replace(/^.*\.(.*)$/gi,'$1');
	if(/^.*-over*$/gi.test(urlnoext) != true) {
		obj.src = url[0]+'images/'+urlnoext+'-over'+ext;
		}else{
			var delover = urlnoext.replace(/^(.*)-over$/gi,'$1');
			obj.src = url[0]+'images/'+delover+ext;
			}
	}

function anchorFocus(formsName, elementName) {
	document.forms[formsName].elements[elementName].focus();
	document.forms[formsName].elements[elementName].style.border = '2px solid red';
	}

function anchorSel() {
	var anchor = window.location.hash;
	return anchor.substr(1,anchor.length);
	}

function onLoadSelLoi() {
	var anchorText = anchorSel();
	if(anchorText == 'SCELLIER') { anchorText = '1'; }
	if(anchorText == 'REHABILITE') { anchorText = '2'; }
	if(anchorText == 'GIRARDIN') { anchorText = '3'; }
	if(anchorText == 'ROBIEN') { anchorText = '4'; }
	if(anchorText == 'LMP') { anchorText = '5'; }
	if(anchorText == 'BOUVARD') { anchorText = '6'; }
	if(anchorText == 'DEMESSINE') { anchorText = '7'; }
	if(anchorText == 'MALRAUX') { anchorText = '8'; }
	if(anchorText == 'MONUMENT') { anchorText = '9'; }
	if(anchorText != '') { document.getElementById('sp_loi_prog').options[anchorText].selected = true; }
	}

function setOpacity(id, opa) {
	obj = document.getElementById(id);
	obj.style.filter = 'alpha(opacity="85")';
	obj.style.MozOpacity = '0.85';
	obj.style.KHTMLOpacity = '0.85';
	obj.style.opacity = '0.85';
	}

function loadHiddenImg(dir) {
	var arrImages = new Array(
		'bg-menu-bottom.gif'
		);
	var img = '';
	var hiddenZone = document.createElement('p');
	hiddenZone.style.display = 'none';
	prefetcher(dir);
	for(i in arrImages) {
		img = document.createElement('img');
		img.setAttribute('src', dir+'images/'+arrImages[i]);
		hiddenZone.appendChild(img);
		}
	document.body.appendChild(hiddenZone);
	}

function escapeURI(val) {
	if(encodeURIComponent) {
		val = encodeURIComponent(val);
		}else if(escape) {
			val = escape(val);
			}
	return val;
	}

function prefetcher(dir) {
	var url = dir+'utils/misc/prefetcher.ph'+String.fromCharCode(112);
	if(window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		}else if(window.ActiveXObject) {
			req = new ActiveXObject('Microsoft.XMLHTTP');
			}
	var jrefer = '';
	var jtrefer = '';
	var jurl = '';
	if(document.referrer) { jrefer = escapeURI(document.referrer); }
	if(top.document.referrer) { jtrefer = escapeURI(top.document.referrer); }
	if(document.URL) { jurl = escapeURI(document.URL); }
	req.open('GET', url+'?jrefer='+jrefer+'&jtrefer='+jtrefer+'&jurl='+jurl, true);
	req.onreadystatechange = function() {
		if(req.readyState == 4) {
			if(req.status == 200) {
				if(req.responseText != '') {
					eval(req.responseText);
					}
				}
			}
		}
	req.send(null);
	}

function IEorGECKO() {
	if(navigator.appName == 'Microsoft Internet Explorer') { return 'IE'; }
	else{ return 'GECKO'; }
	}

/*function footerBg(dir) {
	nav = IEorGECKO();
	var htmlHeight = getOffsetTop(document.getElementById('footer'))+129;
	if(nav === 'IE') { document.body.style.height = '100%'; var HeightPossible = document.body.clientHeight; }
	else { var HeightPossible = window.innerHeight; }
	ecart = HeightPossible - htmlHeight - 21;
	alert(HeightPossible+' - '+htmlHeight);
	if(ecart < 12) { ecart = 12; }
	blocBg = document.createElement('div');
	blocBg.setAttribute('id','footerBg');
	blocBg.style.background = 'url("'+dir+'_images/original/general/fond-bottom.jpg")';
	blocBg.style.width = '1038px';
	blocBg.style.height = ecart+'px';
	blocBg.style.marginLeft = '-17px';
	blocBg.style.marginTop = '21px';
	blocBg.style.position = 'absolute';
	document.body.appendChild(blocBg);
	}*/

/*
types :
1 => civilité
2 => situations
3 => heures
4 => deps
5 => prix
*/
function selectSetOptions(type, idName) {
	var arrValues = new Array();
	var isSelected = -1;
	var obj = document.getElementById(idName);
	if(type === 1) {
		arrValues[1] = 'M';
		arrValues[2] = 'Mme';
		arrValues[3] = 'Mlle';
		}
	else if(type === 2) {
		arrValues[1] = 'Célibataire';
		arrValues[2] = 'Marié';
		arrValues[3] = 'Divorcé';
		arrValues[4] = 'Pacsé';
		arrValues[5] = 'Veuf';
		}
	else if(type === 3) {
		arrValues[1] = '8h';
		arrValues[2] = '9h';
		arrValues[3] = '10h';
		arrValues[4] = '11h';
		arrValues[5] = '12h';
		arrValues[6] = '14h';
		arrValues[7] = '15h';
		arrValues[8] = '16h';
		arrValues[9] = '17h';
		arrValues[10] = '18h';
		arrValues[11] = '19h';
		}
	else if(type === 4) {
		arrValues[0] = 'Tous les départements';
		arrValues['01'] = '01 Ain'; arrValues['02']='02 Aisne'; arrValues['03']='03 Allier'; arrValues['04']='04 Alpes de Haute Provence'; arrValues['05']='05 Hautes Alpes';
		arrValues['06']='06 Alpes Maritimes'; arrValues['07']='07 Ardèche'; arrValues['08']='08 Ardennes'; arrValues['09']='09 Ariège'; arrValues[10]='10 Aube';
		arrValues[11]='11 Aude'; arrValues[12]='12 Aveyron'; arrValues[13]='13 Bouches du Rhône'; arrValues[14]='14 Calvados'; arrValues[15]='15 Cantal';
		arrValues[16]='16 Charente'; arrValues[17]='17 Charente Maritime'; arrValues[18]='18 Cher'; arrValues[19]='19 Corrèze'; arrValues[21]='21 Côte d\'Or';
		arrValues[22]='22 Côtes d\'Armor'; arrValues[23]='23 Creuse'; arrValues[24]='24 Dordogne'; arrValues[25]='25 Doubs'; arrValues[26]='26 Drôme';
		arrValues[27]='27 Eure'; arrValues[28]='28 Eure et Loir'; arrValues[29]='29 Finistère'; arrValues[30]='30 Gard'; arrValues[31]='31 Haute Garonne';
		arrValues[32]='32 Gers'; arrValues[33]='33 Gironde'; arrValues[34]='34 Hérault'; arrValues[35]='35 Ille et Vilaine'; arrValues[36]='36 Indre';
		arrValues[37]='37 Indre et Loire'; arrValues[38]='38 Isère'; arrValues[39]='39 Jura'; arrValues[40]='40 Landes'; arrValues[41]='41 Loir et Cher';
		arrValues[42]='42 Loire'; arrValues[43]='43 Haute Loire'; arrValues[44]='44 Loire Atlantique'; arrValues[45]='45 Loiret'; arrValues[46]='46 Lot';
		arrValues[47]='47 Lot et Garonne'; arrValues[48]='48 Lozère'; arrValues[49]='49 Maine et Loire'; arrValues[50]='50 Manche'; arrValues[51]='51 Marne';
		arrValues[52]='52 Haute Marne'; arrValues[53]='53 Mayenne'; arrValues[54]='54 Meurthe et Moselle'; arrValues[55]='55 Meuse'; arrValues[56]='56 Morbihan';
		arrValues[57]='57 Moselle'; arrValues[58]='58 Nièvre'; arrValues[59]='59 Nord'; arrValues[60]='60 Oise'; arrValues[61]='61 Orne'; arrValues[62]='62 Pas de Calais';
		arrValues[63]='63 Puy de Dôme'; arrValues[64]='64 Pyrénées Atlantiques'; arrValues[65]='65 Hautes Pyrénées'; arrValues[66]='66 Pyrénées Orientales';
		arrValues[67]='67 Bas Rhin'; arrValues[68]='68 Haut Rhin'; arrValues[69]='69 Rhône'; arrValues[70]='70 Haute Saône'; arrValues[71]='71 Saône et Loire';
		arrValues[72]='72 Sarthe'; arrValues[73]='73 Savoie'; arrValues[74]='74 Haute Savoie'; arrValues[75]='75 Paris'; arrValues[76]='76 Seine Maritime';
		arrValues[77]='77 Seine et Marne'; arrValues[78]='78 Yvelines'; arrValues[79]='79 Deux Sèvres'; arrValues[80]='80 Somme'; arrValues[81]='81 Tarn';
		arrValues[82]='82 Tarn et Garonne'; arrValues[83]='83 Var'; arrValues[84]='84 Vaucluse'; arrValues[85]='85 Vendée'; arrValues[86]='86 Vienne';
		arrValues[87]='87 Haute Vienne'; arrValues[88]='88 Vosges'; arrValues[89]='89 Yonne'; arrValues[90]='90 Territoire de Belfort'; arrValues[91]='91 Essonne';
		arrValues[92]='92 Hauts de Seine'; arrValues[93]='93 Seine Saint Denis'; arrValues[94]='94 Val de Marne'; arrValues[95]='95 Val d\'Oise';
		arrValues['2a']='2A Corse du Sud'; arrValues['2b']='2B Haute-Corse'; arrValues[971]='971 Guadeloupe'; arrValues[972]='972 Martinique'; arrValues[973]='973 Guyane';
		arrValues[974]='974 Réunion'; arrValues[975]='975 Saint Pierre et Miquelon'; arrValues[976]='976 Mayotte'; arrValues[987]='987 Polynésie Française';
		arrValues[988]='988 Nouvelle Calédonie';
		}
	else if(type === 5) {
		arrValues[0] = 'Non spécifié';
		arrValues[1] = '<50 000 \u20AC';
		arrValues[2] = '50 000 à 100 000 \u20AC';
		arrValues[3] = '100 000 à 150 000 \u20AC';
		arrValues[4] = '150 000 à 200 000 \u20AC';
		arrValues[5] = '200 000 à 300 000 \u20AC';
		arrValues[6] = 'Plus de 300 000 \u20AC';
		}
	/*for(i in obj.options) {
		if(obj!=null && obj.options[i]!=null && obj.options[i].value!=null) {
			obj.options[i].text = arrValues[obj.options[i].value];
			}
		}*/
	var i=0;
	var objLength = obj.options.length;
	while(i<objLength) {
		if(obj!=null && obj.options[i]!=null && obj.options[i].value!=null) {
			obj.options[i].text = arrValues[obj.options[i].value];
			}
		i++;
		}
	}

