function Page5() {
	this.id = "page5";
	
	Page5.prototype.update = function() {

		// produkty
		$("page5-selected").innerHTML = "";
		$("print-headline1").innerHTML = "Vybrané produkty a služby Speciál";
		$("print-list1").innerHTML = "";
		var products = c.selection.findByCategories(Config.exclusiveCategoryId);
		for (var i = 0; i < products.items.length; i++) {
			var product = products.items[i];
			var className = null;
			if (product.category.id == Config.basicCategoryId) {
				className = "product make-basic";
			}
			else if (product.category.id == Config.extendedCategoryId) {
				className = "product make-extended";
			}
			else if (product.category.id == Config.exclusiveCategoryId) {
				className = "product make-special";
			}
			var element = HtmlFactory.createElement("A", $("page5-selected"), className);	
			element.style.cursor = "default";
			element.innerHTML = "<span unselectable=\"on\">" + product.fullName + "</span>";
			if (product.amount > 1) {
				element.innerHTML += "<span class=\"number\">" + product.amount + "&times;</span>";
			}
			$("print-list1").innerHTML += "<li>" + product.fullName + (product.amount > 1 ? " (" + product.amount + "&times;)" : "") + "</li>";
		}
		
		// benefity
		$("page5-benefits").innerHTML = "";
		$("print-headline2").innerHTML = "Benefity";
		$("print-list2").innerHTML = "";
		// UPDATE: text pro prazdne benefity
		if (products.items.length == 0) {
			$("page5-benefits").innerHTML += "<p>Pokud si vyberete některý z produktů Speciál, můžete získat následující výhody:</p>";
		}
		var benefits = products.getBenefits(true);
		for (var i = 0; i < benefits.length; i++) {
			var benefit = benefits[i];
			$("page5-benefits").innerHTML += "<li>" + benefit.text + "</li>";
			// UPDATE: budou se tisknout jen benefity, ktere maji smysl
			if (products.items.length > 0) {
				$("print-list2").innerHTML += "<li>" + benefit.text + "</li>";
			}
		}
		
		// cena
		var price = Formatter.asCurrency(c.selection.getExclusivePrice());
		$("page5-pricing-normal").innerHTML = price;
		
		// TODO : do print sablony zanest oldPrice vs. newPrice
		$("print-label1").innerHTML = "Měsíční cena";
		$("print-price1").innerHTML = Formatter.asCurrency(c.selection.getExclusivePrice());

		// datum
		$("print-created").innerHTML = "Vytištěno: " + Formatter.asDateTime(new Date());
		
		// promo
		//$("print-promo-exclusive").style.display = "block";
		//$("print-promo-standard").style.display = "none";

	};

	Page5.prototype.submitData = function() {
		this.request = new AjaxRequest();
		this.request.onSuccess = delegate(this, this.submitSuccess);
		this.request.onFailure = delegate(this, this.submitFailure);
		this.request.post(Config.saveUrl, c.selection.getXML());
		switchingPage = true;
		Progress.show("Ukládám konfiguraci...");
	};
	
	Page5.prototype.submitSuccess = function() {
		Progress.hide();
		if (Config.intranetMode == true) {
			/*Info.onClose = function() {
				document.location = Config.closeUrl;
			};
			Info.show("Provedli jste úspěšnou konfiguraci účtu či doplňkových služeb, dále pokracujte v pobočkovém systému");*/
			document.location = Config.closeUrl;
		}
		else {
			document.location = Config.formUrl;
		}
	};

	Page5.prototype.submitFailure = function() {
		Progress.hide();
		if (Config.intranetMode == true) {
			Error.show("Nepodařilo se odeslat upravenou konfiguraci.\n" + this.request.responseText);
		}
		else {
			Error.show("Nepodařilo se odeslat vaši konfiguraci.\n" + this.request.responseText);
		}
	};

	Page5.prototype.enter = function() {
		$(this.id).style.visibility = "visible";
		$(this.id).unselectable = "on";
		$("page5-empty").style.visibility = (c.selection.findByCategories(Config.exclusiveCategoryId).items.length == 0) ? "visible" : "hidden";
		if (Config.intranetMode == true && c.panel.opened) {
			c.panel.toggle();
		}
		this.update();
	};

	Page5.prototype.leave = function() {
		$("page5-empty").style.visibility = "hidden";
		$(this.id).style.visibility = "hidden";
	};

}

