function CouleurdeFond(e) {
	document.getElementById(e).style.background = "#DBDEED";
}
function CouleurdeFondBlanc(e) {
	document.getElementById(e).style.background = "#FFFFFF";
}

function updateFormCoul(Id)
{
	cptidcoul = document.theForm.cptidcoul.value;
	for (i=1; i<=cptidcoul; i++) {
		if (i != Id)
			eval("document.theForm.check"+i+".checked = false");
	}
}

function updateFormInter(Id)
{
	cptidinterdeb = document.theForm.cptidinterdeb.value;
	cptidinterfin = document.theForm.cptidinterfin.value;
	for (i=cptidinterdeb; i<=cptidinterfin; i++) {
		if (i != Id)
			eval("document.theForm.check"+i+".checked = false");
	}
}

function updateMainForm(Id)
{
	n = 1;
	url = "";

	for (i=1; i<200; i++) {
		if (eval("document.theForm.check"+i) != null) {
			if (eval("document.theForm.check"+i+".value") != "") {
				url += "&id" + n + "=" + eval("document.theForm.id"+i+".value");
				n++;
			}
		}
		else
			break;
	}

	if (document.theForm.PrimeCasseStandard != null) {
		url += "&PrimeCasseStandard="	+ document.theForm.PrimeCasseStandard.checked;
		url += "&PrimeNegocieeMontant="	+ document.theForm.PrimeNegocieeMontant.value;
	}
	if (document.theForm.PrimeCasseSpecifique != null) {
		url += "&PrimeCasseSpecifique=" + document.theForm.PrimeCasseSpecifique.checked;
		url += "&PrimeCasseMontant="	+ document.theForm.PrimeCasseMontant.value;
		url += "&PrimeCasseNbAnnees="	+ document.theForm.PrimeCasseNbAnnees.value;
	}

	window.parent.document.getElementById('choixoption').src = "choixoption.asp?Id=" + Id + url;
}

function uncheck (i)
{
	if (i==1) {
		if (document.theForm.PrimeCasseStandard != null) {
			if (document.theForm.PrimeCasseStandard.checked && document.theForm.PrimeCasseSpecifique != null) {
				document.theForm.PrimeCasseSpecifique.checked = false;
			}
		}
	}

	if (i==2) {
		if (document.theForm.PrimeCasseSpecifique != null) {
			if (document.theForm.PrimeCasseSpecifique.checked && document.theForm.PrimeCasseStandard != null) {
				document.theForm.PrimeCasseStandard.checked = false;
			}
		}
	}
}

function updateForm(Id)
{
	n = 1;
	url = "";

	for (i=1; i<200; i++) {
		if (eval("document.theForm.check"+i) != null) {
			if (eval("document.theForm.check"+i+".checked")) {
				eval ("window.parent.document.theForm.check"+i+".value = '1'");
				url += "&id" + n + "=" + eval("document.theForm.id"+i+".value");
				n++;
			}
			else
				eval ("window.parent.document.theForm.check"+i+".value = ''");
		}
		else
			break;
	}

	if (document.theForm.PrimeCasseStandard != null) {
		url += "&PrimeCasseStandard="	+ window.parent.document.theForm.PrimeCasseStandard.checked;
		url += "&PrimeNegocieeMontant="	+ window.parent.document.theForm.PrimeNegocieeMontant.value;
	}
	if (document.theForm.PrimeCasseSpecifique != null) {
		url += "&PrimeCasseSpecifique=" + window.parent.document.theForm.PrimeCasseSpecifique.checked;
		url += "&PrimeCasseMontant="	+ window.parent.document.theForm.PrimeCasseMontant.value;
		url += "&PrimeCasseNbAnnees="	+ window.parent.document.theForm.PrimeCasseNbAnnees.value;
	}

	window.parent.document.getElementById('choixoption').src = "choixoption.asp?Id=" + Id + url;
}
function CheckOption()
{
	for (i=1; i<200; i++) {
		if (eval("window.parent.document.theForm.check"+i) != null) {
			if (eval("window.parent.document.theForm.check"+i+".value") != "") {
				eval ("document.theForm.check"+i+".checked = 1");
			}
			else
				eval ("document.theForm.check"+i+".checked = 0");
		}
		else
			break;
	}
}

function CheckPrime () {
	if (document.theForm.PrimeCasseSpecifique != null) {
		document.theForm.PrimeCasseSpecifique.checked = document.theForm.PrimeCasseStandard.checked;
	}
}

function UpdatePrix (Total, FraisMiseEnRoute, Co2, MakeDesc, PrimeNegocieeMontant, PrimeCasseStandard, PrimeCasseSpecifique, PrimeCasseMontant) {
	url = "displayautoprix.asp?Total=" + Total + "&FraisMiseEnRoute=" + FraisMiseEnRoute + "&Co2=" + Co2 + "&MakeDesc=" + MakeDesc + "&PrimeNegocieeMontant=" + PrimeNegocieeMontant + "&PrimeCasseStandard=" + PrimeCasseStandard + "&PrimeCasseSpecifique=" + PrimeCasseSpecifique + "&PrimeCasseMontant=" + PrimeCasseMontant;
	window.parent.frames['prix'].location.href = url;
}
function AdjustOption (iframeWindow, maxHeight) {
	height = iframeWindow.document.body.scrollHeight;
	if (height<80)
		height = 80;
	if (height>maxHeight)
		height = maxHeight;
	document.getElementById ('choixoption').height = height;
}
function AdjustPaneau (iframeWindow, maxHeight) {
	height = iframeWindow.document.body.scrollHeight;
	if (height>maxHeight)
		height = maxHeight;
	document.getElementById ('paneau').height = height;
}
function AdjustPrix (iframeWindow, maxHeight) {
	height = iframeWindow.document.body.scrollHeight;
//	if (height>maxHeight)
//		height = maxHeight;
	document.getElementById ('prix').height = height;
}

function OngletOption (Id) {
	document.getElementById('options-ul').style.backgroundImage='url(img/bt-3choix1.jpg)';
	frames['paneau'].location.href = 'displayautopt.asp?Id=' + Id;
	ScrollSmall ();
}
function OngletEquip (Id) {
	document.getElementById('options-ul').style.backgroundImage='url(img/bt-3choix2.jpg)';
	frames['paneau'].location.href = 'displayautoequip.asp?Id=' + Id;
	ScrollSmall ();
}
function OngletTech (Id) {
	document.getElementById('options-ul').style.backgroundImage='url(img/bt-3choix3.jpg)';
	frames['paneau'].location.href = 'displayautotech.asp?Id=' + Id;
	ScrollSmall ();
}

function ScrollBig () {
	document.getElementById('paneau').height = document.getElementById('paneau').contentWindow.document.body.scrollHeight;
	document.getElementById('ScrollBig').style.display		= "none";
	document.getElementById('ScrollSmall').style.display	= "block";
}
function ScrollSmall () {
	height = document.getElementById('paneau').contentWindow.document.body.scrollHeight;
	if (height>550)
		height = 550;
	document.getElementById('paneau').height = height;
	document.getElementById('ScrollBig').style.display		= "block";
	document.getElementById('ScrollSmall').style.display	= "none";
}

function HoverInfos (msg) {
	overlib (msg, CENTER, WIDTH,250, CELLPAD,5,15, FGCOLOR,'#FEFECC', TEXTSIZE,'11px', BORDER,1);
}
function HoverOptions (msg) {
	overlib (msg, LEFT, ABOVE, WIDTH,250, CELLPAD,5,15, FGCOLOR,'#FEFECC', TEXTSIZE,'11px', BORDER,1);
}
function HoverFrance (msg) {
	overlib (msg, LEFT, ABOVE, WIDTH,250, CELLPAD,5,15, FGCOLOR,'#FEFECC', TEXTSIZE,'11px', BORDER,1);
}