function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}

function nospam() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") && anchor.getAttribute("rel")=="mail")
anchor.href = anchor.getAttribute("href").replace('(at)','@');
}
}


function allBlur() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href"))
anchor.onfocus = function(){this.blur();};
}
} 

	  //////////////////////////////////////
      // Romulo do Nascimento Ferreira    //
      //   romulo.nf@gmail.com      //
      //////////////////////////////////////

      function makeSlideShow(holder,speed,width,height) {
      gallery = document.getElementById(holder)
      gallery.style.width = width + "px"
      gallery.style.height = height + "px"
      gallery.style.cssFloat = "center"

      this.alphaShow = 0
      this.alphaFade = 100
      this.currentImg = 0
      this.animationSpeed = speed
      this.images = gallery.getElementsByTagName("img")
      this.galleryLength = this.images.length

          for (x=0; x<this.galleryLength; x++) {
		//this.images[x].style.width = width + "px"
		//this.images[x].style.height = height + "px"
          this.images[x].style.position = "absolute"
          this.images[x].style.filter = "alpha(opacity=0)"
          this.images[x].style.opacity = "0"
          this.images[x].style.mozOpacity = "0"
          }
      var _this = this
      var startShow = window.setInterval(function(){_this.engine()},this  .animationSpeed*10)
      }
      makeSlideShow.prototype.engine = function() {
      this.nextImage = this.currentImg + 1 < this.galleryLength ? this.currentImg + 1 : 0
      this.images[this.currentImg].style.filter = "alpha(opacity=" + this.alphaFade + ")";
      this.images[this.currentImg].style.opacity = this.alphaFade < 10? "0.0" + this.alphaFade : this.alphaFade >= 10 && this.alphaFade < 100 ? "0." + this.alphaFade : 1.0;
      this.images[this.currentImg].style.mozOpacity = this.alphaFade < 10? "0.0" + this.alphaFade : this.alphaFade >= 10 && this.alphaFade < 100 ? "0." + this.alphaFade : 1.0;
      this.images[this.nextImage].style.filter = "alpha(opacity=" + this.alphaShow + ")";
      this.images[this.nextImage].style.opacity = this.alphaShow < 10? "0.0" + this.alphaShow : this.alphaShow >= 10 && this.alphaShow < 100 ? "0." + this.alphaShow : 1.0;
      this.images[this.nextImage].style.mozOpacity = this.alphaShow < 10? "0.0" + this.alphaShow : this.alphaShow >= 10 && this.alphaShow < 100 ? "0." + this.alphaShow : 1.0;
      this.alphaFade = this.alphaFade - 2
      this.alphaShow = this.alphaShow + 2
          if (this.alphaFade == 100 || this.alphaShow == 100) {
          this.alphaFade = 100
          this.alphaShow = 0
          this.currentImg = this.currentImg + 1 > this.galleryLength-1 ? 0 : this.currentImg + 1
          }
      }


function ustawWysokosc() {
wys_left = document.getElementById("content_left");
wys_right = document.getElementById("content_right");
offsetHeight_1 = document.getElementById("content_left").scrollHeight;
offsetHeight_2 = document.getElementById("content_right").scrollHeight;
if(offsetHeight_2 > offsetHeight_1) {
wys_left.style.height = offsetHeight_2 + "px";
}
else {
wys_right.style.height = offsetHeight_1 + "px";
}
}


function zaladujFunkcje() {
externalLinks(); 
allBlur();
nospam();
if(document.getElementById("content_left")!=null) {ustawWysokosc();}
//new makeSlideShow('box-nasi-klienci',4,200,100);
//document.getElementById('box-nasi-klienci').style.display = 'block';
}


window.onload = zaladujFunkcje; 