$(document).ready(function() {
	var idPho=getId("id_photo_header").innerHTML;
	ini_comments("photo",idPho,"last");
	$("#infobulle_note").tooltip({ 
		track: true, 
		delay: 0, 
		showURL: false, 
		opacity: 1, 
		fixPNG: true, 
		showBody: " - ", 
		extraClass: "pretty fancy", 
		top: 0, 
		left: 25 
	}); 
		$("#infobulle_note2").tooltip({ 
			track: true, 
			delay: 0, 
			showURL: false, 
			opacity: 1, 
			fixPNG: true, 
			showBody: " - ", 
			extraClass: "pretty fancy", 
			top: 0, 
			left: 25 
		}); 
		$("#infobulle_note").mousemove(function(e){
			var pos_x=e.clientX-$("#infobulle_note").findPos().x;
			var newNote=Math.round((10*pos_x/widthNotes));
			var newPX=160-(newNote*16);
			getId("infobulle_note").style.backgroundPosition="0px -"+newPX+"px";
			getId("value_note_hidden").value=Math.round((5*pos_x/widthNotes)*2)/2;
		});
		$("#infobulle_note").mouseout(function(e){
			getId("infobulle_note").style.backgroundPosition="0px -"+getId("decal_note_hidden").value+"px";
			getId("value_note_hidden").value=getId("value_note_depart_hidden").value;
		});
		$("#infobulle_note").click(function(e){
			$.post("/includes/modules/giveNote.php", { idCible: getId("id_photo_header").innerHTML, typeCible: "photo", note:getId("value_note_hidden").value, posted:"1"  }, function(data){
				$.post("/includes/modules/getNote.php", { idCible: getId("id_photo_header").innerHTML, typeCible: "photo" }, function(data){
					$("#note_space").html(data);
				});
			});
		});
	$("#connexion_commentaire").fancybox({ 'frameWidth':500, 'frameHeight':239, 'overlayShow':true });
	$("#link_delete_pho").fancybox({ 'frameWidth':500, 'frameHeight':160, 'overlayShow':true });
	$("#link_signale_abus").fancybox({ 'frameWidth':500, 'frameHeight':350, 'overlayShow':true });
});

function closeFancy(){
	$.fn.fancybox.close();	
}

function confirmDelPhoto(idDel){
	getId("id_photo_header").innerHTML=idDel;
	$("#link_delete_pho").click();
}

function delPhoto(idel){
	$.post("/includes/modules/adminuser/delelement.php", { idel: idel }, function(data){
		window.location.href=getId("link_alb_back").href;
	});
}

