
function delClient(clientID){

	if (confirm("Etes-vous sūr de vouloir supprimer DEFINITIVEMENT ce client ?" + clientID)) {
		document.location= "delete.Asp?id="+clientID;
	}else{
		return false;
	}

}


function open_when_selected_gestion(valueStr) {
  if(valueStr != "") open_popup('formulaires/gestion.asp?formulaire='+valueStr,'dvdlkgrlkvd6846984sdklsvslfv',500,558);
}

function open_when_selected_garantie(valueStr) {
  if(valueStr != "") open_popup('formulaires/garanties.asp?garantie='+valueStr,'aremaerpiouzefdzw978egr',500,558);
}

function franceselected()
{
this.document.contact_back.postalcode.disabled=true;
this.document.contact_back.postalcode.value="";
this.document.contact_back.postalcode.style.background="#CCCCCC";
if (this.document.contact_back.pays.value=="France")
	{
	this.document.contact_back.postalcode.disabled=false;
	this.document.contact_back.postalcode.style.background="#FFFFFF";
	}
}




function open_when_selected(valueStr) {
  if(valueStr != "") open_popup(valueStr+'.asp','kzru22att987432148azet',540,400);
}

var navName=(navigator.appName).toLowerCase();
	var navVersion=parseFloat(navigator.appVersion)+"";
	var navVersionRight=navVersion.substring(navVersion.indexOf(".")+1,navVersion.length)
	navVersionRight=navVersionRight.substring(0,1)
	if (navVersion.substring(0,navVersion.indexOf("."))=="4" && parseInt(navVersionRight)<6 && navName=="netscape") {
		window.location.href= "n4.asp";
	}



	
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}



function open_popup(v_url, v_name, v_width, v_height) {
	var xMax = screen.width, yMax = screen.height;
	if ((xMax-100) < v_width)
	{
		if ((yMax - 60) < v_height)
		{
			open(v_url,v_name,'scrollbars=yes,width='+(xMax-100)+',height='+(yMax-60)+',screenX=0,screenY=0,top=0,left=0');
		}
		else
		{
		var yOffset = (yMax - v_height)/2;
		local_window= window.open(v_url,v_name,'alwaysRaised=1,scrollbars=yes,width='+(xMax-100)+',height='+v_height+',screenX=0,screenY='+yOffset+',top='+yOffset+',left=0');
		setTimeout("local_window.focus()",250);
		}
	}
	else
	{
		var xOffset = (xMax - v_width)/2;
		if ((yMax - 60) < v_height)
		{
		local_window= window.open(v_url,v_name,'alwaysRaised=1,scrollbars=yes,width='+v_width+',height='+(yMax-60)+',screenX='+xOffset+',screenY=0,top=0,left='+xOffset+'');
		setTimeout("local_window.focus()",250);
		}
		else
	{
		var yOffset = (yMax - v_height)/2;
		local_window= window.open(v_url,v_name,'alwaysRaised=1,scrollbars=no,width='+v_width+',height='+v_height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
		setTimeout("local_window.focus()",250);
		}
	}
}

d=new Date()
//alert(d);
jour=d.getDate()
mois=d.getMonth()+1
maintnt=mois + "/" +jour + "/" +d.getYear()

function verifForm( formToVerify ) {
	 
	
		if ( !isValidMail( formToVerify.email , "Email", "Votre adresse email semble incorrecte" ) )
	   return false;

	
		formToVerify.submit();

}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}




function open_popup(v_url, v_name, v_width, v_height) {
	var xMax = screen.width, yMax = screen.height;
	if ((xMax-100) < v_width)
	{
		if ((yMax - 60) < v_height)
		{
			open(v_url,v_name,'scrollbars=yes,width='+(xMax-100)+',height='+(yMax-60)+',screenX=0,screenY=0,top=0,left=0');
		}
		else
		{
		var yOffset = (yMax - v_height)/2;
		local_window= window.open(v_url,v_name,'alwaysRaised=1,scrollbars=yes,width='+(xMax-100)+',height='+v_height+',screenX=0,screenY='+yOffset+',top='+yOffset+',left=0');
		setTimeout("local_window.focus()",250);
		}
	}
	else
	{
		var xOffset = (xMax - v_width)/2;
		if ((yMax - 60) < v_height)
		{
		local_window= window.open(v_url,v_name,'alwaysRaised=1,scrollbars=yes,width='+v_width+',height='+(yMax-60)+',screenX='+xOffset+',screenY=0,top=0,left='+xOffset+'');
		setTimeout("local_window.focus()",250);
		}
		else
	{
		var yOffset = (yMax - v_height)/2;
		local_window= window.open(v_url,v_name,'alwaysRaised=1,scrollbars=no,width='+v_width+',height='+v_height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
		setTimeout("local_window.focus()",250);
		}
	}
}


function suivant_bleu_hover(objId) {
    document[objId].src = "/images/suivant_bleu_hover.gif";
}

function suivant_bleu(objId) {
    document[objId].src = "/images/suivant_bleu.gif";
}

function suivant_vert_hover(objId) {
    document[objId].src = "/images/suivant_vert_hover.gif";
}

function suivant_vert(objId) {
    document[objId].src = "/images/suivant_vert.gif";
}

function suivant_rose_hover(objId) {
    document[objId].src = "/images/suivant_rose_hover.gif";
}

function suivant_rose(objId) {
    document[objId].src = "/images/suivant_rose.gif";
}




function up_hover(objId) {
    document[objId].src = "/images/up_hover.gif";
}

function up_bleu(objId) {
    document[objId].src = "/images/up_bleu.gif";
}

function up_rouge(objId) {
    document[objId].src = "/images/up_rouge.gif";
}

function open_window(v_url, v_name, v_width, v_height) {
     if (screen.width < 800)
     {
	open(v_url,v_name,'scrollbars=yes,width='+v_width+',height='+v_height+',screenX=0,screenY=0,top=0,left=0');
     }
     else
     {
     	var xMax = screen.width, yMax = screen.height;
     	var xOffset = (xMax - v_width)/2, yOffset = (yMax - v_height)/2;
    	local_window=window.open(v_url,v_name,'alwaysRaised=1,scrollbars=yes,width='+v_width+',height='+v_height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
		setTimeout("local_window.focus()",250);
     }
 }
 
function lib_bwcheck(){
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()

function getWindowSize() {
	var DOM  = (document.getElementById) ? 1 : 0;
	var NS4  = (document.layers) ? 1 : 0;
	var NSx  = (parseInt(navigator.appVersion)>4 && navigator.appName=='Netscape')?1:0;
	var IE4  = (document.all) ? 1 : 0;
	var IEx  = (document.all && DOM) ? 1 : 0;
	var ret  = new Array();
	ret['w'] = 0;
	ret['h'] = 0;
	
	if (NS4 || NSx) {
		ret['w'] = window.innerWidth;
		ret['h'] = window.innerHeight;
	} else if(IEx) {
		ret['w']  = document.body.offsetWidth;
		ret['h']  = document.body.offsetHeight;
	} else {
		with(top.document) {
		ret['w'] = body.offsetWidth >0?body.offsetWidth:0;
		ret['h'] = body.offsetHeight>0?body.offsetHeight:0;
		}
	}
	ret['w'] -= 0;//5;
	ret['h'] -= 0;//6;
	return ret;
}

function largeurEcran()
{

	if (bw.ie5 || bw.ie6)
	{
		largeur = document.body.offsetWidth;
		//alert(largeur);
	}
	else if (bw.ns4 || bw.ns6)
	{
		largeur = window.innerWidth;
	}
	else if (bw.ie4)
	{
	window.resizeTo(800,600);
	largeur = 800;
	}
return largeur;
}

function placeDiv(Div,Left)
{
	
	var largeur=0;
	var largeurTMP = largeurEcran();
	largeur = largeurTMP;
// la taille soustraite de largeur doit etre celle du site, ici 776 pixels 
	largeur = Math.ceil(((largeur - 666)/2));
	
	var pix=0;
	pix=(bw.ie5 && !bw.mac)?-11:(bw.ie6)?+2:(bw.ns6)?+13:(bw.ie5 && bw.mac)?0:(bw.ns4 && bw.mac)?-10:(bw.ns4)?-9:(bw.ie4)?-14:0;
	if (largeur+pix<8 && !(bw.ie4)){
	largeur=0;
	pix=0;
	}
	if(largeurTMP < 790)
	{
		pix = 13;
	}
	
	if (bw.dom) {
	document.getElementById(Div).style.left = Left+(largeur+pix) + "px";
	document.getElementById(Div).style.visibility = "hidden";
	} else if (bw.ns4) {
	document.layers[Div].left = Left+largeur+pix;
	document.layers[Div].visibility = "hidden";
	} else if (bw.ie4) {
	document.all[Div].style.left= Left+largeur+pix;
	document.all[Div].style.visibility = "hidden";
	}
}



function show(id)
{
	
	if (bw.dom) {
	document.getElementById(id).style.visibility = "visible";
	} else if (bw.ns4) {
	document.layers[id].document.layers[id].visibility = "visible";
	} else if (bw.ie4) {
	document.all[id].style.visibility = "visible";
	}
}

function hide(id)
{
	
	if (bw.dom) {
	document.getElementById(id).style.visibility = "hidden";
	} else if (bw.ns4) {
	document.layers[id].document.layers[id].visibility = "hidden";
	} else if (bw.ie4) {
	document.all[id].style.visibility = "hidden";
	}
}

function swap(id, img_src) {

x = document.getElementById(id);
x.src = img_src;
}

function changeColour1(name) {
document.getElementById(name).style.backgroundColor='#79799b';
}
function changeColour2(name) {
document.getElementById(name).style.backgroundColor='#ffffff';
}

function rollover(nomimage,nomfichier,divname) {
	if (document.layers && divname != '') {
		eval("document.layers." + divname + ".document.images['" + nomimage + "'].src = '" + nomfichier + "';");
	} else {
		document.images[nomimage].src = nomfichier;
	}
}