var Fotki= new Array(Array());
var Foty= new Array(Array());


Fotki[0]=Array('images/jpgbreloki/1_brelok_fa.jpg',
'images/jpgbreloki/2_brelok_samolot.jpg',
'images/jpgbreloki/3_brelok_west.jpg',
'images/jpgbreloki/4_brelok_mitsubishi.jpg',
'images/jpgbreloki/5_brelok_zywiec.jpg',
'images/jpgbreloki/6_brelok_kks_lech.jpg',
'images/jpgbreloki/7_brelok_samochod.jpg',
'images/jpgbreloki/8_brelok_volvo.jpg',
'images/jpgbreloki/9_brelok_lodz.jpg',
'images/jpgbreloki/10_brelok_kolo.jpg');

Fotki[1]=Array('images/jpglogotypy/1logotyp_heineken.jpg',
'images/jpglogotypy/2logotyp_zywiec.jpg',
'images/jpglogotypy/3logotyp_bjj.jpg',
'images/jpglogotypy/4logotyp_tyskie.jpg',
'images/jpglogotypy/5logotyp_smirnoff.jpg',
'images/jpglogotypy/6logotyp_brok.jpg',
'images/jpglogotypy/7logotyp_debowe.jpg',
'images/jpglogotypy/8logotyp_lezajsk.jpg',
'images/jpglogotypy/9logotyp_pilsner.jpg',
'images/jpglogotypy/10logotyp_globalwood.jpg');

Fotki[2]=Array('images/jpgmedale/1medal_turniej_karate.jpg',
'images/jpgmedale/2medal_danone.jpg',
'images/jpgmedale/3medal_ump.jpg',
'images/jpgmedale/4medal_wrestling.jpg',
'images/jpgmedale/5medal_top_agrar.jpg',
'images/jpgmedale/6medal_rzezba_pzar.jpg',
'images/jpgmedale/7medal_ep.jpg',
'images/jpgmedale/8medal_radom.jpg',
'images/jpgmedale/9medal_szpital_warta.jpg',
'images/jpgmedale/10medal_parafia_kolo.jpg');

Fotki[3]=Array('images/jpgodznaki/1_odznaka_whitefalcon.jpg',
'images/jpgodznaki/2_odznaka_wenecja_motor_festiwal.jpg',
'images/jpgodznaki/3_odznaka_zlot_lubasz.jpg',
'images/jpgodznaki/4_odznaka_miller.jpg',
'images/jpgodznaki/5_odznaka_dawidoff.jpg',
'images/jpgodznaki/6_odznaka_lo.jpg',
'images/jpgodznaki/7_odznaka_ds_logic.jpg',
'images/jpgodznaki/8_odznaka_kreisel.jpg',
'images/jpgodznaki/9_odznaka_scala.jpg',
'images/jpgodznaki/10_odznaka_pzw.jpg');

Fotki[4]=Array('images/jpgstatuetki/1_statuetka_skrzydla.jpg',
'images/jpgstatuetki/2_statuetka_klucz.jpg',
'images/jpgstatuetki/3_statuetka_pieczec_UMP.jpg',
'images/jpgstatuetki/4_statuetka_samolot.jpg',
'images/jpgstatuetki/5_statuetka_cegielski.jpg',
'images/jpgstatuetki/6_statuetka_kurpik.jpg',
'images/jpgstatuetki/7_statuetka_samochod.jpg',
'images/jpgstatuetki/8_statuetka_chata_zbojcow.jpg',
'images/jpgstatuetki/9_statuetka_ptwk.jpg',
'images/jpgstatuetki/10_statuetka_samolot.jpg');

Fotki[5]=Array('images/jpgotwieracze/1_otwieracz_zywiec.jpg',
'images/jpgotwieracze/2_otwieracz_kujawiak.jpg',
'images/jpgotwieracze/3_otwieracz_EB.jpg',
'images/jpgotwieracze/4_otwieracz_redds.jpg',
'images/jpgotwieracze/5_otwieracz-zywiec.jpg',
'images/jpgotwieracze/6_otwieracz_debowe.jpg',
'images/jpgotwieracze/7_otwieracz_peroni.jpg',
'images/jpgotwieracze/8_otwieracz_zywiec.jpg',
'images/jpgotwieracze/9_otwieracz_zubr.jpg',
'images/jpgotwieracze/10_otwieracz_zywiec.jpg');

Fotki[6]=Array('images/jpgkarabinczyki/01_karabinczyk.jpg',
'images/jpgkarabinczyki/02_karabinczyk.jpg',
'images/jpgkarabinczyki/03_karabinczyk.jpg',
'images/jpgkarabinczyki/04_karabinczyk.jpg',
'images/jpgkarabinczyki/05_karabinczyk.jpg',
'images/jpgkarabinczyki/06_karabinczyk.jpg',
'images/jpgkarabinczyki/07_karabinczyk.jpg',
'images/jpgkarabinczyki/08_karabinczyk.jpg',
'images/jpgkarabinczyki/09_karabinczyk.jpg',
'images/jpgkarabinczyki/10_karabinczyk.jpg');

Fotki[7]=Array('images/jpgklamry/01_klamra.jpg',
'images/jpgklamry/02_klamra.jpg',
'images/jpgklamry/03_klamra.jpg',
'images/jpgklamry/04_klamra.jpg',
'images/jpgklamry/05_klamra.jpg',
'images/jpgklamry/06_klamra.jpg',
'images/jpgklamry/07_klamra.jpg',
'images/jpgklamry/08_klamra.jpg',
'images/jpgklamry/09_klamra.jpg',
'images/jpgklamry/10_klamra.jpg');

Foty[0]=Array('images/jpgbreloki/1b_brelok_fa.jpg',
'images/jpgbreloki/2b_brelok_samolot.jpg',
'images/jpgbreloki/3b_brelok_west.jpg',
'images/jpgbreloki/4b_brelok_mitsubishi.jpg',
'images/jpgbreloki/5b_brelok_zywiec.jpg',
'images/jpgbreloki/6b_brelok_kks_lech.jpg',
'images/jpgbreloki/7b_brelok_samochod.jpg',
'images/jpgbreloki/8b_brelok_volvo.jpg',
'images/jpgbreloki/9b_brelok_lodz.jpg',
'images/jpgbreloki/10b_brelok_kolo.jpg');

Foty[1]=Array('images/jpglogotypy/1blogotyp_heineken.jpg',
'images/jpglogotypy/2blogotyp_zywiec.jpg',
'images/jpglogotypy/3blogotyp_bjj.jpg',
'images/jpglogotypy/4blogotyp_tyskie.jpg',
'images/jpglogotypy/5blogotyp_smirnoff.jpg',
'images/jpglogotypy/6blogotyp_brok.jpg',
'images/jpglogotypy/7blogotyp_debowe.jpg',
'images/jpglogotypy/8blogotyp_lezajsk.jpg',
'images/jpglogotypy/9blogotyp_pilsner.jpg',
'images/jpglogotypy/10blogotyp_globalwood.jpg');

Foty[2]=Array('images/jpgmedale/1bmedal_turniej_karate.jpg',
'images/jpgmedale/2bmedal_danone.jpg',
'images/jpgmedale/3bmedal_ump.jpg',
'images/jpgmedale/4bmedal_wrestling.jpg',
'images/jpgmedale/5bmedal_top_agrar.jpg',
'images/jpgmedale/6bmedal_rzezba_pzar.jpg',
'images/jpgmedale/7bmedal_ep.jpg',
'images/jpgmedale/8bmedal_radom.jpg',
'images/jpgmedale/9bmedal_szpital_warta.jpg',
'images/jpgmedale/10bmedal_parafia_kolo.jpg');

Foty[3]=Array('images/jpgodznaki/1b_odznaka_whitefalcon.jpg',
'images/jpgodznaki/2b_odznaka_wenecja_motor_festiwal.jpg',
'images/jpgodznaki/3b_odznaka_zlot_lubasz.jpg',
'images/jpgodznaki/4b_odznaka_miller.jpg',
'images/jpgodznaki/5b_odznaka_dawidoff.jpg',
'images/jpgodznaki/6b_odznaka_lo.jpg',
'images/jpgodznaki/7b_odznaka_ds_logic.jpg',
'images/jpgodznaki/8b_odznaka_kreisel.jpg',
'images/jpgodznaki/9b_odznaka_scala.jpg',
'images/jpgodznaki/10b_odznaka_pzw.jpg');

Foty[4]=Array('images/jpgstatuetki/1b_statuetka_skrzydla.jpg',
'images/jpgstatuetki/2b_statuetka_klucz.jpg',
'images/jpgstatuetki/3b_statuetka_pieczec_UMP.jpg',
'images/jpgstatuetki/4b_statuetka_samolot.jpg',
'images/jpgstatuetki/5b_statuetka_cegielski.jpg',
'images/jpgstatuetki/6b_statuetka_kurpik.jpg',
'images/jpgstatuetki/7b_statuetka_samochod.jpg',
'images/jpgstatuetki/8b_statuetka_chata_zbojcow.jpg',
'images/jpgstatuetki/9b_statuetka_ptwk.jpg',
'images/jpgstatuetki/10b_statuetka_samolot.jpg');

Foty[5]=Array('images/jpgotwieracze/1b_otwieracz_zywiec.jpg',
'images/jpgotwieracze/2b_otwieracz_kujawiak.jpg',
'images/jpgotwieracze/3b_otwieracz_EB.jpg',
'images/jpgotwieracze/4b_otwieracz_redds.jpg',
'images/jpgotwieracze/5b_otwieracz-zywiec.jpg',
'images/jpgotwieracze/6b_otwieracz_debowe.jpg',
'images/jpgotwieracze/7b_otwieracz_peroni.jpg',
'images/jpgotwieracze/8b_otwieracz_zywiec.jpg',
'images/jpgotwieracze/9b_otwieracz_zubr.jpg',
'images/jpgotwieracze/10b_otwieracz_zywiec.jpg');

Foty[6]=Array('images/jpgkarabinczyki/01_karabinczyk_b.jpg',
'images/jpgkarabinczyki/02_karabinczyk_b.jpg',
'images/jpgkarabinczyki/03_karabinczyk_b.jpg',
'images/jpgkarabinczyki/04_karabinczyk_b.jpg',
'images/jpgkarabinczyki/05_karabinczyk_b.jpg',
'images/jpgkarabinczyki/06_karabinczyk_b.jpg',
'images/jpgkarabinczyki/07_karabinczyk_b.jpg',
'images/jpgkarabinczyki/08_karabinczyk_b.jpg',
'images/jpgkarabinczyki/09_karabinczyk_b.jpg',
'images/jpgkarabinczyki/10_karabinczyk_b.jpg');

Foty[7]=Array('images/jpgklamry/01b_klamra.jpg',
'images/jpgklamry/02b_klamra.jpg',
'images/jpgklamry/03b_klamra.jpg',
'images/jpgklamry/04b_klamra.jpg',
'images/jpgklamry/05b_klamra.jpg',
'images/jpgklamry/06b_klamra.jpg',
'images/jpgklamry/07b_klamra.jpg',
'images/jpgklamry/08b_klamra.jpg',
'images/jpgklamry/09b_klamra.jpg',
'images/jpgklamry/10b_klamra.jpg');


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 zniszczWarstwe(id)
{
  elem = document.getElementById(id);
  if (!elem)
    {
    alert("taka warstwa nie istnieje");
    return;
    }
  document.body.removeChild(elem);
  document.getElementById('screenoverlay').style.visibility = 'hidden';
}



function utworzWarstwe(id, Foto, height, width, visibility, zIndex)
{

var imageObj = new Image();
imageObj.src=Foto;
bheight = height+100;
bwidth = width+50;

xHTML = '<table border="0" cellspacing="0" cellpadding="0" >'+
        '<tr>'+
		    '<td width="25" height="25" background-color=transparent;></td>'+
		    '<td width="'+width+'" height="25" background-color=transparent; align="center";></td>'+
		    '<td width="25" height="25" background-color="transparent";>'+ '<img border="0" src="images/close2.gif" onclick="zniszczWarstwe(\''+id+'\')" style="cursor: pointer" title="Zamknij okno"></td>'+
  		  '</tr>'+
		    '<tr>'+
		    '<td width="25" height="'+height+'" background-color=transparent;></td>'+
		    '<td width="'+width+'" height="'+height+'" background-color=transparent;>'+
		    '<table border="0" width="100%" id="table2" cellspacing="1" cellpadding="0" style="background-image:url(images/loading.gif); background-repeat: no-repeat; background-position:center center; border-style: none" height="100%">'+
		    '<tr><td>'+
		    '<img border="0" src="'+Foto+'" width="'+width+'" height="'+height+'">'+
        '</td></tr>'+
		    '</table>'+
		    '</td>'+
		    '<td width="25" height="'+height+'" background-color=transparent;></td>'+
		    '</tr>'+
		    '</table>';
	if (document.getElementById(id))
      {
      element = document.getElementById(id);
      }
    else
      {
      element = document.createElement('div');
      element.id = id;
      element.name = id;
      element.style.position = 'absolute';
      }

if (window.innerWidth)
{
	theWidth = window.innerWidth
}
else if (document.documentElement && document.documentElement.clientWidth)
{
	theWidth = document.documentElement.clientWidth
}
else if (document.body)
{
	theWidth = document.body.clientWidth
}

      
  element.style.left = ((theWidth / 2) - (width / 2))+'px';
	element.style.top = '50px';//(document.body.scrollTop + (document.body.clientHeight / 2) - (height / 2) - 20)+'px';
	element.style.width = bwidth;
	element.style.height = bheight;
	element.style.zIndex = zIndex;
	element.style.color = '#FFFFFF';
	element.style.backgroundColor = 'transparent';
	element.style.visibility = visibility;
	element.style.clip.height = bheight;
	document.body.appendChild(element);
	document.getElementById(id).innerHTML = xHTML;
		document.getElementById('screenoverlay').style.height =(arrayPageSize[1] + 'px');
	document.getElementById('screenoverlay').style.width =(arrayPageSize[0] + 'px');
	document.getElementById('screenoverlay').style.visibility = 'visible';
}


function tabelka(nr){
if (window.innerWidth)
{
	theWidth = window.innerWidth
}
else if (document.documentElement && document.documentElement.clientWidth)
{
	theWidth = document.documentElement.clientWidth
}
else if (document.body)
{
	theWidth = document.body.clientWidth
}
if (nr<8){
if (theWidth>2300){
rozmt =((theWidth-100)/10);
rozm = 200;
rozmpa = ((((theWidth-100)/10)-200)/2);
}
else if (theWidth<1101){
rozmt =100;
rozm = 84;
rozmpa = 8;

}
else {
rozmt =((theWidth-100)/10);
rozm = ((rozmt/25)*21);
rozmpa = ((rozmt/25)*2);

}


xHTML = '<table border="0" cellspacing="0" cellpadding="0" bgcolor=#0D1213; width="100%"><tr><td bgcolor=#0D1213  width="50px"></td>';
for (i=0;i<10;i++) {
        xHTML = xHTML + '<td width="'+rozmt+'"  bgcolor=#0D1213 style="cursor: pointer; padding-top:30px; padding-bottom:30px; padding-left:'+rozmpa+';padding-right:'+rozmpa+';" align="center" valign="middle">'+
        '<img class="foto" src="'+Fotki[nr][i]+'" alt="" width="'+rozm+'" onClick="utworzWarstwe(\'warstwa\', \''+Foty[nr][i]+'\', 400, 400, \'visible\', 101)" onmousedown="return false" oncontextmenu="return false; window.event.returnValue=false;" onselectstart="return false" onselect="return false" oncopy="return false" ondragstart="return false" ondrag="return false"/>'+
        '</td>';
};        
xHTML =xHTML +'<td bgcolor=#0D1213 width="50px"></td></tr></table>';
document.getElementById('foto').innerHTML = xHTML;
} else{
if (theWidth>2100){
rozm = 2000;
}
else if (theWidth<1101){
rozm = 1000;
}
else {
rozm = (theWidth-100);
}

xHTML = '<table border="0" cellspacing="0" cellpadding="0" bgcolor=#0D1213; width="100%"><tr><td bgcolor=#0D1213  width="50px"></td>';
        xHTML = xHTML + '<td width="'+rozm+'" bgcolor=#0D1213 style="padding-top:20px; padding-bottom:20px;" align="center" valign="middle">'+
        '<img class="foto" src="images/1multi.jpg" alt="" width="'+rozm+'" padding="0" onmousedown="return false" oncontextmenu="return false; window.event.returnValue=false;" onselectstart="return false" onselect="return false" oncopy="return false" ondragstart="return false" ondrag="return false"/>'+
        '</td>';
        
xHTML =xHTML +'<td bgcolor=#0D1213 width="50px"></td></tr></table>';
      //  alert(xHTML);
document.getElementById('foto').innerHTML = xHTML;
}
}

