function hidestatus(){
window.status=':: WEB by MNK ::'
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus


function mbOnMouseOver(item_id) {
    var imgObj = document.getElementById('mb_' + item_id);
    imgObj.src = 'images/menu-' + item_id + '-1.gif';
}

function mbOnMouseOut(item_id) {
    var imgObj = document.getElementById('mb_' + item_id);
    imgObj.src = 'images/menu-' + item_id + '-0.gif';
}


function otvor(pURL, oWidthNum, oHeightNum) {
	var yWidthNum = (oWidthNum == '') ? 710 : parseInt(oWidthNum) + 18;
	var yHeightNum = (oHeightNum == '') ? 610 : parseInt(oHeightNum) + 20;
	window.open(pURL, "ln", "left=30, top=30, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=" + yWidthNum + ", height=" + yHeightNum);
}


function okno(pURL, pWidthNum, pHeightNum) {
	var lWidthNum = (pWidthNum == '') ? 710 : parseInt(pWidthNum) + 50;
	var lHeightNum = (pHeightNum == '') ? 610 : parseInt(pHeightNum) + 60;
	window.open(pURL, "ln", "left=30, top=30, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=" + lWidthNum + ", height=" + lHeightNum);
}

function slideokno(sURL, sWidthNum, sHeightNum) {
	var xWidthNum = (sWidthNum == '') ? 710 : parseInt(sWidthNum) + 20;
	var xHeightNum = (sHeightNum == '') ? 610 : parseInt(sHeightNum) + 20;
	window.open(sURL, "ln", "left=2, top=2, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=" + xWidthNum + ", height=" + xHeightNum);
}


// JAVASCRIPT: galeria

var newwindow;
var wheight = 0, wwidth = 0;

function foto(url, title, iwidth, iheight) {
var pwidth, pheight, twidth;

if ( !newwindow || newwindow.closed ) {
pwidth=iwidth+30;
pheight=iheight+54;
twidth=iwidth+2;
newwindow=window.open('','htmlname','width=' + pwidth +',height=' + pheight + ',resizable=0,top=5,left=30');
wheight=iheight;
wwidth=iwidth;
}

if (wheight!=iheight || wwidth!=iwidth ) {
pwidth=iwidth+30;
pheight=iheight+90;
twidth=iwidth+2;
newwindow.resizeTo(pwidth, pheight);
wheight=iheight;
wwidth=iwidth;
}

newwindow.document.clear();
newwindow.focus();
newwindow.document.writeln('<title>:: galeria | WEB by MNK ::<\/title>');
newwindow.document.writeln('<link rel=\"StyleSheet\" type=\"text/css\" href=\"http://www.manik.sk/manik.css\">');
newwindow.document.writeln('<body bgcolor=\"C5C5C5\"> <center>');
newwindow.document.writeln('<a href=\"javascript:window.close()\"><img src=\"' + url + '\" style=\"border: 1px solid #000000;\" border=\"0\"><\/a>');
newwindow.document.writeln('<table class=\"fototabulka\" width=\"' + twidth + '\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor="\E0E0E0\"><tr><td align=\"left\">' + title + '<\/td><td align=\"right\">/ GALERIA by MNK | <a href=\"javascript:window.close()\" class=\"link3\">[zavriet]</a><\/td><\/tr><\/table>');
newwindow.document.writeln('<\/center><\/body>');
newwindow.document.close();
newwindow.focus();
}

// JAVASCRIPT: mapa

var mnewwindow;
var mwheight = 0, mwwidth = 0;

function mapa(url, title, miwidth, miheight) {
var mpwidth, mpheight, mtwidth;

if ( !mnewwindow || mnewwindow.closed ) {
mpwidth=miwidth+30;
mpheight=miheight+54;
mtwidth=miwidth+2;
mnewwindow=window.open('','htmlname','width=' + mpwidth +',height=' + mpheight + ',resizable=0, top=5,left=30');
mwheight=miheight;
mwwidth=miwidth;
}

if (mwheight!=miheight || mwwidth!=miwidth ) {
mpwidth=miwidth+30;
mpheight=miheight+90;
mtwidth=miwidth+2;
mnewwindow.resizeTo(mpwidth, mpheight);
mwheight=miheight;
mwwidth=miwidth;
}

mnewwindow.document.clear();
mnewwindow.focus();
mnewwindow.document.writeln('<title>:: mapa | WEB by MNK ::<\/title>');
mnewwindow.document.writeln('<link rel=\"StyleSheet\" type=\"text/css\" href=\"http://www.manik.sk/manik.css\">');
mnewwindow.document.writeln('<body bgcolor=\"C5C5C5\"> <center>');
mnewwindow.document.writeln('<iframe src=\"' + url + '\" width=600 height=600 class="ramik"><\/iframe><br>');
mnewwindow.document.writeln('<font style=\"font-size: 2px\"><br></font><table class=\"fototabulka\" width=\"' + mtwidth + '\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor="\E0E0E0\"><tr><td align=\"left\">' + title + '<\/td><td align=\"right\">/ MAP by MNK | <a href=\"javascript:window.close()\" class=\"link3\">[zavriet]</a><\/td><\/tr><\/table>');
mnewwindow.document.writeln('<\/center><\/body>');
mnewwindow.document.close();
mnewwindow.focus();
}

// JAVASCRIPT: flash

var fnewwindow;
var fwheight = 0, fwwidth = 0;

function flash(url, title, fiwidth, fiheight) {
var fpwidth, fpheight, ftwidth;

if ( !fnewwindow || fnewwindow.closed ) {
fpwidth=fiwidth+30;
fpheight=fiheight+54;
ftwidth=fiwidth+2;
fnewwindow=window.open('','htmlname','width=' + fpwidth +',height=' +fpheight + ',resizable=0,top=5,left=30');
fwheight=fiheight;
fwwidth=fiwidth;
}

if (fwheight!=fiheight || fwwidth!=fiwidth ) {
fpwidth=fiwidth+30;
fpheight=fiheight+90;
ftwidth=fiwidth+2;
fnewwindow.resizeTo(fpwidth, fpheight);
fwheight=fiheight;
fwwidth=fiwidth;
}

fnewwindow.document.clear();
fnewwindow.focus();
fnewwindow.document.writeln('<title>:: flash | WEB by MNK ::<\/title>');
fnewwindow.document.writeln('<link rel=\"StyleSheet\" type=\"text/css\" href=\"http://www.manik.sk/manik.css\">');
fnewwindow.document.writeln('<body bgcolor=\"C5C5C5\"><center>');
fnewwindow.document.writeln('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"' + fiwidth + '\" height=\"' + fiheight + '\" align=\"center\" class=\"ramik\">');
fnewwindow.document.writeln('<param name=\"movie\" value=\"' + url + '\">');
fnewwindow.document.writeln('<param name=\"play\" value=\"true\">');
fnewwindow.document.writeln('<embed src=\"' + url + '\" width=\"' + fiwidth + '\" height=\"' + fiheight + '\" class=\"ramik\"></embed>');
fnewwindow.document.writeln('<\/object>');
fnewwindow.document.writeln('<font style=\"font-size: 5px\"><br></font><font style=\"font-size: 3px\"><br></font><table class=\"fototabulka\" width=\"' + ftwidth + '\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor="\E0E0E0\"><tr><td align=\"left\">' + title + '<\/td><td align=\"right\">/ FLASH by MNK | <a href=\"javascript:window.close()\" class=\"link3\">[zavriet]</a><\/td><\/tr><\/table>');
fnewwindow.document.writeln('<\/center><\/body>');

fnewwindow.document.close();
fnewwindow.focus();
}

// JAVASCRIPT: video

var vfnewwindow;
var vfwheight = 0, vfwwidth = 0;

function video(url, title, vfiwidth, vfiheight) {
var vfpwidth, vfpheight, vftwidth;

if ( !vfnewwindow || vfnewwindow.closed ) {
vfpwidth=vfiwidth+30;
vfpheight=vfiheight+54;
vftwidth=vfiwidth+2;
vfnewwindow=window.open('','htmlname','width=' + vfpwidth +',height=' +vfpheight + ',resizable=0,top=5,left=30');
vfwheight=vfiheight;
vfwwidth=vfiwidth;
}

if (vfwheight!=vfiheight || vfwwidth!=vfiwidth ) {
vfpwidth=vfiwidth+30;
vfpheight=vfiheight+90;
vftwidth=vfiwidth+2;
vfnewwindow.resizeTo(vfpwidth, vfpheight);
vfwheight=vfiheight;
vfwwidth=vfiwidth;
}

vfnewwindow.document.clear();
vfnewwindow.focus();
vfnewwindow.document.writeln('<title>:: video | WEB by MNK ::<\/title>');
vfnewwindow.document.writeln('<link rel=\"StyleSheet\" type=\"text/css\" href=\"http://www.manik.sk/manik.css\">');
vfnewwindow.document.writeln('<body bgcolor=\"C5C5C5\"><center>');
vfnewwindow.document.writeln('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"' + vfiwidth + '\" height=\"' + vfiheight + '\" align=\"center\" class=\"ramik2\">');
vfnewwindow.document.writeln('<param name=\"movie\" value=\"player.swf?file=' + url + '&overstretch=true&showfsbutton=false&fullscreenmode=false&autostart=true&showeq=false&logo=../images/manik.gif" />');
vfnewwindow.document.writeln('<param name=\"quality\" value=\"high\">');
vfnewwindow.document.writeln('<param name=\"menu\" value=\"false\">');
vfnewwindow.document.writeln('<param name=\"wmode\" value=\"\">');
vfnewwindow.document.writeln('<param name=\"play\" value=\"true\">');
vfnewwindow.document.writeln('<embed src=\"player.swf?file=' + url + '&overstretch=true&showfsbutton=false&fullscreenmode=false&autostart=true&showeq=false&logo=../images/manik.gif" wmode=\"\" quality=\"high\" menu=\"false\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"' + vfiwidth + '\" height=\"' + vfiheight + '\"></embed>');
vfnewwindow.document.writeln('<\/object>');
vfnewwindow.document.writeln('<font style=\"font-size: 5px\"><br></font><font style=\"font-size: 3px\"><br></font><table class=\"fototabulka\" width=\"' + vftwidth + '\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor="\E0E0E0\"><tr><td align=\"left\">' + title + '<\/td><td align=\"right\">/ VIDEO by MNK | <a href=\"javascript:window.close()\" class=\"link3\">[zavriet]</a><\/td><\/tr><\/table>');
vfnewwindow.document.writeln('<\/center><\/body>');

vfnewwindow.document.close();
vfnewwindow.focus();
}

// JAVASCRIPT: panorama

var pfnewwindow;
var pfwheight = 0, pfwwidth = 0;

function panorama(url, title, pfiwidth, pfiheight) {
var pfpwidth, pfpheight, pftwidth;

if ( !pfnewwindow || pfnewwindow.closed ) {
pfpwidth=930;
pfpheight=574;
pftwidth=902;
pfnewwindow=window.open('','htmlname','width=' + pfpwidth +',height=' +pfpheight + ',resizable=0,top=5,left=30');
pfwheight=pfiheight;
pfwwidth=pfiwidth;
}

if (pfwheight!=pfiheight || pfwwidth!=pfiwidth ) {
pfpwidth=pfiwidth+30;
pfpheight=pfiheight+90;
pftwidth=pfiwidth+2;
pfnewwindow.resizeTo(pfpwidth, pfpheight);
pfwheight=pfiheight;
pfwwidth=pfiwidth;
}

pfnewwindow.document.clear();
pfnewwindow.focus();
pfnewwindow.document.writeln('<title>:: panorama | WEB by MNK ::<\/title>');
pfnewwindow.document.writeln('<link rel=\"StyleSheet\" type=\"text/css\" href=\"http://www.manik.sk/manik.css\">');
pfnewwindow.document.writeln('<body bgcolor=\"C5C5C5\">');
pfnewwindow.document.writeln('<div align=\"center\"><div style=\"position: relative; width: 900px; height: 520px; overflow-x: scroll;\">');
pfnewwindow.document.writeln('<a href=\"javascript:window.close()\" class=\"panorama\"><img src=\"' + url + '\" width=\"' + pfiwidth +'\" height=\"' + pfiheight +'\" border="0"></a>');
pfnewwindow.document.writeln('<\/div><\/div><\/table>');
pfnewwindow.document.writeln('<font style=\"font-size: 4px\"><br></font><font style=\"font-size: 3px\"><br></font><table class=\"fototabulka\" width=\"' + pftwidth + '\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor="\E0E0E0\"><tr><td align=\"left\">' + title + '<\/td><td align=\"right\">/ PANORMA by MNK | <a href=\"javascript:window.close()\" class=\"link3\">[zavriet]</a><\/td><\/tr><\/table>');
pfnewwindow.document.writeln('<\/center><\/body>');

pfnewwindow.document.close();
pfnewwindow.focus();
}

// JAVASCRIPT: slideshow

function slide(src,link,text,target,attr) {
  this.src = src;
  this.link = link;
  this.text = text;
  this.target = target;
  this.attr = attr;
  if (document.images) {
    this.image = new Image();
  }

  this.loaded = false;

  this.load = function() {

    if (!document.images) { return; }

    if (!this.loaded) {
      this.image.src = this.src;
      this.loaded = true;
    }
  }

}

function slideshow( slideshowname ) {
  this.name = slideshowname;
  this.repeat = true;
  this.prefetch = -1;
  this.image;
  this.textid;
  this.textarea;
  this.timeout = 5000;
  this.slides = new Array();
  this.current = 0;
  this.timeoutid = 0;

  this.add_slide = function(slide) {
  
    var i = this.slides.length;
    if (this.prefetch == -1) {
      slide.load();
    }

    this.slides[i] = slide;
  }


  this.play = function(timeout) {
    this.pause();
    if (timeout) {
      this.timeout = timeout;
    }
    if (typeof this.slides[ this.current ].timeout != 'undefined') {
      timeout = this.slides[ this.current ].timeout;
    } else {
      timeout = this.timeout;
    }

    this.timeoutid = setTimeout( this.name + ".loop()", timeout);
  }

  this.pause = function() {
    if (this.timeoutid != 0) {
      clearTimeout(this.timeoutid);
      this.timeoutid = 0;
    }
  }


  this.update = function() {
    if (! this.valid_image()) { return; }
    if (typeof this.pre_update_hook == 'function') {
      this.pre_update_hook();
    }
    var slide = this.slides[ this.current ];
    var dofilter = false;
    if (this.image &&
        typeof this.image.filters != 'undefined' &&
        typeof this.image.filters[0] != 'undefined') {

      dofilter = true;

    }
    slide.load();
    if (dofilter) {
      if (slide.filter &&
          this.image.style &&
          this.image.style.filter) {

        this.image.style.filter = slide.filter;

      }
      this.image.filters[0].Apply();
    }
    this.image.src = slide.image.src;

    if (dofilter) {
      this.image.filters[0].Play();
    }
    this.display_text();

    if (typeof this.post_update_hook == 'function') {
      this.post_update_hook();
    }

    if (this.prefetch > 0) {

      var next, prev, count;

      next = this.current;
      prev = this.current;
      count = 0;
      do {
        if (++next >= this.slides.length) next = 0;
        if (--prev < 0) prev = this.slides.length - 1;


        this.slides[next].load();
        this.slides[prev].load();


      } while (++count < this.prefetch);
    }
  }

  this.goto_slide = function(n) {
  
    if (n == -1) {
      n = this.slides.length - 1;
    }
  
    if (n < this.slides.length && n >= 0) {
      this.current = n;
    }
  
    this.update();
  }

  this.goto_random_slide = function(include_current) {

    var i;

    if (this.slides.length > 1) {

      do {
        i = Math.floor(Math.random()*this.slides.length);
      } while (i == this.current);
 
      this.goto_slide(i);
    }
  }


  this.next = function() {
    if (this.current < this.slides.length - 1) {
      this.current++;
    } else if (this.repeat) {
      this.current = 0;
    }

    this.update();
  }


  this.previous = function() {
    if (this.current > 0) {
      this.current--;
    } else if (this.repeat) {
      this.current = this.slides.length - 1;
    }
  
    this.update();
  }

  this.shuffle = function() {


    var i, i2, slides_copy, slides_randomized;
    slides_copy = new Array();
    for (i = 0; i < this.slides.length; i++) {
      slides_copy[i] = this.slides[i];
    }

    slides_randomized = new Array();

    do {

      i = Math.floor(Math.random()*slides_copy.length);

      slides_randomized[ slides_randomized.length ] =
        slides_copy[i];

      for (i2 = i + 1; i2 < slides_copy.length; i2++) {
        slides_copy[i2 - 1] = slides_copy[i2];
      }
      slides_copy.length--;

    } while (slides_copy.length);

    this.slides = slides_randomized;
  }


  this.get_text = function() {
  
    return(this.slides[ this.current ].text);
  }


  this.get_all_text = function(before_slide, after_slide) {
  
    all_text = "";
  
    for (i=0; i < this.slides.length; i++) {
  
      slide = this.slides[i];
    
      if (slide.text) {
        all_text += before_slide + slide.text + after_slide;
      }
  
    }
  
    return(all_text);
  }

  this.display_text = function(text) {
    if (!text) {
      text = this.slides[ this.current ].text;
    }
  
    if (this.textarea && typeof this.textarea.value != 'undefined') {
      this.textarea.value = text;
    }

    if (this.textid) {

      r = this.getElementById(this.textid);
      if (!r) { return false; }
      if (typeof r.innerHTML == 'undefined') { return false; }

      r.innerHTML = text;
    }
  }

  this.save_position = function(cookiename) {
  
    if (!cookiename) {
      cookiename = this.name + '_slideshow';
    }
  
    document.cookie = cookiename + '=' + this.current;
  }


  this.restore_position = function(cookiename) {
  
    if (!cookiename) {
      cookiename = this.name + '_slideshow';
    }
  
    var search = cookiename + "=";
  
    if (document.cookie.length > 0) {
      offset = document.cookie.indexOf(search);

      if (offset != -1) { 
        offset += search.length;

        end = document.cookie.indexOf(";", offset);

        if (end == -1) end = document.cookie.length;
        this.current = parseInt(unescape(document.cookie.substring(offset, end)));
        }
     }
  }



  this.noscript = function() {
  
    $html = "\n";
  
    for (i=0; i < this.slides.length; i++) {
  
      slide = this.slides[i];
  
      $html += '<P>';
  
      if (slide.link) {
        $html += '<a href="' + slide.link + '">';
      }
  
      $html += '<img src="' + slide.src + '" >';
  
      if (slide.link) {
        $html += "<\/a>";
      }
  
      if (slide.text) {
        $html += "<BR>\n" + slide.text;
      }
  
      $html += "<\/P>" + "\n\n";
    }
  

    $html = $html.replace(/\&/g, "&amp;" );
    $html = $html.replace(/</g, "&lt;" );
    $html = $html.replace(/>/g, "&gt;" );
  
    return('<pre>' + $html + '</pre>');
  }


  this.loop = function() {

    if (this.current < this.slides.length - 1) {
      next_slide = this.slides[this.current + 1];
      if (next_slide.image.complete == null || next_slide.image.complete) {
        this.next();
      }
    } else { 
      this.next();
    }
    
    this.play( );
  }

  this.valid_image = function() {
  
    if (!this.image)
    {
      return false;
    }
    else {
      return true;
    }
  }

  this.getElementById = function(element_id) {

    if (document.getElementById) {
      return document.getElementById(element_id);
    }
    else if (document.all) {
      return document.all[element_id];
    }
    else if (document.layers) {
      return document.layers[element_id];
    } else {
      return undefined;
    }
  }
  
  this.set_image = function(imageobject) {

    if (!document.images)
      return;
    this.image = imageobject;
  }

  this.set_textarea = function(textareaobject) {
    this.textarea = textareaobject;
    this.display_text();
  }

  this.set_textid = function(textidstr) {

    this.textid = textidstr;
    this.display_text();
  }
}


