function reset_dep() { document.form.dep.selectedIndex=0; }
function reset_reg() { document.form.region.selectedIndex=0; }
function reset_champ(form_nom, nom) { document.forms[form_nom].elements[nom].value=""; }
function ChangeDep(oForm){ 
	if (oForm.departement.selectedIndex != 0){ location.href = oForm.departement.options[oForm.departement.selectedIndex].value;}
	else {return false;}
}

var newwindow;
function poptastic(url,w,h){newwindow=window.open(url,'permisapoints','height='+h+',width='+w+',scrollbars=yes, resizable=yes');if(window.focus) {newwindow.focus();}}
function popUpIt(title, url, w, h, s, r){var newwindow;newwindow=window.open(url,title,'height='+h+',width='+w+',scrollbars='+s+',resizable='+r+',menubar=no,menubar=no,location=no');if (window.focus) {newwindow.focus();}}

function popAide(url, width, height) {if (url.indexOf("upload") != -1) pop('upload', url, width, height, 'scrollbars=yes,resizable,status');else pop('help', url, width, height, 'scrollbars=yes,resizable');}

function pop(name, url, width, height, options) {opt = 'width=' + width + ',height=' + height; if ( !(arguments.length < 5 || options == null || options == '')) opt = options + ',' + opt; win = window.open(url, name, opt); if (win != null && win != 'null' && win != 'undefined') win.focus();}

function popFiaNet()
{
	var win=window.open('https://www.fia-net.com/certif/certificat.asp?key=5403&lang=fr', 'certificat', 'width=620, height=382', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, resizable=no, dependent=yes');
	if (window.focus) {win.focus();}
}

function Calculette()
{
	var win=window.open('https://www.1euro.com/1euro/calculetteTEG.do?idPartenaire=2655674&montant=', 'certificat', 'width=600, height=500', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, resizable=no, dependent=yes');
	if (window.focus) {win.focus();}
}

/*
function brioude_tag(){
	var id=5291;
	url1='http://www.permisapoints.fr';
	url2='http://www.referencement-2000.com';
	url3='http://www.plusdehits.com';
	if (document.referrer.length > 0) {
		urlreg = '('+url1+'|'+url2+'|'+url3+')';
		hasard = Math.round(Math.random()*10000);
		var refer= escape(document.referrer);
		var tagdebut= '<LINK rel="stylesheet" type="text/css" href="http://stats.ref2000.com/stats.css?idbrioude='+id <http://stats.ref2000.com/stats.css?idbrioude='+id> ;
		tagdebut+='&thereferer=';
		var tagfin ='">';
		var tagmilieu='';
		var pagescript= escape(window.location);
		var page = "&page="+pagescript;
		page+='&hasard=';
		reg1 = /(xml_bi|cpc_bi)/;
		ok2 = reg1.exec(window.location);
		var reg = new RegExp(urlreg,'i');
		ok = reg.exec(document.referrer);
		if ((!ok)&&(!ok2)) {
			document.write(''+tagdebut+refer+tagfin);
		}
	}
}
*/



function prix_maj(cb,prix){
	p = document.getElementById('prix_affiche');
	if(cb.checked)
		p.innerHTML = (prix + 2) + " &euro; TTC";
	else
		p.innerHTML = prix + " &euro; TTC";
	
	return false;
}

function js_addslashes(str)
{
	str = str.replace(/\\/g,"\\\\");
	str = str.replace(/\'/g,"\\'");
	str = str.replace(/\"/g,"\\\"");
	return(str);
}

function hide_element(id,hide_time){
	var elem = (document.getElementById) ? document.getElementById(id) : eval("document.all['"+js_addslashes(id)+"']");
	
	if(elem.style.display)
		elem.style.display = "none";
	
	if(hide_time)
		setTimeout("unhide_element('"+id+"')", 1000*hide_time);
		
	return false;
}

function unhide_element(id){
	var elem = (document.getElementById) ? document.getElementById(id) : eval("document.all['"+js_addslashes(id)+"']");
	
	if(elem.style.display)
		elem.style.display = "";
		
		
	return false;
}

function change_element(id, property, value){
	var elem = (document.getElementById) ? document.getElementById(id) : eval("document.all['"+js_addslashes(id)+"']");

	
	eval("elem.style."+property+" = '" + value + "'");
		
		
	return false;
}