// ------- nadrazena trida dialogu -------
function photoDialog_photoPrint(iIdentify) {
	this.inheritFrom = photoDialog;
	this.inheritFrom();

	this.identify = iIdentify;

    this.lastCheckedRadio = null;
    this.size = null;
    this.count = null;
    this.surface = null;
    this.process = null;

    this.sizeRadioCheck = function(iRef) {
        if (iRef != this.lastCheckedRadio) {
            if (this.lastCheckedRadio != null) {
                document.getElementById(this.identify + this.lastCheckedRadio.value + "_left").style.color = "black";
                document.getElementById(this.identify + this.lastCheckedRadio.value + "_left").style.fontWeight = "normal";
                document.getElementById(this.identify + this.lastCheckedRadio.value + "_right").style.color = "black";
                document.getElementById(this.identify + this.lastCheckedRadio.value + "_right").style.fontWeight = "normal";
            }

            document.getElementById(this.identify + iRef.value + "_left").style.color = "#BE1914";
            document.getElementById(this.identify + iRef.value + "_left").style.fontWeight = "bold";
            document.getElementById(this.identify + iRef.value + "_right").style.color = "#BE1914";
            document.getElementById(this.identify + iRef.value + "_right").style.fontWeight = "bold";
            
            document.getElementById(this.identify + "dialog_size").innerHTML = iRef.value;
            iRef.checked = true;
            this.lastCheckedRadio = iRef;
        }
    }

	// -------- virtualni metody ----------
	this.inicialize = function() {
		this.beforeState = "dialog_state1";

		this.size = document.getElementById(this.identify + "dialog_size");
		this.count = document.getElementById(this.identify + "dialog_count");
		this.surface = document.getElementById(this.identify + "dialog_surface");
		this.process = document.getElementById(this.identify + "dialog_process");
	}

	this.execute = function() {
        if (photos.collection.length > 0) {
    		this.commandName = "photo_addCart";
    		this.additionalParams  = "0,";
    		this.additionalParams += this.lastCheckedRadio.value + "," + this.count[this.count.selectedIndex].value;
    		this.additionalParams += "," + this.surface.options[this.surface.selectedIndex].value;
    		//this.additionalParams += "," + this.process[this.process.selectedIndex].value;
    		this.additionalParams += ",\"\"";
    		var cmd = this.composeCommand();

    		if (exec == null) alert("Chyba!");
    		else {
                this.execCmdPost(cmd);
            }
        } else alert("Nevybrali jste žádnou fotografii pro tisk");
	}

	this.finish = function(success) {
		if (this.finishFlag) {
			this.finishFlag = false;
		}
	}

	this.updateSelection = function(iRef) {
        /*
		if (dialogs.collection.length == 0) {
			this.setState("dialog_state1");
		} else {
			this.setState("dialog_state2");
			this.updateStuff();
			this.execute();
		}*/
	}
	
	this.sizeRadioCheck( document.getElementById(this.identify + "10x15_left").childNodes[0] );
}

