function setTab(sender, id) {
	var e = document.getElementById('tabs');
	if (e) {
		var tab = e.getElementsByTagName('div');
		for (var i = 0, j = tab.length; i < j; i++) {
			if (tab[i].className == 'tabs') {
				var lnk = tab[i].getElementsByTagName('a');
				for (var x = 0, y = lnk.length; x < y; x++) {
					lnk[x].className = '';
				}
			} else if (tab[i].className == 'content') {
				var con = tab[i].getElementsByTagName('div');
				for (var x = 0, y = con.length; x < y; x++) {
					if (con[x].id.substr(0, 3) == 'tab') {
						if (con[x].id == 'tab_' + id) {
							con[x].style.display = 'block';
						} else {
							con[x].style.display = 'none';
						}
					}					
				}
			}
		}		
		sender.className = 'active';
	}
}

function setFoto(box, foto) {
	var e = document.getElementById('itemImage_' + box);
	if (e) {
		e.style.backgroundImage = 'url(' + dirPath + 'foto/mini/' + foto + '.jpg)';
	}
}

function showFoto(id) {
	window.open(dirPath+'_foto_window.php?id='+id+'&sze='+screen.width+'&wys='+screen.height, 'Foto', 'menubar=no, toolbar=no, location=no, scrollbars=no, resizable=yes, status=no, width=800, height=60, left=100, top=50');
	return void(0);
}

function getWindowHeight() {
	if( typeof( window.innerWidth ) == 'number' ) {
	   	return window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		return document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		return document.body.clientHeight;
	} else {
		return 0;
	}
}

function getWindowWidth() {
   var myWidth = 0;
   if( typeof( window.innerWidth ) == 'number' ) {
       myWidth = window.innerWidth;
   }
   else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
       myWidth = document.documentElement.clientWidth;
   } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
       myWidth = document.body.clientWidth; }
   return myWidth;
}
