function CaHelpInterface(map) {
this.map = map; // map interface object
this.contentId;
this.helpItems;
this.currentPage;
this.pageCount;
this.blockTitle;
this.isOn;
this.pOnClose;
this._create = function() {
this.contentId = 'infoblock_help';
this.attachEvents();
}
this.initialize = function() {
this.isOn = false;
this.currentPage = 0;
this.pageCount = 0;
this.blockTitle = '';
this.pOnClose = jQuery.proxy(this.onClose, this);;
this.attachEvents();
}
this.refresh = function() {
if (this.helpItems[this.currentPage]) {
var html = "
" + this.helpItems[this.currentPage] + "
";
html+= "";
html+= this.blockTitle;
for (var x = 0; x < this.pageCount; x++) {
if (x == this.currentPage) {
html+= "
" + (x + 1) + " ";
} else {
html+= "
" + (x + 1) + " ";
}
}
html+= "
";
document.getElementById("infoblock_help_obsah").innerHTML = html;
}
}
this.setPage = function(p) {
this.currentPage = p;
this.refresh();
return false;
}
this.setItems = function(items) {
this.helpItems = items;
}
this.onClickFlip = function() {
this.flip();
return false;
}
this.flip = function() {
if (!this.isOn) {
this.show();
} else {
this.hide();
}
}
this.show = function() {
this.map.cCaInfoBox.openInfoBox(this.contentId, this.pOnClose);
this.refresh();
this.isOn = true;
}
this.hide = function() {
this.map.cCaInfoBox.hideInfoBox();
}
this.onClose = function() {
this.isOn = false;
}
this.attachEvents = function() {
}
this._create();
this.initialize();
}