function session_check()
{
	new Ajax.Request('/session_check.php',
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded'
	});
	
	setTimeout("session_check()",600000);
}

function getElementsByName_iefix(tag, name) 
{
	var elem=document.getElementsByTagName(tag);
	var arr=new Array();
	for(i=0,iarr=0; i < elem.length; i++) 
	{
		att=elem[i].getAttribute("name");
		if(att == name) 
		{
			arr[iarr]=elem[i];
			iarr++;
		}
	}
	return arr;
}

function userFavorite(userSource, userDest, div)
{
	if (div == null)
		div = 'userFavorite';
		
	new Ajax.Request('/site/_ajax_user_favorite.php?userSource='+userSource+'&userDest='+userDest,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function filmFan(user, film)
{
	new Ajax.Request('/appli/cinema/_ajax_film_fan.php?user='+user+'&film='+film,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$('listeFan').innerHTML = reponse.responseText;
	}
}

function coverALaUneGenerator(obj,div)
{
	new Ajax.Request('/site/_ajax_cover_a_la_une.php?obj='+obj,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function VideoGenerator(obj,div,mode,objRestrict)
{
	if (mode == null)
		mode = 'sortie';
		
	new Ajax.Request('/appli/cinema/_ajax_ba.php?obj='+obj+'&mode='+mode+'&div='+div+'&objrestrict='+objRestrict,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function detailGenerator(obj,div,mode)
{
	if (mode == null)
		mode = 'sortie';
		
	new Ajax.Request('/tournament/_ajax_detail.php?obj='+obj+'&mode='+mode,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function cwSetWinner(obj,div,mode)
{
	if (mode == null)
		mode = 'sortie';
		
	new Ajax.Request('/tournament/_ajax_cw_set_winner.php?obj='+obj+'&mode='+mode,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function editDetailGenerator(table,tournoi,adversaire1,adversaire2,div)
{
	new Ajax.Request('/tournament/_ajax_edit.php?table='+table+'&tournoi='+tournoi+'&adversaire1='+adversaire1+'&adversaire2='+adversaire2,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure : ' + '/tournament/_ajax_edit.php?table='+table+'&tournoi='+tournoi);}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function dvdthequeAdd(user, film)
{
	new Ajax.Request('/appli/dvdtheque/_ajax_assoc_film.php?user='+user+'&film='+film,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$('listeDvdtheque').innerHTML = reponse.responseText;
	}
}

function acteurFan(user, acteur)
{
	new Ajax.Request('/appli/cinema/_ajax_acteur_fan.php?user='+user+'&acteur='+acteur,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$('listeFan').innerHTML = reponse.responseText;
	}
}

function delVuNote(film)
{
	new Ajax.Request('/appli/cinema/_ajax_del_vu_note.php?film='+film,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$('a_la_une').innerHTML = reponse.responseText;
	}
}

function baALaUne(ba)
{
	new Ajax.Request('/appli/cinema/_ajax_ba_a_la_une.php?ba='+ba,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$('a_la_une').innerHTML = reponse.responseText;
	}
}

function baALaUneIndex(ba)
{
	new Ajax.Request('/appli/cinema/_ajax_ba_a_la_une_index.php?ba='+ba,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$('a_la_une_index').innerHTML = reponse.responseText;
	}
}

function filmDel(film)
{
	new Ajax.Request('/appli/cinema/_ajax_film_del.php?film='+film,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$('del').innerHTML = reponse.responseText;
	}
}

function filmType(film,type)
{
	new Ajax.Request('/appli/cinema/_ajax_film_type.php?film='+film+'&type='+type,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$('type').innerHTML = reponse.responseText;
	}
}

function baDel(ba)
{
	new Ajax.Request('/appli/cinema/_ajax_ba_del.php?ba='+ba,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$('del').innerHTML = reponse.responseText;
	}
}

function baba(ba)
{
	new Ajax.Request('/appli/cinema/_ajax_ba_ba.php?ba='+ba,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$('ba').innerHTML = reponse.responseText;
	}
}

function actionUser(user,div)
{
	new Ajax.Request('/site/_ajax_action_user.php?user='+user+'&mode='+div,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function coverAff(cov,div)
{
	if (div == null)
		div = 'cov';
	
	new Ajax.Request('/site/_afc.php?cov='+cov,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function addCom(objet,mode)
{
	var txt='';
	if ($('texte_com'))
	{
		txt = encodeURIComponent($('texte_com').value);
		$('texte_com').value = '';
	}
	var auteur='';
	if ($('auteur'))
		auteur = $('auteur').value;
	var vote='';
	if ($('vote'))
		vote = $('vote').value;
	
	
	new Ajax.Request('/site/_ajax_add_com.php?objet='+objet+'&texte='+txt+'&vote='+vote+'&mode='+mode,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){}
	});
	
	function ok(reponse)
	{
		$('com').innerHTML = reponse.responseText;
		$('texte_com').innerHTML = '';
	}
}

function notifDel(notif)
{
	new Ajax.Request('/site/notification_ajax_del.php?id='+notif,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){}
	});
	
	function ok(reponse)
	{
		if (reponse.responseText == 'ok')
			$('notif'+notif).style.display = 'none';
	}
}


function addForumMsg(id)
{
	var txt = encodeURIComponent($('texte_comCritique').value);
	
	$('boutonSub').style.display = 'none';
	$('boutonSubLoading').style.display = '';
	
	new Ajax.Request('/tournament/_ajax_forum_msg_add.php?id='+id+'&texte='+txt,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function()
		{
			alert('failure');
		}
	});
	
	function ok(reponse)
	{
		$('listeCritique').innerHTML = reponse.responseText;
		$('texte_comCritique').value = '';
		$('boutonSub').style.display = '';
		$('boutonSubLoading').style.display = 'none';
	}
}


function filmNote(film, note)
{
	$('divNote'+note).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" />';
	
	new Ajax.Request('/appli/cinema/_ajax_film_note.php?film='+film+'&note='+note,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){}
	});
	
	function ok(reponse)
	{
		$('divNote').innerHTML = reponse.responseText;
	}
}


function groupeAdhere(grp,user)
{
	new Ajax.Request('/groupe/_ajax_adhere.php?grp='+grp+'&user='+user,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){}
	});
	
	function ok(reponse)
	{
		$('adhererep').innerHTML = reponse.responseText;
	}
}

function addMsg(grp)
{
	var txt = encodeURIComponent($('texte').value);
	var auteur = $('auteur').value;
	var titre = encodeURIComponent($('titre').value);
	var global_sess_id_temp = $('global_sess_id_temp').value;
	var reponse = $('reponse').value;
	 
	
	function fail()
	{
		alert('failure');
	}
	
	function ok(reponse)
	{
		$('blk_forum').innerHTML = reponse.responseText;
		$('texte').value = '';
		$('titre').value = 'Titre';
		$('textarea').style.display = 'none';
	}
	
	//Si sujet et pas de titre
	if (!reponse && !titre)
	{
		alert('Vous devez saisir un titre.');
	}
	else
	{
		new Ajax.Request('/groupe/_ajax_msg_add.php?grp='+grp+'&texte='+txt+'&auteur='+auteur+'&titre='+titre+'&global_sess_id_temp='+global_sess_id_temp+'&reponse='+reponse,
		{
			method: 'get',
			asynchronous: true,
			contentType: 'application/x-www-form-urlencoded',
			onSuccess: ok,
			onFailure: fail
		});
	}
}

function detailSujet(id)
{
	function fail()
	{
		alert('failure');
	}
	
	function ok(reponse)
	{
		$('blk_forum').innerHTML = reponse.responseText;
		$('textarea').style.display = 'none';
		$('blkAddSujet').style.display = 'none';
	}
	
	new Ajax.Request('/groupe/_ajax_sujet_detail.php?id='+id,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: fail
	});
}

function listeSujet(id)
{
	function fail()
	{
		alert('failure');
	}
	
	function ok(reponse)
	{
		$('blk_forum').innerHTML = reponse.responseText;
		$('textarea').style.display = 'none';
		$('blkAddSujet').style.display = 'block';
		$('reponse').value = '';
	}
	
	new Ajax.Request('/groupe/_ajax_sujet_liste.php?id='+id,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: fail
	});
}

function detailGroupePhoto(id)
{
	function fail()
	{
		alert('failure');
	}
	
	function ok(reponse)
	{
		$('detailPhoto').innerHTML = reponse.responseText;
	}
	
	$('detailPhoto').innerHTML = '<img src="/template/alldivx/images_addon/loading2.gif" />';
	$('detailPhoto').style.display = 'block';
	
	new Ajax.Request('/groupe/_ajax_photo_detail.php?id='+id,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: fail
	});
}

function groupeGaleriePhoto(grp,deb,fin)
{
	function fail()
	{
		alert('failure');
	}
	
	function ok(reponse)
	{
		$('galeriePhoto').innerHTML = reponse.responseText;
	}
	
	if ($('pageGaleriePhoto'))
		$('pageGaleriePhoto').innerHTML = '<img src="/template/alldivx/images_addon/loading2.gif" />';
	
	new Ajax.Request('/groupe/_ajax_photo_galerie.php?grp='+grp+'&deb='+deb+'&fin='+fin,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: fail
	});
}

function groupeGalerieCover(grp,deb,fin)
{
	function fail()
	{
		alert('failure');
	}
	
	function ok(reponse)
	{
		$('galerieCover').innerHTML = reponse.responseText;
	}
	
	if ($('pageGalerieCover'))
		$('pageGalerieCover').innerHTML = '<img src="/template/alldivx/images_addon/loading2.gif" />';
	
	new Ajax.Request('/groupe/_ajax_cover_galerie.php?grp='+grp+'&deb='+deb+'&fin='+fin,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: fail
	});
}

function detailGroupeActeur(id)
{
	function fail()
	{
		alert('failure');
	}
	
	function ok(reponse)
	{
		$('detailActeur').innerHTML = reponse.responseText;
	}
	
	$('detailActeur').innerHTML = '<img src="/template/alldivx/images_addon/loading2.gif" />';
	$('detailActeur').style.display = 'block';
	
	new Ajax.Request('/groupe/_ajax_acteur_detail.php?id='+id,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: fail
	});
}

function addFilm()
{
	var synopsis = encodeURIComponent($('synopsis').value);
	var nom = $('nom').value;
	
	function ok(reponse)
	{
		$('blk_select').innerHTML = reponse.responseText;
		$('blk_add_film').style.display = 'none';
	}
	
	if (nom != '' && synopsis != '')
	{
		new Ajax.Request('/critique/_ajax_film_add.php?synopsis='+synopsis+'&nom='+nom,
		{
			method: 'get',
			asynchronous: true,
			contentType: 'application/x-www-form-urlencoded',
			onSuccess: ok,
			onFailure: function(){}
		});
	}
	else
	{
		alert('Le nom et le synopsis doivent etre remplis.');
	}
}

function fondAff(num)
{
	new Ajax.Request('/site/_afcf.php?fd='+num,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){}
	});
	
	function ok(reponse)
	{
		$('fond').innerHTML = reponse.responseText;
	}
}

function addComFond(fd)
{
	var txt = encodeURIComponent($('texte_com').value);
	var auteur = $('auteur').value;
	
	new Ajax.Request('/site/_ajax_fond_com.php?fond='+fd+'&texte='+txt+'&auteur='+auteur,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){}
	});
	
	function ok(reponse)
	{
		$('com').innerHTML = reponse.responseText;
	}
}

function addComFond2(fd)
{
	var txt = encodeURIComponent($('texte_com').value);
	var auteur = $('auteur').value;
	var vote = $('vote').value;
	
	new Ajax.Request('/site/_ajax_fond_com2.php?fd='+fd+'&texte='+txt+'&auteur='+auteur+'&vote='+vote,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){}
	});
	
	function ok(reponse)
	{
		$('com').innerHTML = reponse.responseText;
		$('texte_com').innerHTML = '';
	}
}

function afficheCoverAssocGroupe(cover)
{
	var groupe = $('comboGroupe').value;
	
	$('groupe').innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/groupe/_ajax_cover_assoc.php?cover='+cover+'&groupe='+groupe,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){}
	});
	
	function ok(reponse)
	{
		$('groupe').innerHTML = reponse.responseText;
	}
}

function afficheCoverAssocFilm(cover)
{
	var film = $('comboFilm').value;
	
	$('film').innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_cover_assoc.php?cover='+cover+'&film='+film,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$('film').innerHTML = reponse.responseText;
	}
}

function cinenewsAssocFilm(news)
{
	var film = $('comboFilm').value;
	
	$('film').innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_cinenews_assoc.php?news='+news+'&film='+film,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$('film').innerHTML = reponse.responseText;
	}
}

function mytopfilmAssocFilm(div,film,ordre,lastfilm,i)
{	
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/mytopfilm/_ajax_assoc_film.php?film=' + film + '&ordre=' + ordre + '&lastfilm=' + lastfilm + '&i=' + i,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function mytopfilmFilmSearch(txt,div,hid,text,divid,i,lastfilm)
{
	if (div == null)
		div = 'search';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 50px;" alt="" title="" />';
	
	new Ajax.Request('/appli/mytopfilm/_ajxFilmSearch.php?texte='+txt+'&div='+div+'&hid='+hid+'&text='+text+'&divid='+divid+'&i='+i+'&lastfilm='+lastfilm,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML =  '<a href="javascript:onOff(\'' + div + '\',0);" class="apparent7" style="float: right;">x Fermer</a><br />' + reponse.responseText;
		
	}
}

function mysexyactressAssocFilm(div,acteur,ordre,lastacteur,i)
{	
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/mysexyactress/_ajax_assoc_acteur.php?acteur=' + acteur + '&ordre=' + ordre + '&lastacteur=' + lastacteur + '&i=' + i,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function mytopacteurAssocFilm(div,acteur,ordre,lastacteur,i)
{	
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/mytopacteur/_ajax_assoc_acteur.php?acteur=' + acteur + '&ordre=' + ordre + '&lastacteur=' + lastacteur + '&i=' + i,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function mysexyactressActeurSearch(txt,div,hid,text,divid,i,lastacteur)
{
	if (div == null)
		div = 'search';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 50px;" alt="" title="" />';
	
	new Ajax.Request('/appli/mysexyactress/_ajxActeurSearch.php?texte='+txt+'&div='+div+'&hid='+hid+'&text='+text+'&divid='+divid+'&i='+i+'&lastacteur='+lastacteur,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML =  '<a href="javascript:onOff(\'' + div + '\',0);" class="apparent7" style="float: right;">x Fermer</a><br />' + reponse.responseText;
		
	}
}

function mytopacteurActeurSearch(txt,div,hid,text,divid,i,lastacteur)
{
	if (div == null)
		div = 'search';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 50px;" alt="" title="" />';
	
	new Ajax.Request('/appli/mytopacteur/_ajxActeurSearch.php?texte='+txt+'&div='+div+'&hid='+hid+'&text='+text+'&divid='+divid+'&i='+i+'&lastacteur='+lastacteur,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML =  '<a href="javascript:onOff(\'' + div + '\',0);" class="apparent7" style="float: right;">x Fermer</a><br />' + reponse.responseText;
		
	}
}


function filmSearch(txt,div,hid,text,divid,i,lastfilm)
{
	if (div == null)
		div = 'search';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 50px;" alt="" title="" />';
	
	new Ajax.Request('/appli/mytopflop/_ajxFilmSearch.php?texte='+txt+'&div='+div+'&hid='+hid+'&text='+text+'&divid='+divid+'&i='+i+'&lastfilm='+lastfilm,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML =  '<a href="javascript:onOff(\'' + div + '\',0);" class="apparent7" style="float: right;">x Fermer</a><br />' + reponse.responseText;
		
	}
}

function mytopflopAssocFilm(div,film,ordre,lastfilm,i)
{	
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/mytopflop/_ajax_assoc_film.php?film=' + film + '&ordre=' + ordre + '&lastfilm=' + lastfilm + '&i=' + i,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function filmAssocActeur(film)
{
	var acteur = $('comboActeur').value;
	
	$('wait').innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 0px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_acteur_assoc.php?acteur='+acteur+'&film='+film,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$('acteur').innerHTML = reponse.responseText;
		$('wait').innerHTML = '';
	}
}

function acteurAssocFilm(acteur)
{
	var film = $('comboFilm').value;
	
	$('wait').innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 0px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_acteur_assoc_film.php?acteur='+acteur+'&film='+film,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$('listeFilm').innerHTML = reponse.responseText;
		$('wait').innerHTML = '';
	}
}


function appliCinefriendSendInvit(user,div,wait,texte)
{
	var txt = encodeURIComponent($(texte).value);
	
	$(wait).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 0px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinefriend/_ajax_send_invit.php?texte='+txt+'&user='+user+'&div='+div,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		//alert(reponse.responseText);
		$(div).innerHTML = reponse.responseText;
	}
}



function superquizAssocFilm(superquiz)
{
	var film = $('comboFilm').value;
	
	$('film').innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_superquiz_assoc.php?superquiz='+superquiz+'&film='+film,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$('film').innerHTML = reponse.responseText;
	}
}

function afficheWallAssocFilm(wall)
{
	var film = $('comboFilm').value;
	
	$('film').innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_wall_assoc.php?wall='+wall+'&film='+film,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$('film').innerHTML = reponse.responseText;
	}
}

function userSearch(txt,div,hid,text,mode)
{
	if (div == null)
		div = 'search';
	if (hid == null)
		hid = 'autreUserId';
	if (text == null)
		text = 'autreUser';
	if (mode == null)
		mode = '';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 50px;" alt="" title="" />';
	
	new Ajax.Request('/site/_ajxUserSearch.php?texte='+txt+'&div='+div+'&hid='+hid+'&text='+text+'&mode='+mode,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function delMi(id)
{
	$('imgDel'+id).innerHTML = '<br /><img src="/template/alldivx/images_addon/loading3.gif" alt="" title="" />';
	
	new Ajax.Request('/messagerie/_ajxMiDel.php?id='+id,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){}
	});
	
	function ok(reponse)
	{
		$('mi').innerHTML = reponse.responseText;
	}
}



function repMi(id)
{
	var txt = encodeURIComponent($('texte_com').value);
	var auteur = $('auteur').value;
	
	$('boutonMi').style.display = 'none';
	$('boutonMiLoading').style.display = '';
	 
	new Ajax.Request('/messagerie/_ajxMiRep.php?id='+id+'&auteur='+auteur+'&texte='+txt,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){}
	});
	
	function ok(reponse)
	{
		$('mi').innerHTML = reponse.responseText;
		$('boutonMi').style.display = '';
		$('boutonMiLoading').style.display = 'none';
	}
}

function groupeManageUser(act,user,grp,extra)
{
	function fail()
	{
		alert('failure');
	}
	
	function ok(reponse)
	{
		$('comboUser').innerHTML = reponse.responseText;
	}
	
	$('comboUser').innerHTML = '<img src="/template/alldivx/images_addon/loading2.gif" />';
	
	new Ajax.Request('/groupe/_ajax_user_manage.php?act='+act+'&user='+user+'&grp='+grp+'&extra='+extra,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: fail
	});
}


function ajaxConfigNotif(value,notif)
{
	function fail()
	{
		alert('failure');
	}
	
	function ok(reponse)
	{
		$('configNotifspan').innerHTML = ' - Ok -';
	}
	
	new Ajax.Request('/site/_ajax_config_notif.php?value='+value+'&notif='+notif,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: fail
	});
}

function fake(user,div)
{
	function fail()
	{
		alert('failure');
	}
	
	function ok(reponse)
	{
		$('fake'+div).innerHTML = 'ok';
	}
	
	new Ajax.Request('/profil/_ajxFake.php?id='+user,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: fail
	});
}



function felicitation(user,auteur,fel)
{
	new Ajax.Request('/site/_ajax_user_felicitation.php?user='+user+'&auteur='+auteur+'&fel='+fel,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$('felicitation').innerHTML = reponse.responseText;
	}
}

function cinemaGeneratePic(pic,div,type,value)
{
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 50px 0px 0px 0px;" />';
	
	new Ajax.Request('/appli/cinema/_ajax_generate_pic.php?pic='+pic+'&type='+type+'&value='+value,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function delPic(pic,div,type,value)
{
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 50px 0px 0px 0px;" />';
	
	new Ajax.Request('/appli/cinema/_ajax_delete_pic.php?pic='+pic+'&type='+type+'&value='+value,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

//A FAIRE !!
function usePicThumb(pic,div,type,value)
{
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 50px 0px 0px 0px;" />';
	
	new Ajax.Request('/appli/cinema/_ajax_use_pic_thumb.php?pic='+pic+'&type='+type+'&value='+value,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		//$(div).innerHTML = reponse.responseText;
	}
}

function galeriePic(type,value,deb,fin,mode)
{
	function fail()
	{
		alert('failure');
	}
	
	function ok(reponse)
	{
		$('galeriePhoto').innerHTML = reponse.responseText;
	}
	
	if ($('pageGaleriePhoto'))
		$('pageGaleriePhoto').innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" />';
	
	new Ajax.Request('/appli/cinema/_ajax_generate_galerie_pic.php?type='+type+'&value='+value+'&deb='+deb+'&fin='+fin+'&mode='+mode,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: fail
	});
}


function acteurSearch(txt,div,type,value)
{
	if (div == null)
		div = 'search';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 50px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_search_acteur.php?texte='+txt+'&div='+div+'&type='+type+'&value='+value,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML =  '<a href="javascript:onOff(\'' + div + '\',0);" class="apparent7" style="float: right;">x Fermer</a><br />' + reponse.responseText;
	}
}



function filmsSearch(txt,div,type,value)
{
	if (div == null)
		div = 'search';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 50px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_search_film.php?texte='+txt+'&div='+div+'&type='+type+'&value='+value,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure');}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML =  '<a href="javascript:onOff(\'' + div + '\',0);" class="apparent7" style="float: right;">x Fermer</a><br />' + reponse.responseText;
	}
}

function acteurAssocFond(div,acteur,fond)
{	
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_assoc_acteur_fond.php?acteur=' + acteur + '&fond=' + fond,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function filmAssocFond(div,film,fond)
{	
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_assoc_film_fond.php?film=' + film + '&fond=' + fond,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function filmAssocCover(div,film,cover)
{	
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_assoc_film_cover.php?film=' + film + '&cover=' + cover,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function filmAssocDvdtheque(div,film,user)
{	
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/dvdtheque/_ajax_assoc_film_index.php?film=' + film + '&user=' + user,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function reaAssocFilm(div,acteur,film,mode)
{	
	if (mode == null)
		mode = 'liste_acteur';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_assoc_rea_film.php?acteur=' + acteur + '&film=' + film + '&mode=' + mode,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function actAssocFilm(div,acteur,film,mode)
{
	if (mode == null)
		mode = 'liste_acteur';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_assoc_act_film.php?acteur=' + acteur + '&film=' + film + '&mode=' + mode,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function newsAssocFilm(div,news,film,mode)
{
	if (mode == null)
		mode = 'liste_acteur';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_assoc_news_film.php?news=' + news + '&film=' + film + '&mode=' + mode,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}


function quizAssocFilm(div,quiz,film,mode)
{
	if (mode == null)
		mode = 'liste_acteur';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_assoc_quiz_film.php?quiz=' + quiz + '&film=' + film + '&mode=' + mode,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}


function addCoverAssocFilm(div,news,film,mode)
{
	if (mode == null)
		mode = 'liste_acteur';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_assoc_addcover_film.php?film=' + film + '&mode=' + mode,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}


function addGroupeAssocFilm(div,grp,film)
{
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 20px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_assoc_groupe_film.php?film=' + film + '&groupe=' + grp,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function avoir(div,film)
{
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 10px;" alt="" title="" />';
	
	new Ajax.Request('/appli/avoir/_ajax_assoc_film.php?film=' + film,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}


function noway(div,film)
{
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 10px;" alt="" title="" />';
	
	new Ajax.Request('/appli/cinema/_ajax_noway.php?film=' + film,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function vu(div,film,mode)
{
	if (mode == null)
		mode = 'total';
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 10px;" alt="" title="" />';
	
	new Ajax.Request('/appli/vu/_ajax_assoc_film.php?film=' + film + '&mode=' + mode,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function alerter(type,element,value1,value2)
{
	var div = 'divAlerter';
	var value1 = encodeURIComponent(value1);
	var value2 = encodeURIComponent(value2);
	
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 10px;" alt="" title="" />';
	
	new Ajax.Request('/site/_ajax_alerter.php?type=' + type + '&element=' + element + '&value1=' + value1 + '&value2=' + value2,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function pokeit(elt,type,div,mode,texte)
{
	if (div == null)
		div = 'divPoke';
	if (mode == null)
		mode = 'exe';
	if (texte == null)
		texte = '';
	
	$(div).innerHTML = '<img src="template/alldivx/images_addon/loading3.gif" style="margin: 0px;" alt="" title="" />';
	
	new Ajax.Request('/site/_ajax_poke.php?type=' + type + '&elt=' + elt + '&mode=' + mode + '&div=' + div + '&texte=' + texte,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function previsuCover(div,id)
{
	if ($(div).innerHTML == '')
	{
		$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 100px;" alt="" title="" />';
		
		function resOK(reponse)
		{
			$(div).innerHTML = reponse.responseText;
		}
		new Ajax.Request('/site/_ajax_cover_previsu_big.php?id='+id+'&div='+div,
		{
			method: 'get',
			asynchronous: true,
			contentType: 'application/x-www-form-urlencoded',
			onSuccess: resOK,
			onFailure: function(){}
		});
	}
}

function previsuWall(div,id)
{
	if ($(div).innerHTML == '')
	{
		$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 100px;" alt="" title="" />';
		
		function resOK(reponse)
		{
			$(div).innerHTML = reponse.responseText;
		}
		new Ajax.Request('/site/_ajax_wall_previsu_big.php?id='+id+'&div='+div,
		{
			method: 'get',
			asynchronous: true,
			contentType: 'application/x-www-form-urlencoded',
			onSuccess: resOK,
			onFailure: function(){}
		});
	}
}

function previsuFilmPic(div,id)
{
	if ($(div).innerHTML == '')
	{
		$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 100px;" alt="" title="" />';
		
		function resOK(reponse)
		{
			$(div).innerHTML = reponse.responseText;
		}
		new Ajax.Request('/site/_ajax_filmpic_previsu_big.php?id='+id+'&div='+div,
		{
			method: 'get',
			asynchronous: true,
			contentType: 'application/x-www-form-urlencoded',
			onSuccess: resOK,
			onFailure: function(){}
		});
	}
}

function previsuGroupePic(div,id)
{
	if ($(div).innerHTML == '')
	{
		$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="margin: 100px;" alt="" title="" />';
		
		function resOK(reponse)
		{
			$(div).innerHTML = reponse.responseText;
		}
		new Ajax.Request('/site/_ajax_groupepic_previsu_big.php?id='+id+'&div='+div,
		{
			method: 'get',
			asynchronous: true,
			contentType: 'application/x-www-form-urlencoded',
			onSuccess: resOK,
			onFailure: function(){}
		});
	}
}


function ajaxDetail_setWinner(user,obj,match,bo)
{
	$('finalWin_' + obj + '_' + match).value = user;
	
	elts = getElementsByName_iefix('div','divconfwin_' + obj)
	
	elts[0].style.display = 'none';
	elts[1].style.display = 'none';
	
	//disparition ligne suivant BO
	var player1, player2;
	var cptPlayer1 = 0;
	var cptPlayer2 = 0;
	for(i=1;i<=20;i++)
	{
		if ($('finalWin_' + obj + '_' + i) != null && $('finalWin_' + obj + '_' + i).value != '')
		{
			player = $('finalWin_' + obj + '_' + i).value;
			
			if (player1 == null && player2 == null)
				player1 = player;
			
			if(player == player1)
			{
				cptPlayer1++;
			}
			else if(player == player2)
			{
				cptPlayer2++;
			}
			else
			{
				player2 = player;
				cptPlayer2++;
			}
		}
	}
	if (bo == 3)
	{
		if ((cptPlayer1 == 2 || cptPlayer2 == 2) && match != 3)
		{
			//alert(cptPlayer1+'-'+cptPlayer2);
			$('ligneMatch3').style.display = 'none';
			$('finalWin_' + obj + '_3').value = '';
		}
		else
		{
			$('ligneMatch3').style.display = '';
		}
	}
	if (bo == 5)
	{
		if ((cptPlayer1 == 3 || cptPlayer2 == 3) && match == 3)
		{
			//alert(cptPlayer1+'-'+cptPlayer2);
			$('ligneMatch4').style.display = 'none';
			$('finalWin_' + obj + '_4').value = '';
			$('ligneMatch5').style.display = 'none';
			$('finalWin_' + obj + '_5').value = '';
		}
		else if ((cptPlayer1 == 3 || cptPlayer2 == 3) && match == 4)
		{
			//alert(cptPlayer1+'-'+cptPlayer2);
			$('ligneMatch5').style.display = 'none';
			$('finalWin_' + obj + '_5').value = '';
		}
		else
		{
			$('ligneMatch4').style.display = '';
			$('ligneMatch5').style.display = '';
		}
	}
}

function ajaxDetail_confWinner(obj)
{
	var player1, player2;
	var cptPlayer1 = 0;
	var cptPlayer2 = 0;
	
	for(i=1;i<=20;i++)
	{
		if ($('finalWin_' + obj + '_' + i) != null && $('finalWin_' + obj + '_' + i).value != '')
		{
			player = $('finalWin_' + obj + '_' + i).value;
			
			if (player1 == null && player2 == null)
				player1 = player;
			
			if(player == player1)
			{
				cptPlayer1++;
			}
			else if(player == player2)
			{
				cptPlayer2++;
			}
			else
			{
				player2 = player;
				cptPlayer2++;
			}
		}
	}

	if (cptPlayer1 > cptPlayer2)
	{
		//alert(player1 + ' gagne, ' + player2 + ' perd');
		$('divconfwin_' + obj + '_' + player1).style.display='block';
		$('divconfwin_' + obj + '_' + player2).style.display='none';
	}
	else
	{
		//alert(player2 + 'gagne, ' + player1 + ' perd');
		$('divconfwin_' + obj + '_' + player1).style.display='none';
		$('divconfwin_' + obj + '_' + player2).style.display='block';
	}
}


function ajaxDetail_setRace(user,obj,match,value)
{
	if (match == 1)
	{
		for(i=1;i<=20;i++)
		{
			if ($('race_' + obj + '_' + i + '_' + user) != null)
			{
				$('race_' + obj + '_' + i + '_' + user).selectedIndex = value;
			}
		}
	}
}

function ajaxDetail_setWinnerForfait(user,obj)
{
	elts = getElementsByName_iefix('div','divconfwin_' + obj)
	
	elts[0].style.display = 'none';
	elts[1].style.display = 'none';
	
	$('modeWin' + obj).value = 'forfait';
	
	onOf('divconfwin_' + obj + '_' + user);
}

function _ajx_tournoi_accueil_load_genre(genre,div,game,type)
{
	if (genre == null)
		genre = '';
	if (div == null)
		div = 'acc_block_film_genre';
	if (type == null)
		type = 'classic';
		
	$(div).innerHTML = '<div style="text-align: center;"><img src="/template/alldivx/images_addon/loading3.gif" style="margin: 130px 20px 0px 20px;" /></div>';
	
	new Ajax.Request('/site/_ajax_accueil_load_tournoi_genre.php?genre=' + encodeURIComponent(genre) + '&div=' + div + '&game=' + game + '&type=' + type,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function _ajx_tournoi_accueil_load_genre2(genre,div,game,type)
{
	if (genre == null)
		genre = '';
	if (div == null)
		div = 'acc_block_film_genre';
	if (type == null)
		type = 'classic,pool';
		
	$('divCharge').innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" />';
	
	new Ajax.Request('/site/_ajax_accueil_load_tournoi_genre2.php?genre=' + encodeURIComponent(genre) + '&div=' + div + '&game=' + game + '&type=' + type,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
		$('divCharge').innerHTML = '';
	}
}

function dl(objet, type)
{
	new Ajax.Request('/site/dl.php?objet=' + objet + '&type=' + type,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		
	}
}

function cw_set_players(div, cw, user, vs, ordre, check, clan)
{
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" />';
	
	new Ajax.Request('/tournament/_ajax_cw_set_players.php?cw=' + cw + '&user=' + user + '&vs=' + vs + '&ordre=' + ordre + '&value=' + check + '&clan=' + clan,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function tn_abonner(div, tn, user)
{
	$(div).innerHTML = '<img src="/template/alldivx/images_addon/loading3.gif" style="border: 0px;" />';
	
	new Ajax.Request('/tournament/_ajax_tn_abonnement.php?tn=' + tn + '&user=' + user,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: ok,
		onFailure: function(){alert('failure')}
	});
	
	function ok(reponse)
	{
		$(div).innerHTML = reponse.responseText;
	}
}

function cptHit(src)
{
	new Ajax.Request('/site/_ajax_cpt_hit.php?src=' + src,
	{
		method: 'get',
		asynchronous: true,
		contentType: 'application/x-www-form-urlencoded',
		onSuccess: function(){},
		onFailure: function(){alert('failure')}
	});
}

