function globalPhotoRemoveEvent() { } // abstraktni funkce

// --------- trida dialog pro kopirovani / presouvani ----------
function photoDialog_copyMove(iIdentify) {
	this.inheritFrom = photoDialog;
	this.inheritFrom();
	
	this.state3button_back = null;
	this.state3button_continue = null;
	this.state4button = null;
	
	this.selectCopy = null;
	this.selectMove = null;
	
	this.album_ID; // aktualni album
	this.albumTitle;
	this.identify = iIdentify;
	
	// --------- override ----------
	this.inicialize = function() {
		this.beforeState  = "dialog_state1";
				
		this.state3button_back = document.getElementById(this.identify + "dialog_state3button_back");
		this.state3button_continue = document.getElementById(this.identify + "dialog_state3button_continue");
		this.state4button = document.getElementById(this.identify + "dialog_state4button");
		this.selectCopy = document.getElementById(this.identify + "dialog_copy");
		this.selectMove = document.getElementById(this.identify + "dialog_move");				
	}		
	
	this.execute = function() {
		this.commandName = (this.selectCopy.checked) ? "photo_copy" : "photo_move";
		this.additionalParams = this.album_ID;
		var cmd = this.composeCommand();
		
		if (exec == null) {
			alert("Chyba!");
			this.toSelect();
		} else this.execCmd(cmd);
	}
	
	this.finish = function(success) {
		if (this.finishFlag) {
			if (success) {
                for (var f = 0; f < dialogs.collection.length; f++)
                    dialogs.collection[f].albumNum += 1; // update poctu alb vsech fotek
                    
                dialogs.updateSelections();

				if (this.dialogMod != "nouncheck" || this.selectMove.checked)
					photos.uncheck();

                if (!this.selectCopy.checked) globalPhotoRemoveEvent();
				document.getElementById(this.identify + "dialog_finalStuff").innerHTML = "Fotografie byly " + (this.selectCopy.checked ? "zkopírovány" : "přesunuty") + ".";
 			} else {
				document.getElementById(this.identify + "dialog_finalStuff").innerHTML = "Fotografie se nepodařilo " + (this.selectCopy.checked ? "zkopírovat" : "přesunout") + ".";
			}
			
			this.setState("dialog_state4");
			this.finishFlag = false;
		}
	}

	this.updateSelection = function(iRef) {
		if (dialogs.collection.length == 0) {
			this.setState("dialog_state1");			
		} else {
			var toPut = "";
			if (dialogs.collection.length == 1) toPut = "Vyberte album, do kterého chcete fotografii";
			else toPut = "Vyberte album, do kterého chcete označené fotografie (" + dialogs.collection.length + ")";
			
			document.getElementById(this.identify + "dialog_stuffText").innerHTML = toPut;
			
			this.setState("dialog_state2");			
		}
	}
	
	this.selectAlbum = function(albumID, title) {
		this.album_ID = albumID;
		this.albumTitle = title;
		
		var toPut = "Fotografie se <strong>";
		toPut += this.selectCopy.checked ? "zkopírují" : "přesunou";
		toPut += "</strong> do alba <strong>" + this.albumTitle + "</strong>";
		document.getElementById(this.identify + "dialog_stuff").innerHTML = toPut;
		
		this.state3button_continue.value = this.selectCopy.checked ? "kopírovat" : "přesunout";
				
		this.setState("dialog_state3");
	}
	// ---------------------------
	
	this.toStart = function() {
		this.setState(dialogs.collection.length == 0 ? "dialog_state1" : "dialog_state2");
	}
	
	this.toSelect = function() {
		this.toStart();
	}
}

