// Core code from - quirksmode.org

//

function getPageScroll(){



	var yScroll;



	if (self.pageYOffset) {

		yScroll = self.pageYOffset;

	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict

		yScroll = document.documentElement.scrollTop;

	} else if (document.body) {// all other Explorers

		yScroll = document.body.scrollTop;

	}



	arrayPageScroll = new Array('',yScroll) 

	return arrayPageScroll;

}

//

// getPageSize()

// Returns array with page width, height and window width, height

// Core code from - quirksmode.org

// Edit for Firefox by pHaez

//

function getPageSize(){

	

	var xScroll, yScroll;

	

	if (window.innerHeight && window.scrollMaxY) {	

		xScroll = document.body.scrollWidth;

		yScroll = window.innerHeight + window.scrollMaxY;

	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac

		xScroll = document.body.scrollWidth;

		yScroll = document.body.scrollHeight;

	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari

		xScroll = document.body.offsetWidth;

		yScroll = document.body.offsetHeight;

	}

	

	var windowWidth, windowHeight;

	if (self.innerHeight) {	// all except Explorer

		windowWidth = self.innerWidth;

		windowHeight = self.innerHeight;

	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode

		windowWidth = document.documentElement.clientWidth;

		windowHeight = document.documentElement.clientHeight;

	} else if (document.body) { // other Explorers

		windowWidth = document.body.clientWidth;

		windowHeight = document.body.clientHeight;

	}	

	

	// for small pages with total height less then height of the viewport

	if(yScroll < windowHeight){

		pageHeight = windowHeight;

	} else { 

		pageHeight = yScroll;

	}



	// for small pages with total width less then width of the viewport

	if(xScroll < windowWidth){	

		pageWidth = windowWidth;

	} else {

		pageWidth = xScroll;

	}





	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 

	return arrayPageSize;

}

function pokaz (id_obrazka) {

  var spod = document.getElementById("spod");

  var obrazek = document.getElementById("obrazek");

  var arrayPageScroll = getPageScroll();

  var podklad = document.getElementById("podklad");

  var arrayPageSize = getPageSize();

  obrazek.src = id_obrazka;

  spod.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 500) / 2) + 'px');

  /*spod.style.left = (((arrayPageSize[0] - 500) / 2) + 'px');*/

  spod.style.display = "block";

  podklad.style.display = "block";

  podklad.style.height = (arrayPageSize[1]+100) + 'px';

}

function ukryj (id_powiekszenia) {

  var spod = document.getElementById("spod");

  var podklad = document.getElementById("podklad");

  spod.style.display = "none";

  podklad.style.display = "none";

}

function podswietl () {

  var acer = document.getElementById("acer");

  acer.onmouseover = function () { zmien ('acer', 'pokaz'); }

  acer.onmouseout = function () { zmien ('acer', 'schowaj'); }

  var apple = document.getElementById("apple");

  apple.onmouseover = function () { zmien ('apple', 'pokaz'); }

  apple.onmouseout = function () { zmien ('apple', 'schowaj'); }

  var asus = document.getElementById("asus");

  asus.onmouseover = function () { zmien ('asus', 'pokaz'); }

  asus.onmouseout = function () { zmien ('asus', 'schowaj'); }

  var compaq = document.getElementById("compaq");

  compaq.onmouseover = function () { zmien ('compaq', 'pokaz'); }

  compaq.onmouseout = function () { zmien ('compaq', 'schowaj'); }

  var dell = document.getElementById("dell");

  dell.onmouseover = function () { zmien ('dell', 'pokaz'); }

  dell.onmouseout = function () { zmien ('dell', 'schowaj'); }

  var fsiemens = document.getElementById("fsiemens");

  fsiemens.onmouseover = function () { zmien ('fsiemens', 'pokaz'); }

  fsiemens.onmouseout = function () { zmien ('fsiemens', 'schowaj'); }

  var hp = document.getElementById("hp");

  hp.onmouseover = function () { zmien ('hp', 'pokaz'); }

  hp.onmouseout = function () { zmien ('hp', 'schowaj'); }

  var ibm = document.getElementById("ibm");

  ibm.onmouseover = function () { zmien ('ibm', 'pokaz'); }

  ibm.onmouseout = function () { zmien ('ibm', 'schowaj'); }

  var itronix = document.getElementById("itronix");

  itronix.onmouseover = function () { zmien ('itronix', 'pokaz'); }

  itronix.onmouseout = function () { zmien ('itronix', 'schowaj'); }

  var lenovo = document.getElementById("lenovo");

  lenovo.onmouseover = function () { zmien ('lenovo', 'pokaz'); }

  lenovo.onmouseout = function () { zmien ('lenovo', 'schowaj'); }

  var lexmark = document.getElementById("lexmark");

  lexmark.onmouseover = function () { zmien ('lexmark', 'pokaz'); }

  lexmark.onmouseout = function () { zmien ('lexmark', 'schowaj'); }

  var panasonic = document.getElementById("panasonic");

  panasonic.onmouseover = function () { zmien ('panasonic', 'pokaz'); }

  panasonic.onmouseout = function () { zmien ('panasonic', 'schowaj'); }

  var sony = document.getElementById("sony");

  sony.onmouseover = function () { zmien ('sony', 'pokaz'); }

  sony.onmouseout = function () { zmien ('sony', 'schowaj'); }

  var toshiba = document.getElementById("toshiba");

  toshiba.onmouseover = function () { zmien ('toshiba', 'pokaz'); }

  toshiba.onmouseout = function () { zmien ('toshiba', 'schowaj'); }

}

function zmien (co, akcja) {

  var marki = document.getElementById(co);

  if (akcja == 'pokaz') {

    marki.style.opacity = '1.0';

    marki.style.filter = 'alpha(opacity=100)';

  }

  if (akcja == 'schowaj') {

    marki.style.opacity = '0.3';

    marki.style.filter = 'alpha(opacity=30)';

  }

}

function schedule () {

  otworz = window.open('schedule.php', 'schedule', 'menubar=no, toolbar=no, location=no, scrollbars=no, resizable=no, status=no, width=500, height=550').focus();

}

function newsletter_zamknij () {
  document.getElementById("newsletter_duzy").style.display = "none";
}

window.onload = podswietl;

