function backgroundImage(objDiv, strUtrl)
{
	objDiv.style.backgroundImage = "url(" + strUtrl + ")" ; 
}

function popup_centered(strUrl, strName, intWidth, intHeight, strOptions, blnReplace)
{
	//~ strSpecs details
	//~ channelmode=yes|no|1|0  	Whether or not to display the window in theater mode. Default is no
	//~ directories=yes|no|1|0 	Whether or not to add directory buttons. Default is yes
	//~ fullscreen=yes|no|1|0 	Whether or not to display the browser in full-screen mode. Default is no. A window in full-screen mode must also be in theater mode
	//~ height=pixels 	The height of the window. Min. value is 100
	//~ left=pixels 	The left position of the window
	//~ location=yes|no|1|0 	Whether or not to display the address field. Default is yes
	//~ menubar=yes|no|1|0 	Whether or not to display the menu bar. Default is yes
	//~ resizable=yes|no|1|0 	Whether or not the window is resizable. Default is yes
	//~ scrollbars=yes|no|1|0 	Whether or not to display scroll bars. Default is yes
	//~ status=yes|no|1|0 	Whether or not to add a status bar. Default is yes
	//~ titlebar=yes|no|1|0 	Whether or not to display the title bar. Ignored unless the calling application is an HTML Application or a trusted dialog box. Default is yes
	//~ toolbar=yes|no|1|0 	Whether or not to display the browser toolbar. Default is yes
	//~ top=pixels 	The top position of the window
	//~ width=pixels 	The width of the window. Min. value is 100
	var top = (screen.height - intHeight) / 2 ;
	var left = (screen.width - intWidth) / 2 ;
	var strSpecs = "top=" + top + ",left=" + left + ",width=" + intWidth + ",height=" + intHeight + "," + strOptions ;
	window.open(strUrl, strName, strSpecs, blnReplace) ;
}

function checkFormIsFull(strFormId, strErrorMessageContainerId, strErrorMessage)
{
	var objForm = document.getElementById(strFormId) ;
	var result = true ;
	var i ;
	var strCurrentElementName = "" ;
	var strPreviousElementName = "" ;

	//debug
	//~ result = false ;
	//~ alert(objForm.length) ;

	for (i = 0 ; i < objForm.length ; i++)
	{
		//debug
		//~ alert(objForm.elements[i].type) ;

		if (objForm.elements[i].type == "text")
		{
			//
		}
		else if (objForm.elements[i].type == "checkbox")
		{
			//
		}
		else if (objForm.elements[i].type == "radio")
		{
			strCurrentElementName = objForm.elements[i].name ;
			if (strCurrentElementName != strPreviousElementName && strCurrentElementName != strDerniereQuestion)
			{
				strPreviousElementName = strCurrentElementName ;

				if (radioInputIsEmpty(objForm.elements[i]))
				{
					result = false ;

					if (strReponsesVides != "")
					{
						strReponsesVides = strReponsesVides + ", " ;
					}
					strReponsesVides = identifieLesReponsesVides(strReponsesVides, objForm.elements[i].name, arrQuestions) ;
				}
			}
		}
		else if (objForm.elements[i].type == "textarea")
		{
			strCurrentElementName = objForm.elements[i].name ;
			if (strCurrentElementName != strPreviousElementName && strCurrentElementName != strDerniereQuestion)
			{
				strPreviousElementName = strCurrentElementName ;

				if (textareaInputIsEmpty(objForm.elements[i]))
				{
					result = false ;

					if (strReponsesVides != "")
					{
						strReponsesVides = strReponsesVides + ", " ;
					}
					strReponsesVides = identifieLesReponsesVides(strReponsesVides, objForm.elements[i].name, arrQuestions) ;
				}
			}
		}
		else if (objForm.elements[i].type == "hidden")
		{
			//
		}
		else if (objForm.elements[i].type == "password")
		{
			//
		}
		else if (objForm.elements[i].type == "file")
		{
			//
		}
		else if (objForm.elements[i].type == "image")
		{
			//
		}
		else if (objForm.elements[i].type == "button")
		{
			//
		}
		else if (objForm.elements[i].type == "reset")
		{
			//
		}
		else if (objForm.elements[i].type == "submit")
		{
			//
		}
	}

	if (result == false)
	{
		var objErrorMessageContainer = document.getElementById(strErrorMessageContainerId) ;
		objErrorMessageContainer.innerHTML = "" ;
		objErrorMessageContainer.innerHTML = strErrorMessage + "<br />\n" + strReponsesVides ;
		window.scrollTo(0, 0) ;
	}

	return result ;
}

function identifieLesReponsesVides(strReponsesVides, strNomDuChampReponse, arrArray)
{
	for (strItem in arrArray)
	{
		if (strNomDuChampReponse == strItem)
		{
			strReponsesVides = strReponsesVides + arrArray[strItem] ;
			break ;
		}
	}

	return strReponsesVides ;
}

function radioInputIsEmpty(objRadioInput)
{
	var strName = objRadioInput.name ;

	var arrRadioInput = document.getElementsByName(strName) ;

	var result = true ;
	var i ;

	for (i = 0 ; i < arrRadioInput.length ; i++)
	{
		if (arrRadioInput[i].checked == true)
		{
			result = false ;
		}
	}

	return result ;
}

function checkboxInputIsEmpty(objCheckboxInput)
{
	var strName = objCheckboxInput.name ;

	var arrCheckboxInput = document.getElementsByName(strName) ;

	var result = true ;
	var i ;

	for (i = 0 ; i < arrCheckboxInput.length ; i++)
	{
		if (arrCheckboxInput[i].checked == true)
		{
			result = false ;
		}
	}

	return result ;
}

function textareaInputIsEmpty(objTextareaInput)
{
	if (objTextareaInput.value == "")
	{
		return true ;
	}
	else
	{
		return false ;
	}
}

function updateInstantStats(strUrl)
{
	new Ajax.Updater('instant_stats', strUrl, {
		method: 'get', encoding: 'iso-8859-1'
	});
}

function logLiveCheckout(strUrl)
{
	new Ajax.Updater('logging', strUrl, {
		method: 'get', encoding: 'iso-8859-1'
	});
}

function logRecordedCheckout(strUrl)
{
	new Ajax.Updater('logging', strUrl, {
		method: 'get', encoding: 'iso-8859-1'
	});
}



/**
 * ATTENTION
 * les fonctions ci-dessous ont une implémentation spécifique d'un projet à l'autre et ne doivent pas être copiées / collées d'un projet à l'autre
 */

var arrQuestions = new Array() ;

arrQuestions["question_1"] = "question 1" ;
arrQuestions["question_2"] = "question 2" ;
arrQuestions["question_3"] = "question 3" ;
arrQuestions["question_4"] = "question 4" ;
arrQuestions["question_5"] = "question 5" ;
arrQuestions["question_6"] = "question 6" ;
arrQuestions["question_7"] = "question 7" ;
arrQuestions["question_8"] = "question_8" ;
arrQuestions["question_9"] = "question_9" ;

var strDerniereQuestion = "question_9" ;
