function showImage(src, width, height) {
       
       w=0;
       h=0;
       w = width + 40;
       h = height + 40;
		
        var Win = window.open('image.php?src='+src+"&width="+width+"&height="+height, "displayWindow",'width=' + w + ',height=' + h + ',resizable=0,scrollbars=yes,menubar=no' );
}

function favorite() 
{
	if(window.opera && window.print)
	{ 
		var mbm = document.createElement('a');
		mbm.setAttribute('rel', 'sidebar');
		mbm.setAttribute('href',  document.location.href);
		mbm.setAttribute('title', document.title);
		mbm.click();
	}
	else
	if(document.all)
	{
		window.external.AddFavorite(document.location.href, document.title);
	}
	else
	if(window.sidebar) 
	{ 
		window.sidebar.addPanel(document.title, document.location.href, ""); 
	}
}

function changeActivity(id) {
	
	var el = document.getElementById(id);
	
	if(el.className=='inputF') 
		el.className='inputFActive';
	else
	if(el.className=='inputFActive')
		el.className='inputF';
}

function changeClassActive(id) {
	
	var el = document.getElementById('row_'+ id);
	var nag = document.getElementById('nag_'+ id);
	
	if(el.style.display == '')
	{
		nag.className = 'activeSelected';
	}
	else
	{
		nag.className = 'active';
	}
}

function changeClassNoActive(id) {
	
	var el = document.getElementById('row_'+ id);
	var nag = document.getElementById('nag_'+ id);
	
	if(el.style.display == '')
	{
		nag.className = 'activeSelected';
	}
	else
	{
		nag.className = 'noactive';
	}
}

function showRow(id) {
	
	var el = document.getElementById('row_'+ id);
	var nag = document.getElementById('nag_'+ id);
	
	if(el.style.display == 'none') 
	{
		el.style.display = '';
		nag.className = 'activeSelected';
	}
	else
	if(el.style.display == '')
	{
		el.style.display = 'none';
		nag.className = 'noactive';
	}
}

function printSite() {
    window.print();
}

function ChmurkaOn(id,t){
	var ch = document.getElementById('chmurka_'+ id);
	
	if(ch.style.display == 'none') 
	{
		ch.style.display = '';
	}
	else
	if(ch.style.display == '')
	{
	
		ch.style.display = 'none';
	}
}

function ChmurkaOff(id,t){

	var ch = document.getElementById('chmurka_'+ id);
	
	if(ch.style.display == '')
	{
		ch.style.display = 'none';
	}
}

function InfoOn(id,t){
	var el = document.getElementById('info_'+ id);
	
	if(el.style.display == 'none') 
	{
		el.style.display = '';
	}
	else
	if(el.style.display == '')
	{
		
		el.style.display = 'none';
	}
}

function InfoOff(id,t){

	var el = document.getElementById('info_'+ id);
	
	if(el.style.display == '')
	{
		el.style.display = 'none';
	}
}
function showForm ()
{
	$("#contact_form_small").toggle();

}

function close(link){

	var ch = document.getElementById('komunikat');
	
	if(ch.style.display == '')
	{
		ch.style.display = 'none';
		location.href = link;
	}
}

function getPageSizemap() {

	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 getPageScrollmap() {
	var xScroll, yScroll;
	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;	
	}
	arrayPageScroll = new Array(xScroll,yScroll) 
	return arrayPageScroll;
};

