
function OpenWin(URL,width,height,nom)
{
	window.open(URL,nom,"toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=" + width + ",height=" + height + ",resizable=no");
}

function OpenWin2(URL,width,height,nom)
{
	window.open(URL,nom,"toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=" + width + ",height=" + height + ",resizable=yes");
}

function ProductAlert(Prod_ID,racine){
	
	theQueryString = window.location.search;
	if (theQueryString == "")
		theQueryString += '?prodid=' + Prod_ID;
	else
		theQueryString += '&prodid=' + Prod_ID;
	
	var theURL
		theURL = racine + '/achat/produit_alertes.php' + theQueryString
		
		window.open(theURL,'new','height=310,width=300,resizable=no,menubar=0')
}	

function QteStockAlerte(quantite,stock){

if (quantite > stock) {

alert("Attention, la quantité demandée est supérieure au stock disponible.\nStock disponilble. : "+ stock +".");

window.location.reload();

}

}

function limiteur(ValMax)
{
maximum = ValMax;
champ = document.entryform.description;
indic = document.entryform.indicateur;

if (champ.value.length > maximum)
  champ.value = champ.value.substring(0, maximum);
else 
  indic.value = maximum - champ.value.length;
}

function limiteur500()
    {
    maximum = 500;
    champ = document.entryform.activite;
    indic = document.entryform.indicateur500;

    if (champ.value.length > maximum)
      champ.value = champ.value.substring(0, maximum);
    else 
      indic.value = maximum - champ.value.length;
    }
function limiteur1500()
    {
    maximum = 1500;
    champ = document.entryform.experience;
    indic = document.entryform.indicateur1500;

    if (champ.value.length > maximum)
      champ.value = champ.value.substring(0, maximum);
    else 
      indic.value = maximum - champ.value.length;
    }
    


    
//Sert à faire des liste déroulantes dépendantes    
function gestion_list() {
	if (emploi_form.typeemploi.selectedIndex != 0) {
		emploi_form.newemploi.disabled = true;
		document.getElementById("newemploi").style.backgroundColor = '#CCCCCC';		
		//emploi_form.newemploi.value = true;
	}else {
		emploi_form.newemploi.disabled = false;
		document.getElementById("newemploi").style.backgroundColor = '#F4F4F4';	
		//emploi_form.newemploi.value = true;
	}
}

function gestion_list_annuaire() {
	if (entryform.specialite1.selectedIndex != 0) {
	//alert(entryform.specialite1.selectedIndex);
		entryform.new_specialite.disabled = true;
		document.getElementById("new_specialite").style.backgroundColor = '#CCCCCC';
		//emploi_form.newemploi.value = true;
	}else {
		entryform.new_specialite.disabled = false;
		document.getElementById("new_specialite").style.backgroundColor = '#F4F4F4';
		//emploi_form.newemploi.value = true;
	}
}

