function setBodyBackground(imgName){
	if (document.body){
		document.body.background = "/images/" + imgName;
	}
}

function showComment(id){

    userComment = document.getElementById('addComment'+id);
    if(userComment.style.display == 'block'){
        userComment.style.display = 'none';
        
    }else{
        userComment.style.display = 'block' ;
    }
}

function openWindow(mypage, myname, w, h, features) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+features
	win = window.open(mypage, myname, winprops)
	if (window.focus) {win.focus()}
	return false;
}

//3 functions for select boxes (use form1 as form name)
function getArray(formValue){
	myString = new String (formValue)
	splitString = myString.split(",")
	pop = splitString[0];
	url = splitString[1];
	target = splitString[2];
	features = "width="+splitString[3]+",height="+splitString[4]+",scrollbars="+splitString[5];
	Redirect(pop,url,target,features);
}

function Redirect(pop,url,target,features)
{
	if (pop == 1) {
		window.open(url,'',features);
	} else {
		if (target != 1) {
			location.href = url;
		} else {
			window.open(url)
		}
	}
}

function OpenPage(field) {
	formField = eval("document.form1."+field);
	if (formField.value != 0){
		getArray(formField.value);
	} else {
		alert('Ce choix n\' est pas valide. Essaye à nouveau!');
	}
}