function go_externe(lien){
        document.location.href=lien
}

function go_page(page, id){
	document.location.href=page+".php?id="+id;
}

function go_page_insertion(page, insert){
	document.location.href=page+".php?insert="+insert;
}

function go_page_annuaire(page, annua){
	document.location.href=page+".php?annua="+annua;
}

function go_page_presc_produit(page, aNumeroPrescripteur_Produit){
	document.location.href=page+".php?aNumeroPrescripteur_Produit="+aNumeroPrescripteur_Produit;
}

function limite(zone,max) 
{ 
		if(zone.value.length>=max){zone.value=zone.value.substring(0,max);} 
} 

function limite_2champs(champs_tap, champs2 ,max) 
{ 
		var total =document.getElementById(champs_tap).value.length + document.getElementById(champs2).value.length;
		if(total>max){
			alert ("Svp, pas plus 80 caracteres pour votre nom d'insertion complet");
			document.getElementById(champs_tap).value = document.getElementById(champs_tap).value.substring(0, document.getElementById(champs_tap).value.length - 1);
		} 
} 

function limiteur1(elt, show, longueur)
{
		maximum = longueur;
		champ = elt;
		
		if (champ.value.length > maximum)
		champ.value = champ.value.substring(0, maximum);
		else
		document.getElementById(show).value = maximum - champ.value.length;
}



function MAJUSCULE(elt){
		elt.value=elt.value.toUpperCase();
}

function NOM_PROPRE(elt){
		var st = "";
		var valeur = elt.value;
		var mots = new Array();
		mots = valeur.split(" ");
		for (var i in mots){
			st += " " + mots[i].charAt(0).toUpperCase() + mots[i].substring(1).toLowerCase();
			}
		st = st.substr(1)
		elt.value = st;
}

function AFFICHE(qui){
		if(document.getElementById(qui).style.display=='none'){
			document.getElementById(qui).style.display='';
		}
		else{
			document.getElementById(qui).style.display='none';}
}

function popForm(formurl, titre, width, height) {
	var formWin = window.open(formurl,titre,'location=0,menubar=1,status=1,scrollbars=1,resizable=1,width='+ width +',height='+ height +'');
}

function load_recherche(){
		$("#type_produit").load("inc/type_produit_inc.php");	
}


function reload_recherche(elt){
	st = elt.value;
	st = escape(st);
	if(st!=""){
		$("#sous_salon").load("inc/sous_salon_inc.php?tSalonNum="+st+"");
		$("#type_produit").load("inc/type_produit_inc.php?tSalonNum="+st+"");
	} else {
		$("#sous_salon").load("inc/empty_inc.php");
		$("#type_produit").load("inc/type_produit_inc.php");
	}
	
}


function reload_salon(elt, loader){
	st = elt.value;
	st = escape(st) 
	if(st!=""){
		$("#"+loader).load("inc/sous_salon_inc.php?tSalonFra="+st+"");
	} else {
		$("#"+loader).load("inc/empty_inc.php");
	}
	
}