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 iframeLinks() {
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") == "sprzedaz_maszyn")
anchor.target = "sprzedaz_maszyn";
}
}

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();};
}
} 

/*******************************************************************
 * soopa-rollovers.js
 * 7/28/2001
 * www.youngpup.net
 *
 * easiest rollovers on earth, baby!
 * see www.youngpup.net for documentation.
 *******************************************************************/


/*function menuLoad() {
	var img, sh, sn, sd
	for (var i = 0; (img = document.images[i]); i++) {
		if (img.getAttribute("alt")=="menutop") {

			sn = img.getAttribute("src");
			sh = img.getAttribute("alt");

			if (sn != "" && sn != null) {
				img.n = new Image();
				img.n.src = img.src;
			
				if (sh != "" && sh != null) {
					img.h = new Image();
					img.h.src = sh;
					img.onmouseover = menuOn
					img.onmouseout  = menuOff
				}

			}
		}
	}
}

function menuOn() {
	this.src = this.h.src;
}

function menuOff() {
	this.src  = this.n.src;
}
*/

	  //////////////////////////////////////
      // 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("span")
      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
          }
      }

/***********************************************
* Cross browser Marquee II- C Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}




function zaladujFunkcje() {
externalLinks(); 
iframeLinks();
allBlur();
nospam();
if(document.getElementById('marqueecontainer')) {
if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee
}
//menuLoad();
//if(document.getElementById('oferty_specjalne_bok')) {
//new makeSlideShow('oferty_specjalne_bok',4,124,50);
//document.getElementById('oferty_specjalne_bok').style.display = 'block';
//}
}

window.onload = zaladujFunkcje; 

		function setIframeHeight(iframeName) {
		  //var iframeWin = window.frames[iframeName];
		  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
		  if (iframeEl) {
		  iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous
		  //var docHt = getDocHeight(iframeWin.document);
		  // need to add to height to be sure it will all show
		  var h = alertSize();
		  var new_h = (h-148);
		  iframeEl.style.height = new_h + "px";
		  //alertSize();
		  }
		}

		function alertSize() {
		  var myHeight = 0;
		  if( typeof( window.innerWidth ) == 'number' ) {
		    //Non-IE
		    myHeight = window.innerHeight;
		  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		    //IE 6+ in 'standards compliant mode'
		    myHeight = document.documentElement.clientHeight;
		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		    //IE 4 compatible
		    myHeight = document.body.clientHeight;
		  }
		  //window.alert( 'Height = ' + myHeight );
		  return myHeight;
		}