/*
 * Gestion du zoom
 */

// Raccourci fonctions ajax
function zoomc(id){Zoom.click(id);}


var Zoom = {
	titre: null,
	link: null,
	
	load: function(titre, link, ecID) {
		this.titre = titre;
		this.link = link;
		this.click(ecID);
	},
	
	click: function(ecID) {
		this.link.unbind("click").click(function(){
			var intitule = $(this).attr("rel");
			Zoom.open(ecID, intitule);
			return false;
		});
	},
	
	open: function(ecID, titre){
		var intitule = (titre != "") ? titre : Zoom.titre;

		Box.open({
			url: PATHRACINE + "/Zoom",
			urldata: PARAMGLOBAL +"&ECBIZ="+ ecID + "&intitule=" + intitule,
			show: function(){
				//Draggable
				$(this.el).draggable({cancel:"#zoom_flash, .zoom_contenu", scroll:"true", cursor:"move"});
			}
		});
	}
}