
// f:event_manager.js
if (typeof addEvent != 'function' ) { var addEvent = function(o, t, f, l) { var d = 'addEventListener' , n = 'on' + t, rO = o, rT = t, rF = f, rL = l; if (o[d]&& !l)return o[d](t, f, false); if (!o._evts)o._evts =  {  }
; if (!o._evts[t]) { o._evts[t]= o[n]?  { b : o[n] }
:  {  }
; o[n]= new Function('e' , 'var r = true, o = this, a = o._evts["' + t + '"], i; for (i in a) {' + 'o._f = a[i]; r = o._f(e||window.event) != false && r; o._f = null;' + '} return r' ); if (t != 'unload' )addEvent(window, 'unload' , function() { removeEvent(rO, rT, rF, rL);  }
);  }
if (!f._i)f._i = addEvent._i++; o._evts[t][f._i]= f;  }
; addEvent._i = 1; var removeEvent = function(o, t, f, l) { var d = 'removeEventListener' ; if (o[d]&& !l)return o[d](t, f, false); if (o._evts && o._evts[t]&& f._i)delete o._evts[t][f._i];  }
;  }
function cancelEvent(e, c) { e.returnValue = false; if (e.preventDefault)e.preventDefault(); if (c) { e.cancelBubble = true; if (e.stopPropagation)e.stopPropagation();  }
 }
function clone_add(a, o) { for (var i in o)a[i]= o[i];  }

// f:structure.class.js
function structure_class_item(name, value) { this.next = null; this.last = null; this.parent = null; this.child = null; this.name = name; this.value = value;  }
structure_class_item.prototype.append_child = function(ref) { if (this.child == null) { this.child = ref; ref.parent = this;  }
else  { var loop = this.child; while (loop.next != null)loop = loop.next; loop.next = ref; ref.last = loop; ref.parent = this;  }
return ref;  }
structure_class_item.prototype.add_child = function(name, value) { return this.append_child(new structure_class_item(name, value));  }
structure_class_item.prototype.get_child = function(name) { var founded = false; var loop = this.child; while (!founded && loop != null) { if (loop.name == name)founded = true; else loop = loop.next;  }
return founded ? loop : null;  }
structure_class_item.prototype.destroy = function(force) { if (force == null) {  }
else  { var stack = new Array(); var current = null; var loop = null; stack[stack.length]= this; while (stack.length > 0) { current = stack.pop(); if (current.child == null) { current.last = null; current.next = null; if (current.parent != null && current.parent.child == current)current.parent.child = null; current.parent = null;  }
else  { stack[stack.length]= current; loop = current.child; while (loop != null) { stack[stack.length]= loop; loop = loop.next;  }
 }
 }
 }
 }
structure_class_item.prototype.matchEntity = function(string) { string = string.replace(/&/g,'&amp;' ); string = string.replace(/</g,'&lt;' ); string = string.replace(/>/g,'&gt;' ); string = string.replace(/'/g,'&apos;' ); string = string.replace(/"/g,'&quot;' ); return string;  }
structure_class_item.prototype.getXMLstring = function() { if (typeof this.value == 'string' ) { return this.matchEntity(this.value);  }
else return this.value;  }
function structure_class() { this.root = null; this.flush();  }
structure_class.prototype.flush = function() { if (this.root != null) { this.root.destroy(); this.root = null;  }
this.root = new structure_class_item();  }
structure_class.prototype.destroy = function() { this.flush(); context.object_destroy(this);  }
structure_class.prototype.path_parts = function(path) { var path_parts = new Array(); var point = 0; var cur_char = '' ; var cur_str = '' ; for (point = 0; point <= path.length; point++) { cur_char = point == path.length ? '/' : path.substr(point, 1); switch (cur_char) { case '/' : path_parts[path_parts.length]= cur_str; cur_str = '' ; break; default : cur_str += cur_char; break;  }
 }
return path_parts  }
structure_class.prototype.map = function(path, value) { var path_parts = this.path_parts(path); if (path_parts.length > 0) { var current = this.root; var child; var f; for (f = 0; f < path_parts.length; f++) { child = current.get_child(path_parts[f]); if (child == null) { child = new structure_class_item(path_parts[f], f + 1 == path_parts.length ? value : null); current.append_child(child);  }
else  { if (f + 1 == path_parts.length)child.value = value;  }
current = child;  }
return current;  }
return null;  }
structure_class.prototype.get = function(path) { var path_parts = this.path_parts(path); var founded = null; if (path_parts.length > 0) { var f; var founded = this.root; for (f = 0; f < path_parts.length && founded != null; f++)founded = founded.get_child(path_parts[f]);  }
return founded != null ? founded.value : null;  }
structure_class.prototype.compose = function(container_element) { var output = '<' + '?xml version="1.0" encoding="utf-8"?' + '><' + container_element + '>' ; var stack = new Array(); var opened = new Array(); var current, add, loop; stack[stack.length]= this.root; while (stack.length > 0) { current = stack.pop(); if (current != this.root) { var brk = false; var pos = opened.length - 1; while (!brk && pos >= 0) { if (opened[pos]== current.parent)brk = true; else pos--;  }
if (brk) { var max; for (max = opened.length - 1; max > pos; max--) { output += '</' + opened[max].name + '>' ; opened.pop();  }
 }
else  { var f; for (f = opened.length -1; f >= 0; f--) { output += '</' + opened[f].name + '>' ;  }
opened = new Array();  }
if (current.child != null) { output += '<' + current.name + '>' ; opened[opened.length]= current;  }
if (current.child == null) { output += '<' + current.name + '>' + current.getXMLstring()+ '</' + current.name + '>\r\n' ;  }
 }
if ((loop = current.child)!= null) { add = new Array(); while (loop != null) { add[add.length]= loop; loop = loop.next;  }
var f; for (f = add.length - 1; f >= 0; f--)stack[stack.length]= add[f];  }
 }
var f; for (f = opened.length - 1; f >= 0; f--) { output += '</' + opened[f].name + '>' ;  }
output += '</' + container_element + '>' ; return output;  }

// f:collection.class.js
function collection_list_item() { this.next = null; this.last = null; this.collection_parent = null;  }
function collection_list() { this.fisrt = null; this.end = null; this.count = 0;  }
collection_list.prototype.collection_exists = function(item) { var loop = this.first; while (loop != null && loop != item)loop = loop.next; return loop  }
collection_list.prototype.collection_add = function(item) { if (item.collection_parent == null) { if (this.first == null) { this.first = item; this.end = item; this.count++;  }
else  { this.end.next = item; item.last = this.end; this.end = item; this.count++;  }
item.collection_parent = this; return item;  }
else  { if (item.collection_parent == this)context.error("Cannot add to collection, item allready included here!" ); else context.error("Cannot add to collection, item allready included in other collection!" );  }
return null;  }
collection_list.prototype.collection_rem = function(item) { if (item.collection_parent == this) { if (item.last == null && item.next == null) { this.first = null; this.end = null;  }
else if (item.last == null) { this.first = this.first.next; this.first.last = null;  }
else if (item.next == null) { this.end = this.end.last; this.end.next = null;  }
else  { item.last.next = item.next; item.next.last = item.last;  }
item.collection_parent = null; item.next = null; item.last = null; this.count--; return item;  }
else  { context.error("Cannot remove, no such item in collection!" );  }
return null;  }
collection_list.prototype.collection_flush = function() { if (this.first != null) { var loop = this.first; var next = null; while (loop != null) { next = loop.next; loop = next;  }
this.first = null; this.last = null;  }
 }

// f:http_request.class.js
function http_request(parent, data, structure_root, keep) { this.inheritFrom = collection_list_item; this.inheritFrom(); this.inheritFrom = structure_class; this.inheritFrom(); this.parent = parent; this.data = data; this.keep = keep; this.request = null; this.evt_oncreate = null; this.evt_ondone = null; this.time_start = null; this.time_end = null; this.construct(structure_root);  }
clone_add(http_request.prototype, structure_class.prototype); http_request.prototype.construct = function(structure_root) { var self = this; if (window.ActiveXObject) { this.request = new ActiveXObject("Microsoft.XMLHTTP" );  }
else  { this.request = new XMLHttpRequest();  }
this.request.onreadystatechange = function() { self.state_changed();  }
if (structure_root == null) { this.flush();  }
else  { this.root = structure_root;  }
 }
http_request.prototype.destroy = function() { if (!this.keep)this.flush(); context.object_destroy(this);  }
http_request.prototype.state_changed = function() { switch (this.request.readyState) { case 4 : if (this.evt_ondone != null)this.evt_ondone(this.data, this); this.parent.dequeue(this); break;  }
 }
http_request.prototype.make = function() { if (this.parent != null) { if (this.evt_oncreate != null)this.evt_oncreate(this.data, this); this.request.open("POST" , this.parent.interface_ref, true); this.request.setRequestHeader("Content-Type" , "application/x-www-form-urlencoded" ); this.request.send(this.compose('request_data' )); if (this.request.overrideMimeType != null)this.request.overrideMimeType('text/xml' );  }
else  { context.error("Unable to process request, no parent collector specified!" );  }
 }
http_request.prototype.get_response = function() { xml = this.request.responseXML; if (xml != null) { if (xml.normalize != null)xml.normalize(); var head = xml.getElementsByTagName("head" )[0]; var body = xml.getElementsByTagName("body" )[0]; var f; if (head != null && body != null) { var error_flags = head.getElementsByTagName("error_flag" ); if (context.catch_error_flags(error_flags)) {  }
else  { var errors = head.getElementsByTagName("error" ); if (errors.length == 0) { return new Array(head, body);  }
else  { var error_str = "" ; for (f = 0; f < errors.length; f++) { if (f != 0)error_str += "\r\n" ; error_str += context.element_value(errors[f]);  }
context.error(error_str);  }
 }
 }
else  { context.error("Document does not contain base elements! output: " + this.request.responseText);  }
 }
else  { context.error("Invalid response document! output: " + this.request.responseText);  }
return null;  }
http_request.prototype.debug_data = function(show_res) { var put, head, major = null; if ((head = this.root.get_child("head" ))!= null)major = head.get_child("major" ); var compose = this.compose("request_data" ); compose = compose.split("<" ).join("&lt;" ); compose = compose.split(">" ).join("&gt;" ); put = "<tr>" ; put += "<td>" + (major == null ? "unknown" : major.value)+ "</td>" ; put += "<td>" + compose + "</td>" ; put += "<td>" + (this.time_end != null && this.time_start != null ? ("time: " + (this.time_end - this.time_start)): "running" )+ "</td>" ; var resp; if (!show_res)resp = "running" ; else  { var resp = this.request.responseText; resp = resp.split("<" ).join("&lt;" ); resp = resp.split(">" ).join("&gt;" );  }
put += "<td>" + resp + "</td>" ; put += "</tr>" ; return put;  }
function http_request_collector(interface_ref) { this.inheritFrom = collection_list; this.inheritFrom(); this.interface_ref = interface_ref; this.first = null; this.end = null; this.debug = false; this.debug_container = null; this.debug_history = null; this.debug_history_inner = null; this.construct();  }
clone_add(http_request_collector.prototype, collection_list.prototype); http_request_collector.prototype.construct = function() { if (this.debug) { this.debug_container = context.createElement("DIV" ); this.debug_container.style.padding = "20px" ; this.debug_history = context.createElement("DIV" ); this.debug_history.style.padding = "20px" ; this.debug_history.innerHTML = "<strong>request collector history</strong><br/><br/>" ; this.debug_history_inner = context.createElement("TABLE" ); this.debug_history_inner.border = 1; this.debug_history.appendChild(this.debug_history_inner); context.document_ref.body.appendChild(this.debug_container); context.document_ref.body.appendChild(this.debug_history);  }
 }
http_request_collector.prototype.debug_update = function(req, add_flag) { if (this.debug) { if (add_flag)req.time_start = (new Date()).getTime(); else req.time_end = (new Date()).getTime(); var put; put = "<strong>request collector debug</strong><br/><br/>" ; put += "active requests: " + this.count + "<br/><br/>" ; if (this.first != null) { put += "<table border='1'>" ; var loop = this.first; while (loop != null) { put += loop.debug_data(false); loop = loop.next;  }
put += "</table>" ;  }
this.debug_container.innerHTML = put; if (!add_flag)this.debug_history_inner.innerHTML += req.debug_data(true);  }
 }
http_request_collector.prototype.enqueue = function(data, evt_oncreate, evt_ondone, structure_root, keep) { var req = new http_request(this, data, structure_root, keep); req.evt_oncreate = evt_oncreate; req.evt_ondone = evt_ondone; this.enqueue_ref(req);  }
http_request_collector.prototype.enqueue_ref = function(req) { if (this.collection_add(req)!= null) { this.debug_update(req, true); req.make();  }
 }
http_request_collector.prototype.dequeue = function(req) { if ((req = this.collection_rem(req))!= null) { this.debug_update(req, false); req.destroy(); req = null;  }
else  { context.error("Unable to dequeue, nothing in request collector!" );  }
 }

// f:context.class.js
function context_class() { var self = this; this.collector = null; this.context = null; this.window_ref = window; this.document_ref = document; this.evt_destroy = null;  }
context_class.prototype.ifc_path = "http://perfecto-new.designplus.local/ifc.php" ; context_class.prototype.construct = function(widget_id, widget_ident) { this.collector = new http_request_collector(this.ifc_path);  }
context_class.prototype.destroy = function() { if (this.evt_destroy != null)this.evt_destroy();  }
context_class.prototype.createElement = function(input) { return this.document_ref.createElement(input);  }
context_class.prototype.confirm_wnd = function(message) { return confirm(message);  }
context_class.prototype.catch_error_flags = function(elms) { if (elms.length > 0) { for (f = 0; f < elms.length; f++) { switch (this.element_value(elms[f])) { case "unauthorized" : break;  }
 }
return true;  }
return false;  }
context_class.prototype.request = function(data, evt_oncreate, evt_ondone, structure) { this.collector.enqueue(data, evt_oncreate, evt_ondone, structure.root);  }
context_class.prototype.layerX = function(evt, pos) { if (evt.layerX)return evt.layerX; else return evt.clientX - pos;  }
context_class.prototype.layerY = function(evt, pos) { if (evt.layerY)return evt.layerY; else return evt.clientY - pos;  }
context_class.prototype.wnd_x = function() { var result = 0; if (typeof(this.window_ref.innerWidth)== 'number' )result = this.window_ref.innerWidth; else if (this.document_ref.documentElement && (this.document_ref.documentElement.clientWidth || this.document_ref.documentElement.clientHeight))result = this.document_ref.documentElement.clientWidth; else if (this.document_ref.body && (this.document_ref.body.clientWidth || this.document_ref.body.clientHeight))result = this.document_ref.body.clientWidth; return result;  }
context_class.prototype.wnd_y = function() { var result = 0; if (typeof(this.window_ref.innerWidth)== 'number' )result = this.window_ref.innerHeight; else if (this.document_ref.documentElement && (this.document_ref.documentElement.clientWidth || this.document_ref.documentElement.clientHeight))result = this.document_ref.documentElement.clientHeight; else if (this.document_ref.body && (this.document_ref.body.clientWidth || this.document_ref.body.clientHeight))result = this.document_ref.body.clientHeight; return result;  }
context_class.prototype.get_scX = function() { var a = this.document_ref.body.scrollLeft; var b = this.document_ref.documentElement.scrollLeft; return a != 0 ? a : b;  }
context_class.prototype.get_scY = function() { var a = this.document_ref.body.scrollTop; var b = this.document_ref.documentElement.scrollTop; return a != 0 ? a : b;  }
context_class.prototype.get_elementX = function(ref) { var loop = ref; var out = 0; while (loop != null) { out += loop.offsetLeft; loop = loop.offsetParent;  }
return out;  }
context_class.prototype.get_elementY = function(ref) { var loop = ref; var out = 0; while (loop != null) { out += loop.offsetTop; loop = loop.offsetParent;  }
return out;  }
context_class.prototype.get_elementWidth = function(ref) { return ref.offsetWidth;  }
context_class.prototype.get_elementHeight = function(ref) { return ref.offsetHeight;  }
context_class.prototype.get_parent_index = function(ref) { var founded = false; var pos = 0; while (!founded && pos < ref.parentNode.childNodes.length)if (ref.parentNode.childNodes[pos]=== ref)founded = true; else pos++; return founded ? pos : null;  }
context_class.prototype.center_by = function(target, source) { var sX = this.get_elementX(source); var sY = this.get_elementY(source); var sW = this.get_elementWidth(source); var sH = this.get_elementHeight(source); var tW = this.get_elementWidth(target); var tH = this.get_elementHeight(target); var pX = sW > tW ? (sX + (sW - tW)/2): sX; var pY = sH > tH ? (sY + (sH - tH)/2): sY; target.style.position = "absolute" ; target.style.left = pX + "px" ; target.style.top = pY + "px" ;  }
context_class.prototype.element_value = function(ref) { return ref.firstChild == null ? '' : ref.firstChild.nodeValue;  }
context_class.prototype.element_value_null = function(ref) { return ref.firstChild == null ? null : ref.firstChild.nodeValue;  }
context_class.prototype.sub_element_value = function(ref, name) { var subs = ref.getElementsByTagName(name); if (subs != null && subs.length > 0)return this.element_value(subs[0]); return "" ;  }
context_class.prototype.sub_element_value_null = function(ref, name) { var subs = ref.getElementsByTagName(name); if (subs != null && subs.length > 0)return this.element_value_null(subs[0]); return null;  }
context_class.prototype.error = function(value) {  }
context_class.prototype.object_create = function(ref) { return ref;  }
context_class.prototype.object_destroy = function(ref) {  }
context_class.prototype.path_explode = function(input) { var out = new Array(); var f, ch, last = '' , len = input.length; for (f = 0; f <= len; f++) { ch = f == len ? '/' : input.substr(f, 1); switch (ch) { case '/' : if (last != '' )out[out.length]= last; last = '' ; break; default : last += ch; break;  }
 }
return out;  }
context_class.prototype.purge = function(d) { var a = d.attributes, i, l, n; if (a) { l = a.length; for (i = 0; i < l; i++) { n = a[i].name; if (typeof d[n]=== 'function' )d[n]= null;  }
 }
 }
context_class.prototype.structure_destroy = function(ref) { if (ref != null) { var stack = new Array(); var current, f; stack[stack.length]= ref; while (stack.length > 0) { current = stack.pop(); if (current.childNodes != null && current.childNodes.length > 0) { stack[stack.length]= current; for (f = 0; f < current.childNodes.length; f++)stack[stack.length]= current.childNodes[f];  }
else  { this.purge(current); if (current.parentNode != null)current.parentNode.removeChild(current);  }
 }
 }
 }
context_class.prototype.object_destroy = function(ref) { for (var i in ref) { ref[i]= null;  }
 }

// f:image.box.class.js
function image_box_node(parent, href, key) { this.parent = parent; this.href = href; this.key = key; this.src = null;  }
image_box_node.prototype.construct = function() { var self = this; this.src = this.href.href; this.href.href = "javascript:void(0)" ; this.href.onclick = function(trgEvent) { cancelEvent(trgEvent == null ? window.event : trgEvent); self.parent.open_gallery(self.key, self); return false;  }
 }
function image_box_collector() { var self = this; this.galleries = new Array(); this.overlay = null; this.loader = null; this.is_loaded = false; this.panel = null; this.close_box = null; this.arrow_left = null; this.arrow_right = null; this.title = null; this.info = null; this.img = null; this.width = null; this.height = null; this.open_key = null; this.open_item = null; this._onresize = function() { self.position();  }
this._onscroll = function() { self.position();  }
 }
image_box_collector.prototype.construct = function() { var self = this; this.loader = document.createElement("IMG" ); this.loader.onload = function() { if (self.o_ds == null)self.evt_loader();  }
var f, c, elms = document.getElementsByTagName("A" ); for (f = 0; f < elms.length; f++) { c = elms[f]; if (c.rel != null && c.rel.length > 8 && c.rel.substr(0, 8)== "lightbox" ) { var start = c.rel.indexOf("[" ); var end = c.rel.indexOf("]" ); if (start > 0 && end > 0) { var key = c.rel.substr(start + 1, end - start - 1); if (this.galleries[key]== null)this.galleries[key]= new Array(); this.galleries[key][this.galleries[key].length]= new image_box_node(this, c, key);  }
 }
 }
var key; for (key in this.galleries) { this.complete_gallery(this.galleries[key]);  }
 }
image_box_collector.prototype.complete_gallery = function(gallery) { var f; for (f = 0; f < gallery.length; f++) { gallery[f].construct();  }
 }
image_box_collector.prototype.get_item_stat = function(key, item) { var gallery = this.galleries[key]; if (gallery != null) { var founded = false; var pos = 0; while (!founded && pos < gallery.length)if (gallery[pos]=== item)founded = true; else pos++; if (founded) { var ret = new Array(); ret["key" ]= key; ret["item" ]= item; ret["gallery" ]= gallery; ret["index" ]= pos; ret["count" ]= gallery.length; ret["prev" ]= pos == 0 ? null : gallery[pos - 1]; ret["next" ]= pos == gallery.length - 1 ? null : gallery[pos + 1]; return ret;  }
 }
return null;  }
image_box_collector.prototype.open_gallery = function(key, item) { if (this.open_key == null) { var self = this; var stat = this.get_item_stat(key, item); if (stat != null) { this.open_key = stat["key" ]; this.open_item = stat["item" ]; this.width = null; this.height = null; addEvent(window, "resize" , this._onresize); addEvent(window, "scroll" , this._onscroll); this.overlay = document.createElement("DIV" ); this.overlay.className = "overlay" ; this.panel = document.createElement("DIV" ); this.panel.className = "image_box" ; this.close_box = document.createElement("A" ); this.close_box.href = "javascript:void(0)" ; this.close_box.innerHTML = "<span>&nbsp;</span>" ; this.close_box.className = "image_box_close" ; this.close_box.onclick = function() { self.close_gallery(); return false;  }
this.arrow_left = document.createElement("A" ); this.arrow_left.href = "javascript:void(0)" ; this.arrow_left.innerHTML = "<span>&nbsp;</span>" ; this.arrow_left.className = "image_box_left" ; this.arrow_left.onclick = function() { self.go_prev(); return false;  }
this.arrow_left.style.display = "none" ; this.arrow_right = document.createElement("A" ); this.arrow_right.href = "javascript:void(0)" ; this.arrow_right.innerHTML = "<span>&nbsp;</span>" ; this.arrow_right.className = "image_box_right" ; this.arrow_right.onclick = function() { self.go_next(); return false;  }
this.arrow_right.style.display = "none" ; this.img = document.createElement("IMG" ); this.img.style.display = "none" ; this.img.className = "image_box_img" ; this.img.onclick = function() { self.close_gallery(); return false;  }
this.title = document.createElement("P" ); this.title.innerHTML = "" ; this.title.className = "image_box_title" ; this.title.style.display = "none" ; this.info = document.createElement("P" ); this.info.innerHTML = "loading ... " ; this.info.className = "image_box_info" ; this.panel.appendChild(this.close_box); this.panel.appendChild(this.arrow_left); this.panel.appendChild(this.arrow_right); this.panel.appendChild(this.img); this.panel.appendChild(this.title); this.panel.appendChild(this.info); document.body.appendChild(this.overlay); document.body.appendChild(this.panel); this.position(); this.gallery_load(stat["item" ]);  }
 }
 }
image_box_collector.prototype.evt_loader = function() { if (this.open_key != null) { var stat = this.get_item_stat(this.open_key, this.open_item); if (stat != null) { this.arrow_left.style.display = stat["prev" ]== null ? "none" : "block" ; this.arrow_right.style.display = stat["next" ]== null ? "none" : "block" ; this.title.style.display = "block" ; this.title.innerHTML = "<strong>" + stat["item" ].href.title + "</strong>" ; this.info.style.display = "none" ; this.is_loaded = true; this.img.style.width = "auto" ; this.img.style.height = "auto" ; this.img.style.display = "block" ; this.img.alt = stat["item" ].href.title; this.img.src = this.loader.src; this.position();  }
 }
 }
image_box_collector.prototype.gallery_load = function(item) { if (this.open_key != null) { var stat = this.get_item_stat(this.open_key, item); if (stat != null) { this.open_item = stat["item" ]; this.arrow_left.style.display = "none" ; this.arrow_right.style.display = "none" ; this.title.style.display = "none" ; this.info.style.display = "block" ; this.img.style.display = "none" ; this.is_loaded = false; this.loader.src = stat["item" ].src; this.position();  }
 }
 }
image_box_collector.prototype.go_prev = function() { if (this.open_key != null) { var stat = this.get_item_stat(this.open_key, this.open_item); if (stat != null && stat["prev" ]!= null) { this.gallery_load(stat["prev" ]);  }
 }
 }
image_box_collector.prototype.go_next = function() { if (this.open_key != null) { var stat = this.get_item_stat(this.open_key, this.open_item); if (stat != null && stat["next" ]!= null) { this.gallery_load(stat["next" ]);  }
 }
 }
image_box_collector.prototype.close_gallery = function() { if (this.open_key != null) { this.open_key = null; this.open_item = null; removeEvent(window, "resize" , this._onresize); removeEvent(window, "scroll" , this._onscroll); context.structure_destroy(this.panel); context.structure_destroy(this.overlay);  }
 }
image_box_collector.prototype.position = function() { var off_width = document.body.offsetWidth; var off_height = document.body.offsetHeight; var im_width = context.get_elementWidth(this.img); var im_height = context.get_elementHeight(this.img); if (this.width == null || this.height == null) { this.width = 200; this.height = 200; this.panel.style.width = this.width + "px" ; this.panel.style.height = this.height + "px" ;  }
else if (im_width != 0 && im_height != 0 && this.is_loaded) { this.panel.style.width = "auto" ; this.panel.style.height = "auto" ; this.width = context.get_elementWidth(this.panel); this.height = context.get_elementHeight(this.panel); var wx = context.wnd_x(); var wy = context.wnd_y(); if (wx < this.width || wy < this.height) { var koef_w = wx /wy; var koef_p = this.width /this.height; var koef_im = im_width /im_height; var resWidth = true; if (koef_w >= 1) { if (koef_p > koef_w)resWidth = true; else resWidth = false;  }
else  { if (koef_p < koef_w)resWidth = false; else resWidth = true;  }
if (resWidth) { var rest = (this.width - im_width)+ 40; if (rest < 0)rest = 0; var tm_x = Math.round(wx - rest); var tm_y = Math.round(tm_x /koef_im); if (tm_x < im_width && tm_y < im_height) { this.img.style.width = tm_x + "px" ; this.img.style.height = tm_y + "px" ; this.width = context.get_elementWidth(this.panel); this.height = context.get_elementHeight(this.panel);  }
 }
else  { var rest = (this.height - im_height)+ 40; if (rest < 0)rest = 0; var tm_y = Math.round(wy - rest); var tm_x = Math.round(tm_y * koef_im); if (tm_x < im_width && tm_y < im_height) { this.img.style.width = tm_x + "px" ; this.img.style.height = tm_y + "px" ; this.width = context.get_elementWidth(this.panel); this.height = context.get_elementHeight(this.panel);  }
 }
 }
 }
else if (!this.is_loaded) { this.panel.style.width = (this.width - 90)+ "px" ; this.panel.style.height = (this.height - 90)+ "px" ;  }
var left = Math.round((off_width - this.width)/2); var top = Math.round((context.wnd_y()- this.height)/2)+ context.get_scY(); this.overlay.style.width = off_width + "px" ; this.overlay.style.height = off_height + "px" ; this.panel.style.left = left + "px" ; this.panel.style.top = top + "px" ; this.info.style.top = Math.round(this.height /2 - context.get_elementHeight(this.info)/2)+ "px" ; this.arrow_left.style.top = Math.round(this.height /2 - context.get_elementHeight(this.arrow_left)/2)+ "px" ; this.arrow_right.style.top = Math.round(this.height /2 - context.get_elementHeight(this.arrow_right)/2)+ "px" ;  }

// f:title.image.swapper.js
function title_image_swapper(ref, claim, inst) { this.items = new Array(); this.ref = ref; this.claim = claim; this.refb = null; this.inst = inst; this.step = null; this.loader = null; this.timeout = null; this.interval = 8000; this.fade_k = 0; this.fade_timeout = null;  }
title_image_swapper.prototype.add_image = function(src, title) { var nd = new Array(); nd["src" ]= src; nd["title" ]= title; this.items[this.items.length]= nd;  }
title_image_swapper.prototype.construct = function(random, initial_step) { this.step = typeof initial_step == 'undefined' ? -1 : initial_step; if (random)this.step = Math.round(Math.random()* (this.items.length - 1)); this.loader = document.createElement("IMG" ); this.goto_step(true); var self = this;  }
title_image_swapper.prototype.goto = function(index) { if (index >= 0 && index < this.items.length && index != this.step) { this.step = index; var self = this; this.loader.onload = function() { self.evt_goto();  }
this.loader.src = this.items[this.step]["src" ]; if (this.claim != null)this.claim.innerHTML = "<p>" + this.items[this.step]["title" ]+ "<p>" ;  }
 }
title_image_swapper.prototype.evt_goto = function() { this.loader.onload = null; if (this.refb == null) { this.refb = document.createElement("IMG" ); this.ref.parentNode.appendChild(this.refb);  }
this.refb.src = this.loader.src; var tmp = this.refb; this.refb = this.ref; this.ref = tmp; if (this.fade_timeout != null)clearTimeout(this.fade_timeout); this.fade_k = 0; if (document.all) { this.ref.style.filter = "alpha(opacity=0)" ; this.refb.style.filter = "alpha(opacity=100)" ;  }
else  { this.ref.style.opacity = "0.0" ; this.refb.style.opacity = "1.0" ;  }
this.ref.style.display = "block" ; this.refb.style.display = "block" ; this.fade_step();  }
title_image_swapper.prototype.goto_step = function(wait) { if (!wait)this.goto(this.step + 1 < this.items.length ? this.step + 1 : 0); this.timeout = setTimeout(this.inst + ".goto_step()" , this.interval);  }
title_image_swapper.prototype.fade_step = function() { if (this.fade_k < 100) { this.fade_k += 10; if (this.fade_k >= 100) { if (document.all) { this.ref.style.filter = "alpha(opacity=100)" ;  }
else  { this.ref.style.opacity = "1.0" ;  }
this.refb.style.display = "none" ;  }
else  { if (document.all) { this.ref.style.filter = "alpha(opacity=" + Math.round(this.fade_k)+ ")" ; this.refb.style.filter = "alpha(opacity=" + Math.round(100 - this.fade_k)+ ")" ;  }
else  { this.ref.style.opacity = (this.fade_k /100); this.refb.style.opacity = (100 - this.fade_k)/100;  }
 }
this.fade_timeout = setTimeout(this.inst + ".fade_step()" , 50);  }
 }
title_image_swapper.prototype.force_goto_step = function() { if (this.timeout != null) { clearTimeout(this.timeout); this.goto_step();  }
 }

// f:global.js
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.caption = 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): "" ); this.container.style.display = "block" ; 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.caption = caption; this.div = document.createElement("DIV" ); this.div.className = "button" ; if (typeof caption == 'string' ) { this.input = document.createElement("INPUT" ); this.input.type = "button" ; this.input.className = "fbutt" ; this.input.value = caption; this.input.onclick = function() { self.done();  }
this.div.appendChild(this.input); 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);  }
 }
else  { this.input = new Array(); var key; for (key in caption) { this.input[key]= document.createElement("INPUT" ); this.input[key].type = "button" ; this.input[key].className = "fbutt" ; this.input[key].value = key; if (caption[key]== null) { this.input[key].onclick = function() { self.done();  }
 }
else  { this.input[key].onclick = function() { document.location.href = self.caption[this.value];  }
 }
this.div.appendChild(this.input[key]);  }
 }
this.overlay = document.createElement("DIV" ); this.overlay.className = "overlay" ; 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 = "" ; this.container.style.display = "none" ; context.structure_destroy(this.div); context.structure_destroy(this.overlay); 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" ;  }
function bubble_class(inner, inst) { this.ref = null; this.container = null; this.inner = inner; this.inst = inst; this.timeout = null;  }
bubble_class.prototype.construct = function() { var self = this; this.container = document.createElement("DIV" ); this.container.className = "bubble" ; this.container.innerHTML = "<p>" + this.inner + "</p>" ; this.container.style.display = "none" ; this.container.onmouseout = function(trgEvent) { if (self.o_ds == null)self.evt_over(trgEvent == null ? window.event : trgEvent);  }
document.body.appendChild(this.container);  }
bubble_class.prototype.destroy = function() { context.structure_destroy(this.container); context.object_destroy(this);  }
bubble_class.prototype.open = function(ref) { if (this.timeout != null)clearTimeout(this.timeout); if (this.ref != null)this.ref.onmouseout = null; var self = this; this.ref = ref; this.ref.onmouseout = function(trgEvent) { if (self.o_ds == null)self.evt_over(trgEvent == null ? window.event : trgEvent);  }
this.container.style.left = (context.get_elementX(this.ref)- 10)+ "px" ; this.container.style.top = (context.get_elementY(this.ref)- 65)+ "px" ; this.container.style.display = "block" ;  }
bubble_class.prototype.close = function() { if (this.ref != null)this.ref.onmouseout = null; this.container.style.display = "none" ;  }
bubble_class.prototype.evt_over = function(evt) { var target = evt.toElement == null ? evt.relatedTarget : evt.toElement; while (target != null && target != this.container)target = target.parentNode; if (target == null) { if (this.timeout != null)clearTimeout(this.timeout); this.timeout = setTimeout(this.inst + ".close()" , 1000);  }
 }
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 shop_click(ref, href, event) { if (ref.tagName.toUpperCase()== "A" ) { var f, founded = null, current, stack = new Array(); stack[0]= ref.parentNode.parentNode; while (founded == null && stack.length > 0) { current = stack.pop(); if (current.tagName.toUpperCase()== "INPUT" && current.type == "text" )founded = 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];  }
 }
if (founded != null) { var val = parseInt(founded.value); if (isNaN(val))val = 1; if (val <= 1)val = 1; document.location.href = href + "/" + val; return false;  }
 }
else if (ref.tagName.toUpperCase()== "INPUT" ) { if (event.keyCode == 13) { var val = parseInt(ref.value); if (isNaN(val))val = 1; if (val <= 1)val = 1; document.location.href = href + "/" + val; return false;  }
 }
return true;  }
var g_dcol; function g_set_lang(lang) {  }
function do_print() { window.print();  }
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 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) { var founded = box; while (founded != null && founded.tagName.toUpperCase()!= "FORM" )founded = founded.parentNode; if (founded != null) { addEvent(founded, "submit" , function() { if (box.value == dtext)box.value = "" ;  }
);  }
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() { evt_body_load_final();  }
function evt_body_load_final() { context = new context_class(); context.construct(); var box, href; 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("term_table" ))!= null) { var tt = new date_table_node(null, box); tt.construct();  }
var iCol = new image_box_collector(); iCol.construct(); iSwp_init(); motion(); evt_page_load();  }
function evt_page_load() {  }

// f:shadow.block.class.js
function shadow_block_class() { this.shadows = null; this.shadow_size = 15;  }
shadow_block_class.prototype.shadow_context = function() { return this.context == null ? context : this.context;  }
shadow_block_class.prototype.shadow_container = function() { return this.container;  }
shadow_block_class.prototype.shadows_destroy = function() { if (this.shadows != null) { var f; for (f = this.shadows.length - 1; f >= 0; f--) { this.shadow_context().structure_destroy(this.shadows[f]); this.shadows[f]= null;  }
this.shadows = null;  }
 }
shadow_block_class.prototype.shadow_width = function() { return 0;  }
shadow_block_class.prototype.shadow_height = function() { return 0;  }
shadow_block_class.prototype.shadows_build = function() { var create; if (create = (this.shadows == null))this.shadows = new Array(); var s_x = new Array(0, this.shadow_size, this.shadow_width(), this.shadow_width()+ this.shadow_size); var s_y = new Array(0, this.shadow_size, this.shadow_height(), this.shadow_height()+ this.shadow_size); var f, sx, sy, sw, sh, el; var cont = this.shadow_container(); for (f = 0; f < 3; f++) { sx = s_x[2]; sy = s_y[f]; sw = s_x[3]- s_x[2]; sh = s_y[f + 1]- s_y[f]; if (create) { el = this.shadow_context().createElement("DIV" ); el.style.position = "absolute" ; el.style.left = sx + "px" ; el.style.top = sy + "px" ; el.style.width = sw + "px" ; el.style.height = sh + "px" ; el.style.fontSize = "1px" ; switch (f) { case 0 : if (document.all)el.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/web/perfecto/gfx/sh_right_top.png')" ; else el.style.background = "url('/web/perfecto/gfx/sh_right_top.png')" ; break; case 1 : if (document.all)el.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/web/perfecto/gfx/sh_right.png',sizingMethod='scale')" ; else el.style.background = "url('/web/perfecto/gfx/sh_right.png')" ; break; case 2 : if (document.all)el.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/web/perfecto/gfx/sh_bottom_right.png')" ; else el.style.background = "url('/web/perfecto/gfx/sh_bottom_right.png')" ; break;  }
cont.appendChild(el); this.shadows[this.shadows.length]= el;  }
else  { el = this.shadows[f]; el.style.left = sx + "px" ; el.style.top = sy + "px" ; el.style.width = sw + "px" ; el.style.height = sh + "px" ; el.style.fontSize = "1px" ;  }
 }
for (f = 1; f >= 0; f--) { sx = s_x[f]; sy = s_y[2]; sw = s_x[f + 1]- s_x[f]; sh = s_y[3]- s_y[2]; if (create) { el = this.shadow_context().createElement("DIV" ); el.style.position = "absolute" ; el.style.left = sx + "px" ; el.style.top = sy + "px" ; el.style.width = sw + "px" ; el.style.height = sh + "px" ; el.style.fontSize = "1px" ; switch (f) { case 1 : if (document.all)el.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/web/perfecto/gfx/sh_bottom.png',sizingMethod='scale')" ; else el.style.background = "url('/web/perfecto/gfx/sh_bottom.png')" ; break; case 0 : if (document.all)el.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/web/perfecto/gfx/sh_bottom_left.png')" ; else el.style.background = "url('/web/perfecto/gfx/sh_bottom_left.png')" ; break;  }
cont.appendChild(el); this.shadows[this.shadows.length]= el;  }
else  { el = this.shadows[3 + (1 - f)]; el.style.left = sx + "px" ; el.style.top = sy + "px" ; el.style.width = sw + "px" ; el.style.height = sh + "px" ; el.style.fontSize = "1px" ;  }
 }
 }

