var W3CDOM = (document.createElement && document.getElementsByTagName);
var mouseClick = new Array();

function podmienTop (o) {
	document.getElementById('topDes').src = ''+o;
	return;
}

function mouseGoesClick() {
	this.target = mouseClick[this.number].target;
}

function init() {

    // Dodawanie onclick do wybranych linkow
    var photos = document.getElementsByTagName('a');

    for(i=0; i < photos.length; i++)
    {
        if(photos[i].className == 'img')
        {
            photos[i].onclick = function() {OpenWindow(this.href + '&js=1'); return false;}
        }
        
        if(photos[i].className == 'nw')
        {
            photos[i].onclick = function() {NewWindow(this.href + '&js=1'); return false;}
        }
    }



	if (!W3CDOM) return;
	var nav = document.getElementById('Left');
	var el = nav.getElementsByTagName('A');
	for (var i=0;i<el.length;i++) {
		if (el[i].id=='subNav5') {
			el[i].onclick = mouseGoesClick;
			mouseClick[i] = new Object();
			mouseClick[i].href = el[i].href;
			mouseClick[i].target = '_blank';
			el[i].number = i;
		}
	}
        
}


// Otwieranie nowego okienka z parametrami
function OpenWindow(url)
{
    var Okno = window.open(url,"OpenWindow",'width=200,height=200,top=10,left=10,resizable=0,scrollbars=no,menubar=no,status=no');
}

// Otwieranie nowego okna
function NewWindow(url)
{
    var Okno = window.open(url,"NewWindow");
}

// Zamykanie okienka
function CloseWindow()
{
    var Okno = window.close();
}

// Pokazywanie i ukrywanie elementu
function ViewHide(targetId)
{
    if(document.getElementById)
    {
        target = document.getElementById(targetId);

            if (target.style.display == "none" ) {
                target.style.display = "";

            } else {
                target.style.display = "none";
            }
    }
}

window.onload = init;



