	
	// --- scroll_watch_class ---
	
	function scroll_watch() {
		this.scroll_x = null;
		this.scroll_y = null;
		
		this.enabled = false;
		this.sloop = -1;
		this.sloop_top = 10;
	}
	
	scroll_watch.prototype.construct = function() {
		var self = this;
		addEvent(document.body, "scroll", function(trgEvent) {  
			var evt = trgEvent == null ? window.event : trgEvent;
			self.evt_scroll(evt);
		});
		addEvent(window, "scroll", function(trgEvent) {  
			var evt = trgEvent == null ? window.event : trgEvent;
			self.evt_scroll(evt);
		});
	}
	
	scroll_watch.prototype.evt_scroll = function(evt) {
		if (this.enabled && this.sloop != -2) {
			this.scroll_x = context.get_scX();
			this.scroll_y = context.get_scY();
			this.sloop = 0;
		}
	}
	
	scroll_watch.prototype.do_motion = function() {
		if (this.enabled && this.sloop >= 0) {
			this.sloop++;
			
			if (this.sloop > this.sloop_top) {
				this.sloop = -2;
				
				var self = this;
				var struct = new structure_class();
				
				struct.map("head/major", "pnc_browser_scroll");
				struct.map("head/scroll_x", this.scroll_x);
				struct.map("head/scroll_y", this.scroll_y);
				
				context.request("pnc_browser_scroll", null, function(data, request) {
					if (self != null) self.evt_save(data, request);
				}, struct);
			}
		}
	}
	
	scroll_watch.prototype.evt_save = function() {
		this.sloop = -1;
	}
	
	// --- error_wnd_class ---

	function error_wnd() {
		var self = this;
	
		this.container = null;
		this.div = null;
		this.input = null;
		this.overlay = null;
		this.ondone = null;
		this.box_button = null;
		
		this.right_top = null;
		this.right_bottom = null;
		this.left_top = null;
		this.left_bottom = null;
		
		this._onresize = function() { self.position(); }
		this._onscroll = function() { self.position(); }
	}

	error_wnd.prototype.construct = function(container, caption, inner, add_class) {
		var self = this;
		document.body.appendChild(container);
		
		this.container = container;
		this.container.className = "error_box error_box_float" + (add_class != null ? (" " + add_class) : "");
		
		if (inner != null) this.container.innerHTML = inner;
		else {
			var current, f, stack = new Array();
			stack[0] = this.container;
			
			while (stack.length > 0 && this.box_button == null) {
				current = stack.pop();
				
				if (current.tagName.toUpperCase() == "A" && current.className == "box_button") this.box_button = current;
				else {
					if (current.childNodes.length > 0)
						for (f = 0; f < current.childNodes.length; f++)
							if (current.childNodes[f].nodeType == 1) stack[stack.length] = current.childNodes[f];
				}
			}
		}
		
		this.div = document.createElement("DIV");
		this.div.className = "button";
		
		this.input = document.createElement("INPUT");
		this.input.type = "button";
		this.input.value = caption;
		this.input.onclick = function() {
			self.done();
		}
		
		if (this.box_button != null) {
			this.input.value = this.box_button.innerHTML;
			this.ondone = function() {
				document.location.href = self.box_button.href;
			}
			
			this.box_button.parentNode.removeChild(this.box_button);
		}
		
		this.right_top = document.createElement("SPAN");
		this.right_top.className = "right_top";
		
		this.right_bottom = document.createElement("SPAN");
		this.right_bottom.className = "right_bottom";
		
		this.left_top = document.createElement("SPAN");
		this.left_top.className = "left_top";
		
		this.left_bottom = document.createElement("SPAN");
		this.left_bottom.className = "left_bottom";
		
		this.container.appendChild(this.right_top);
		this.container.appendChild(this.right_bottom);
		this.container.appendChild(this.left_top);
		this.container.appendChild(this.left_bottom);
		
		this.overlay = document.createElement("DIV");
		this.overlay.className = "overlay";
		
		this.div.appendChild(this.input);
		this.container.appendChild(this.div);
		this.container.parentNode.appendChild(this.overlay);
		
		this.position();
		
		addEvent(window, "resize", this._onresize);
		addEvent(window, "scroll", this._onscroll);
	}
	
	error_wnd.prototype.done = function() {
		removeEvent(window, "resize", this._onresize);
		removeEvent(window, "scroll", this._onscroll);
	
		if (this.ondone != null) this.ondone();
	
		document.body.style.border = "none";
	
		context.structure_destroy(this.overlay);
		context.structure_destroy(this.container);
		context.object_destroy(this);
	}
	
	error_wnd.prototype.position = function() {
		this.overlay.style.width = document.body.offsetWidth + "px";
		this.overlay.style.height = document.body.offsetHeight + "px";
		
		this.container.style.left = Math.round((context.wnd_x() - context.get_elementWidth(this.container)) / 2) + "px";
		this.container.style.top = (Math.round((context.wnd_y() - context.get_elementHeight(this.container)) / 2) + context.get_scY()) + "px";
	}
		
	// --- product_box_class ---
	
	function product_box_class(container) {
		this.inheritFrom = shadow_block_class;
		this.inheritFrom();
		
		this.container = container;
		this.butt_close = null;
	}
	
	clone_add(product_box_class.prototype, shadow_block_class.prototype); // inherit
	
	product_box_class.prototype.ref_stack = new Array();
	
	product_box_class.prototype.construct = function() {
		var self = this;
		this.ref_stack[this.ref_stack.length] = this;
		this.container.className += " error_box_float";
		
		var sf, current, stack = new Array();
		stack[0] = this.container;
		
		while (stack.length > 0) {
			current = stack.pop();
			
			switch (current.tagName.toUpperCase()) {
				case "A" :
					if (current.className == "button_normal") this.butt_close = current;
					break;
			}
			
			if (current.childNodes.length > 0) {
				for (sf = 0; sf < current.childNodes.length; sf++)
					if (current.childNodes[sf].nodeType == 1) stack[stack.length] = current.childNodes[sf];
			}
		}
		
		if (this.butt_close != null) {
			this.butt_close.href = "javascript:blank()";
			this.butt_close.onclick = function() { self.close(); }
		}
	}
	
	product_box_class.prototype.open = function(ref) {
		var f;
		for (f = 0; f < this.ref_stack.length; f++)
			if (this.ref_stack[f] != this) this.ref_stack[f].close();
		
		this.container.style.display = "block";
		if (ref != null) {
			document.body.appendChild(this.container);
			this.container.style.position = "absolute";
			this.container.style.left = context.get_elementX(ref) + "px";
			this.container.style.top = context.get_elementY(ref) + "px";
		}
		this.shadows_build();
	}
	
	product_box_class.prototype.close = function() {
		this.container.style.display = "none";
		this.shadows_destroy();
	}
	
	product_box_class.prototype.shadow_width = function() { return context.get_elementWidth(this.container) - 1; }
	product_box_class.prototype.shadow_height = function() { return context.get_elementHeight(this.container) - 1; }
	
	// --- filter_handle ---
	
	function filter_handle(container) {
		this.container = container;
		this.href_prefix = null;
		
		this.construct();
	}
	
	filter_handle.prototype.construct = function() {
		var self = this, f, current, stack = new Array();
		stack[0] = this.container;
		
		while (stack.length > 0) {
			current = stack.pop();
			
			if (current.tagName.toUpperCase() == "SELECT") {
				current.onchange = function() {
					document.location.href = (self.href_prefix == null ? document.location.href : self.href_prefix) + "/(" + this.id + ":" + this.options[this.selectedIndex].value + ")filter";
				}
				new ic_select(current);
			}
			if (current.tagName.toUpperCase() == "INPUT" && current.type == "checkbox") {
				current.onclick = function() {
					document.location.href = (self.href_prefix == null ? document.location.href : self.href_prefix) + "/(" + this.id + ":" + (this.checked ? 1 : 0) + ")filter";
				}
			}
			if (current.childNodes.length > 0) {
				for (f = 0; f < current.childNodes.length; f++)
					if (current.childNodes[f].nodeType == 1) stack[stack.length] = current.childNodes[f];
			}
		}
	}
	
	// --- news_block_class ---
	
	function block_list_class() {
		this.corners = new Array();;
		this.blocks = new Array();
		this.titles = new Array();
		this.hrefs = new Array();
		this.data = new Array();
		this.selected = -1;
	}
	
	
	block_list_class.prototype.add = function(input, func, data, is_selected) {
		var block = document.getElementById(input);
		var block_title = document.getElementById(input + "_title");
		var block_corner = document.getElementById(input + "_corner");
		
		if (block != null && block_title != null) {
			this.blocks[this.blocks.length] = block;
			this.titles[this.titles.length] = block_title;
			
			if (block_corner != null) this.corners[this.corners.length] = block_corner;
			if (is_selected) this.selected = this.blocks.length - 1;
			
			if (func != null) this.data[this.data.length] = new Array(func, data);
			else this.data[this.data.length] = null;
		}
	}
	
	block_list_class.prototype.construct = function() {
		if (this.blocks.length > 0) {
			var f, self = this;
			
			for (f = 0; f < this.titles.length; f++) {
				if (f != this.selected) this.blocks[f].style.display = "none";
				this.titles[f].className = f == this.selected ? "tab_active" : "tab_inactive";
				
				var sf, current, stack = new Array();
				stack[0] = this.titles[f];
				
				while (stack.length > 0) {
					current = stack.pop();
					
					if (current.tagName.toUpperCase() == "A") {
						this.hrefs[f] = current;
						
						current.href = "javascript:blank()";
						current.onclick = function() { self.evt_click(this); }
					}
					
					if (current.childNodes.length > 0)
						for (sf = 0; sf < current.childNodes.length; sf++)
							if (current.childNodes[sf].nodeType == 1) stack[stack.length] = current.childNodes[sf];
				}
			}
		}
	}
	
	block_list_class.prototype.evt_click = function(href) {
		var founded = false;
		var pos = 0;
		
		while (!founded && pos < this.hrefs.length)
			if (this.hrefs[pos] === href) founded = true;
			else pos++;
			
		if (founded && pos != this.selected) {
			var f;
			for (f = 0; f < this.corners.length; f++)
				this.corners[f].style.display = (pos == 0 ? "none" : "block");
			
			if (this.selected != -1) {
				this.titles[this.selected].className = "tab_inactive";
				this.blocks[this.selected].style.display = "none";
			}
			
			this.titles[this.selected = pos].className = "tab_active";
			this.blocks[this.selected].style.display = "block";
			
			if (this.data[this.selected] != null)
				this.data[this.selected][0](this, this.data[this.selected][1]);
		}
	}
	
	// ---- infobox_handler ---
	
	function infobox_handler(button, container) {
		this.button = button;
		this.container = container;
		
		this.close_timeout = null;
		this.touch_timeout = null;
	}
	
	infobox_handler.prototype.construct_infobox = function() {
		var self = this;
		
		document.body.appendChild(this.container);
		
		this.button.onmouseover = function(trgEvent) {
			self.evt_activate(trgEvent == null ? event : trgEvent);
		}
		this.container.onmouseover = function(trgEvent) {
			self.evt_over(trgEvent == null ? event : trgEvent);
		}
		this.container.onmouseout = function(trgEvent) {
			self.evt_out(trgEvent == null ? event : trgEvent);
		}
	}
	
	infobox_handler.prototype.close = function() {
		this.container.style.display = "none";
	}
	
	infobox_handler.prototype.cancel_close = function() {
		var self = this;
		if (this.close_timeout != null) {
			if (context.ic_collector.timeout_stop(this.close_timeout))
				this.close_timeout = null;
		}
	}
	
	infobox_handler.prototype.touched = function() {
		var self = this;
	
		if (this.touch_timeout != null) context.ic_collector.timeout_stop(this.touch_timeout);
		this.touch_timeout = context.ic_collector.timeout(function() { self.evt_activate() }, 1000);
	}
	
	infobox_handler.prototype.open = function() {
		this.container.style.position = "absolute";
		this.container.style.left = context.get_elementX(this.button) + "px";
		this.container.style.top = context.get_elementY(this.button) + "px";
		this.container.style.display = "block";
	}
	
	infobox_handler.prototype.evt_activate = function() {
		this.open();
	}
	
	infobox_handler.prototype.evt_over = function(trgEvent) {
		this.cancel_close();
	}
	
	infobox_handler.prototype.evt_out = function(trgEvent) {
		var self = this;
	
		var target = trgEvent.toElement == null ? trgEvent.target : trgEvent.toElement;
		
		while (target != null && target != this.container) target = target.parentNode;
		
		if (target != null) {
			var self = this;
			this.cancel_close();
			this.close_timeout = context.ic_collector.timeout(function() { self.close(); }, 2000);
		}
	}
	
	// --- store_infobox ---
	
	function store_infobox(button, container, input) {
		this.inheritFrom = infobox_handler;
		this.inheritFrom(button, container);
	
		this.input = input;
		
		this.par = null;
		this.hidden = null;
		
		this.last_value = null;
		this.lang = null;
		
		this.construct();
	}
	
	clone_add(store_infobox.prototype, infobox_handler.prototype); // inherit
	
	store_infobox.prototype.construct = function() {
		var self = this;
		
		this.construct_infobox();

		var f, current, stack = new Array();
		stack[0] = this.container;
		
		while ((this.par == null || this.hidden == null) && stack.length > 0) {
			current = stack.pop();
			
			if (current.tagName.toUpperCase() == "P") this.par = current;
			else if (current.tagName.toUpperCase() == "INPUT" && current.type == "hidden") this.hidden = current;
			else {
				if (current.childNodes.length > 0) {
					for (f = 0; f < current.childNodes.length; f++)
						if (current.childNodes[f].nodeType == 1) stack[stack.length] = current.childNodes[f];
				}
			}
		}
		
		this.last_value = this.input.value;
		this.input.onchange = function() {
			if (self.touch_timeout != null) {
				context.ic_collector.timeout_stop(self.touch_timeout);
				self.touch_timeout = null;
			}
			self.refresh();
		}
		this.input.onkeyup = function() {
			self.touched();
		}
	}
	
	store_infobox.prototype.refresh = function() {
		if (this.input.value != this.last_value) {
			var self = this;
			var struct = new structure_class();
			
			var n = parseInt(this.input.value);
			if (isNaN(n)) n = 1;
			
			struct.map("head/major", "shop_store_state");
			struct.map("head/productID", parseInt(this.hidden.value));
			struct.map("head/num", n);
			struct.map("head/lang", this.lang);
			
			context.request("shop_store_state", null, function(data, request) {
				if (self != null) self.evt_refresh(data, request);
			}, struct);
		}
	}
	
	store_infobox.prototype.evt_refresh = function(data, request) {
		var res, f;
		if ((res = request.get_response()) != null) {
			
			var head = res[0];
			var body = res[1];
			
			this.last_value = this.input.value;
			var dt, el = body.getElementsByTagName("output_data");
			if (el.length > 0) {
				dt = context.element_value(el[0]);
				this.par.innerHTML = dt;
			}
			
		}
	}
	
	store_infobox.prototype.touched = function() {
		if (this.input.value != this.last_value) {
			var self = this;
			
			if (this.touch_timeout != null) context.ic_collector.timeout_stop(this.touch_timeout);
			this.touch_timeout = context.ic_collector.timeout(function() { self.evt_activate() }, 1000);
		}
	}
	
	store_infobox.prototype.evt_activate = function() {
		this.open();
		this.refresh();
	}
	
	// --- gallery_handler ---
	
	gallery_parser_handle_item = function(parent, img, href) {
		this.img = img;
		this.href = href;
		this.image = null;
	}
	
	gallery_parser_handle_item.prototype.construct = function() {
		var self = this;
		
		this.image = this.href.href;
		this.href.href = "javascript:blank()";
		this.href.onclick = function() {
			var pos, spos, p = self.image;
			
			if ((pos = self.image.indexOf("http://")) != -1 && (spos = self.image.indexOf("/", pos + 1)) != -1) {
				p = self.image.substr(spos);
			}
		
			window.open('/preview.php?prev_path=' + p, 'gwnd', 'width=auto,height=auto,toolbar=0,statusbar=0,menubar=0');
		}
	}
	
	gallery_parser_handle = function(parent, container) {
		this.parent = parent;
		this.container = container;
		
		this.items = new Array();
	}
	
	gallery_parser_handle.prototype.construct = function() {
		var ref, current, f, stack = new Array();
		stack[0] = this.container;
		
		while (stack.length > 0) {
			current = stack.pop();
			
			if (current.tagName.toUpperCase() == "IMG" && current.parentNode.tagName.toUpperCase() == "A") {
				ref = new gallery_parser_handle_item(this, current, current.parentNode);
				ref.construct();
				
				this.items[this.items.length] = ref;
			}
			
			if (current.childNodes.length > 0)
				for (f = 0; f < current.childNodes.length; f++)
					if (current.childNodes[f].nodeType == 1) stack[stack.length] = current.childNodes[f];
		}
	}
	
	gallery_parser = function() {
		this.items = new Array();
	}
	
	gallery_parser.prototype.construct = function() {
		var f, ref, divs = document.getElementsByTagName("div"), tp = new Array();
		
		for (f = 0; f < divs.length; f++)
			if (divs[f].className == "img_list") {
				ref = new gallery_parser_handle(this, divs[f]);
				ref.construct();
				
				this.items[this.items.length] = ref;
			}
		
		divs = document.getElementsByTagName("table");
		for (f = 0; f < divs.length; f++)
			if (divs[f].className == "gallery_in_content") {
				ref = new gallery_parser_handle(this, divs[f]);
				ref.construct();
				
				this.items[this.items.length] = ref;
			}
	}

	// --- rest ---
	
	var context = null;
	var pageTracker = null;
	var g_fcl = null;
	var g_fh = null;
	var g_lh = new Array();
	var g_sfcl = null;
	var g_wt = null; // product watchdog
	var g_ms = null; // product mail send
	var g_sbox = null;
	var g_cp = null; // cart panel
	var g_isw = null; // image swap
	var g_gp = null; 
	var g_vlist = null;
	var g_scr = null; // scroll
	
	function blank() { }
	
	function area_insert(ref, input) {
		if (ref != null) {
			if (document.selection) {
				ref.focus();
				var sel = document.selection.createRange();
				sel.text = input;
			} else if (ref.selectionStart || ref.selectionStart == 0) {
				var startPos = ref.selectionStart;
				var endPos = ref.selectionEnd;
				ref.value = ref.value.substring(0, startPos) + input + ref.value.substring(endPos, ref.value.length);
			} else {
				ref.value += input;
			}			
		}
	}
	
	function g_lh_add(ref) {
		g_lh[g_lh.length] = ref;
	}
	
	function g_lh_motion() {
		if (g_lh.length > 0) {
			var f;
			for (f = 0; f < g_lh.length; f++)
				g_lh[f].motion();
		}
	}
	
	function g_fcl_motion() { if (g_fcl != null) g_fcl.do_motion(); }
	function g_cp_motion() { if (g_cp != null) g_cp.do_motion(); }
	function g_isw_motion() { if (g_isw != null) g_isw.do_motion(); }
	function g_scr_motion() { if (g_scr != null) g_scr.do_motion(); }
	
	function g_set_lang(lang) {
		if (g_sfcl != null) g_sfcl.lang = lang;
		if (g_sbox != null) g_sbox.lang = lang;
		if (g_cp != null) g_cp.lang = lang;
		if (g_vlist != null) g_vlist.lang = lang;
	}
	
	function do_print() {
		window.print();
	}
	
	function print_document(type, ident) {
		window.open("/shop_print.php?type=" + type + "&ident=" + ident, "shop_wnd", "toolbar=0,statusbar=0,menubar=1,resizable=1,width=850,height=600,scrollbars=1");
	}
	
	function open_window(href, wid) {
		window.open(href, wid, "toolbar=0,statusbar=0,menubar=0,resizable=1,width=1000,height=830");
	}
	
	function new_captcha_make(ref, skip_new) {
		var link = "/captcha.php?";
		if (skip_new == null) link += "new=1&";
		link += "r="
		var univ = "qwertyuiopasdfghjklzxcvbnm0123456789";
		var f, letter, len = Math.round(Math.random() * 20) + 15;
		
		for (f = 0; f < len; f++) link += univ.substr(Math.round(Math.random() * (univ.length - 1)), 1);
		
		ref.src = link;
	}
	
	function new_captcha() {
		var ref = document.getElementById("captcha");
		if (ref != null) {
			new_captcha_make(ref);
			
		} else {
			ref = null;
			var index = 1;
			
			do {
				if ((ref = document.getElementById("captcha_" + index)) != null)
					new_captcha_make(ref, index == 1 ? null : true);
				index++;
			} while (ref != null);
		}
	}
	
	function open_login() {
		tmp = document.getElementById("user_login_do_block");
		inp = document.getElementById("user_login_do");
		
		if (tmp != null && inp != null) {
			inp.checked = true;
			tmp.style.display = "block";
		}
	}
	
	function motion() {
		g_lh_motion();
		g_fcl_motion();
		g_cp_motion();
		g_isw_motion();
		g_scr_motion();
		setTimeout("motion()", 50);
	}
	
	function mount_box(form, dtext) {
		var box = null, sf, current, stack = new Array();
		stack[0] = form;
		
		while (stack.length > 0) {
			current = stack.pop();
			
			switch (current.tagName.toUpperCase()) {
				case "TEXTAREA" :
					box = current;
					break;
					
				case "INPUT" :
					if (current.type == "text") box = current;
					break;
			}
			
			if (current.childNodes.length > 0) {
				for (sf = 0; sf < current.childNodes.length; sf++)
					if (current.childNodes[sf].nodeType == 1) stack[stack.length] = current.childNodes[sf];
			}
		}
		
		if (box != null) {
			box.onblur = function() {
				if (this.value == "") this.value = dtext;
			}
			box.onfocus = function() {
				if (this.value == dtext) this.value = "";
			}
			if (box.value == "") box.value = dtext;
		}
	}
	
	function evt_body_load_final() {
		context = new context_class();
		context.construct();
		
		g_scr = new scroll_watch();
		g_scr.construct();
		
		var f = document.getElementById("search_form");
		if (f != null) mount_box(f, "Vyhledat ...");
		
		f = document.getElementById("mail_form");
		if (f != null) mount_box(f, "Váš email ...");
		
		f = document.getElementById("response_email");
		if (f != null) mount_box(f, "Váš email ...");
		
		f = document.getElementById("response_message");
		if (f != null) mount_box(f, "Vaše zpráva ...");
		
		f = document.getElementById("newsgrab_form");
		if (f != null) mount_box(f, "Vyplňte Váš email ...");
		
		f = document.getElementById("response_captcha");
		if (f != null) mount_box(f, "Zde přepiště písmena z obrázku...");
		
		if ((f = document.getElementById("watchdog")) != null) {
			g_wt = new product_box_class(f);
			g_wt.construct();
		}
		if ((f = document.getElementById("mail_send")) != null) {
			g_ms = new product_box_class(f);
			g_ms.construct();
		}
		
		var inp_forum_category = null;
		var inp_response_contact = null;
		var inp_users_de_country = null;
		var inp_users_in_country = null;
		var inp_users_country = null;
		
		if ((box = document.getElementById("forum_category")) != null) {
			inp_forum_category = new ic_select(box);
		}
		if ((box = document.getElementById("response_contact")) != null) {
			inp_response_contact = new ic_select(box);
		}
		if ((box = document.getElementById("users_de_country")) != null) {
			inp_users_de_country = new ic_select(box);
		}
		if ((box = document.getElementById("users_in_country")) != null) {
			inp_users_in_country = new ic_select(box);
		}
		if ((box = document.getElementById("users_country")) != null) {
			inp_users_country = new ic_select(box);
		}

		
		var btn, inp, tmp = document.getElementById("area_users_de_create");
		
		if (tmp != null) {
			inp = document.getElementById("users_de_create");
			var dis_users_de_create = new ic_disable_class(tmp, false, true);
			dis_users_de_create.toggle_force(inp.checked);
			inp.onclick = function() {
				dis_users_de_create.toggle_force(this.checked);
			}
		}
		
		tmp = document.getElementById("area_users_in_create");
		
		if (tmp != null) {
			inp = document.getElementById("users_in_create");
			var dis_users_in_create = new ic_disable_class(tmp, false, true);
			dis_users_in_create.toggle_force(inp.checked);
			inp.onclick = function() {
				dis_users_in_create.toggle_force(this.checked);
			}
		}
		
		tmp = document.getElementById("users_set_area");
		
		if (tmp != null) {
			inp = document.getElementById("users_set");
			var dis_users_set = new ic_disable_class(tmp, false, true);
			dis_users_set.toggle_force(inp.checked);
			inp.onclick = function() {
				dis_users_set.toggle_force(this.checked);
			}
		}
		
		tmp = document.getElementById("users_change_email_area");
		
		if (tmp != null) {
			inp = document.getElementById("users_change_email");
			var dis_users_change_email = new ic_disable_class(tmp);
			dis_users_change_email.toggle_force(inp.checked);
			inp.onclick = function() {
				dis_users_change_email.toggle_force(this.checked);
			}
		}

		tmp = document.getElementById("users_change_passwd_area");
		
		if (tmp != null) {
			inp = document.getElementById("users_change_passwd");
			var dis_users_change_passwd = new ic_disable_class(tmp);
			dis_users_change_passwd.toggle_force(inp.checked);
			inp.onclick = function() {
				dis_users_change_passwd.toggle_force(this.checked);
			}
		}
		
		tmp = document.getElementById("users_invoice_email_change_area");
		
		if (tmp != null) {
			inp = document.getElementById("users_invoice_email_change");
			var dis_users_invoice_email_change = new ic_disable_class(tmp);
			dis_users_invoice_email_change.toggle_force(inp.checked);
			inp.onclick = function() {
				dis_users_invoice_email_change.toggle_force(this.checked);
			}
		}
		
		tmp = document.getElementById("delivery_block");
		inp = inp_users_country;
		
		if (tmp != null && inp != null) {
			var delivery = new param_swap_class(tmp);
			delivery.construct();
			
			inp.onchange = function() { delivery.set_param(parseInt(this.options[this.selectedIndex].value)); }
			delivery.set_param(parseInt(inp.options[inp.selectedIndex].value))
		}
		
		var tmpb = document.getElementById("user_login_do_block");
		inp = document.getElementById("user_login_do");
		
		if (tmpb != null && inp != null) {
			inp.onclick = function() { tmpb.style.display = this.checked ? "block" : "none"; }
			tmpb.style.display = inp.checked ? "block" : "none";
		}
		
		btn = document.getElementById("infobox_image");
		tmp = document.getElementById("infobox_container");
		inp = document.getElementById("cart_count_input");
		
		if (btn != null && tmp != null && inp != null) {
			g_sbox = new store_infobox(btn, tmp, inp);
		}
		
		btn = document.getElementById("platform_image");
		tmp = document.getElementById("platform_container");
		
		if (btn != null && tmp != null) {
			var plnf = new infobox_handler(btn, tmp);
			plnf.construct_infobox();
		}
		
		var news_a = document.getElementById("area_news_a");
		var news_b = document.getElementById("area_news_b");
		var news_c = document.getElementById("area_news_c");
		
		if (news_a != null && news_b != null && news_c != null) {
			inp = document.getElementById("news_agree");
			
			var dis_area_a = new ic_disable_class(news_a, true);
			var dis_area_b = new ic_disable_class(news_b, true);
			var dis_area_c = new ic_disable_class(news_c, true);
			
			dis_area_a.toggle_force(inp.checked);
			dis_area_b.toggle_force(inp.checked);
			dis_area_c.toggle_force(inp.checked);
			
			inp.onclick = function() {
				dis_area_a.toggle_force(this.checked);
				dis_area_b.toggle_force(this.checked);
				dis_area_c.toggle_force(this.checked);
			}
		}
		
		var f, img = null, box = null, box_b = null;
		
		if ((box = document.getElementById("filter_box")) != null) {
			g_fh = new filter_handle(box);
		}
		if ((box = document.getElementById("main_img_list")) != null && (box_b = document.getElementById("main_img_space")) != null) {
			img = new image_list_class(box, box_b);
			img.construct();
		}
		if ((box = document.getElementById("error_box_main")) != null) {
			var wnd = new error_wnd();
			wnd.construct(box, "beru na vědomí");
		}
		if ((box = document.getElementById("info_box_main")) != null) {
			var wnd = new error_wnd();
			wnd.construct(box, "beru na vědomí", null, "error_box_float_info");
		}
		if ((box = document.getElementById("variant_level1no")) != null) {
			
			g_vlist = new ic_variant_list();
			var point = 1, brk = false;
			do {
				g_vlist.add_box(box);
				point++;
				box = document.getElementById("variant_level" + point + "no");
				if (!brk && box == null) {
					box = document.getElementById("cart_code_self_input");
					brk = true;
				}
			} while (box != null);
			
			var layer_ID = null, before_layer_ID = null;
			
			g_vlist.set_layer_element("product_layer_ID", "product_before_layer_ID");
			g_vlist.construct(before_layer_ID);
			
		} else if ((box = document.getElementById("cart_code_self_input")) != null) {
			if (box.tagName.toUpperCase() == "SELECT") {
				g_vlist = new ic_variant_list();
				g_vlist.add_box(box);
				
				g_vlist.set_layer_element("product_layer_ID", "product_before_layer_ID");
				g_vlist.construct();
			}
		}
		if ((box = document.getElementById("cart_panel")) != null) {
			g_cp = new cart_panel_class();
			g_cp.construct(box,
				document.getElementById("cart_panel_content"),
				document.getElementById("cart_submit_input"),
				document.getElementById("cart_code_self_input"),
				document.getElementById("cart_count_input"),
				document.getElementById("cart_panel_title"),
				document.getElementById("cart_panel_info"),
				document.getElementById("cart_panel_info2"),
				document.getElementById("cart_panel_price"),
				document.getElementById("cart_panel_price2")
			);
		}
		if ((box = document.getElementById("image_line")) != null && (box_b = document.getElementById("image_right")) != null) {
			g_isw = new image_swap_class(box, box_b);
			g_isw.construct();
		}
		// openable
		var hf, op = document.getElementsByTagName("DIV");
		for (f = 0; f < op.length; f++) {
			if (op[f].className == "openable openable_opened") {
				hf = op[f].getElementsByTagName("A");
				
				hf[0].onclick = hf[1].onclick = function() {
					var sf, sop = document.getElementsByTagName("DIV");
					for (sf = 0; sf < sop.length; sf++) 
						if (sop[sf] !== this.parentNode && sop[sf].className == "openable openable_opened") sop[sf].className = "openable";
					
					if (this.parentNode.className == "openable openable_opened") this.parentNode.className = "openable";
					else this.parentNode.className = "openable openable_opened";
				}
				
				op[f].className = "openable";
			}
		}
		
		// rest
		for (f = 0; f < g_lh.length; f++) {
			g_lh[f].construct();
		}
		
		g_fcl = new fav_class();
		
		if ((box = document.getElementById("item_list_container")) != null) g_fcl.add_container(box);
		
		g_sfcl = new fav_simple_class();
		
		inp = new block_list_class(document.getElementById("block_corner"));
		inp.add("action_block", null, null, true);
		inp.add("news_block", null, null, true);
		inp.construct();
		
		g_gp = new gallery_parser();
		g_gp.construct();
		
		motion();
		evt_page_load();
	}
	
	function evt_page_load() { }
	