function affiche(div,src, nom){
	var style = document.getElementById(div).style;
	if(style.display == "none"){
		document.getElementById(src).value = "[-] "+ nom;
		style.display = "";
	}else{
		document.getElementById(src).value = "[+] "+ nom;
		style.display = "none";
	}
}
function affiche1(div, nom){
	var style = document.getElementById(div).style;
	if(style.display == "none"){
		style.display = "";
	}else{
		style.display = "none";
	}
}
function OpenTchat(id){
	file('tchat.php?action=adduser&id='+escape(id));
	window.open('tchat.php?id='+escape(id), 'Hug.re Tchat', 'resizable=no, location=no, width=640, height=480, menubar=no, status=no, scrollbars=no, menubar=no');
	/*twNeowin('tchat.php?id='++escape(id),'Hug.re Tchat',640,480,1);*/
}
/*test playlist */
function playlist_popup(id, site){
	//file('playlist.php?page='+escape(site)+'&id='+escape(id));
	window.open('http://www.hug.re/playlist.php?page='+escape(site)+'&id='+escape(id), 'Hug.re Playlist', 'resizable=no, location=no, width=235, height=480, menubar=no, status=no, scrollbars=no, menubar=no');
}
/* fin test*/

function Commentaire(action,id){
	window.open('commentaire.php?action='+escape(action)+'&id='+escape(id), 'Commentaires - '+escape(action), 'resizable=no, location=no, width=640, height=480, menubar=no, status=no, scrollbars=no, menubar=no');
}


function ReadAlbum(id,div,page){
	if(texte = file('album.php?action=read&id='+escape(id)+'&page='+escape(page))){
		writediv(div,texte);
		writediv('album_delete','<a href="album.php?action=delete&page=' + escape(page) + '&id=' + escape(id) + '" onclick="return hs.htmlExpand(this, { objectType: \'iframe\' , headingText: \'hug.re\'} )">Supprimer l\'album</a><div class="highslide-heading"></div>')
	}
}

function art_file_attach_cat(id,idu,type){
	writediv('s_filelist','');
	writediv('preview','');
	if(texte = file('file_attach.php?cat='+escape(id)+'&idu='+escape(idu)+'&type='+escape(type))) {
		if(texte != '0') {
			writediv('filelist',texte);
		}else {
			writediv('filelist','');
		}
	}
}

function art_file_attach_cat2(cat,id){
	writediv('preview','');
	if(texte = file('file_attach.php?cat='+escape(cat)+'&s_cat='+escape(id))) {
		if(texte != '0') {
			writediv('s_filelist',texte);
		}else {
			writediv('s_filelist','');
		}
	}
}

function art_file_attach(cat,id){
	if(texte = file('file_attach.php?cat='+escape(cat)+'&id='+escape(id))) {
		if(texte != '0') writediv('preview',texte);
		else writediv('preview','');
	}
}

function generate_pseudo(f_name){
	var s_url = '';
	var x = document.forms[f_name];
	if(f_name == 'etape1'){
		if (x.sexe[0].checked == true) s_url = 's=1';
	}else{
		if(f_name == 'M') s_url = 's=1';
		else s_url = '';
	}
	if(texte = file('_pseudo_generator.php?'+s_url)) {
		document.getElementById('txtLogin').value = texte;
	}
}
function mdp_generate(){
	if(texte = file('generate_mdp_sms.php')) {
		document.getElementById('mdp').value = texte;
	}
}
