function showCommentBox(aID){
	if(document.getElementById('commentbox'+aID).style.display==""){
		document.getElementById('commentbox'+aID).style.display="none";
	}else{
		document.getElementById('commentbox'+aID).style.display="";
	}
}

function addComment(aID,e){
	
	//sprawdzanie klawisza
	getEvent=e.keyCode;
	if (getEvent == "13") {
	var pContent = document.getElementById('comment'+aID).value;
	
	
	var pFile = "/pageactions.php?action=addwallcomment&content="+pContent+"&id="+aID;
	var pAjax = false;
		if(window.XMLHttpRequest){
			pAjax = new XMLHttpRequest();
			
		}else if(window.ActiveXObject){
			pAjax = new ActiveXObject("Microsoft.XMLHTTP");
		}//if
		

		pAjax.open("GET",pFile);


		pAjax.onreadystatechange = function(){
			if(pAjax.readyState == 4 && pAjax.status == 200){
				//alert(pAjax.responseText);
				window.location.reload();
			}
		}
		pAjax.send(null);
	}//if
}

function przybijLape(aType,aID){
	
	
	var pFile = "/pageactions.php?action=przybijlape&type="+aType+"&id="+aID;
	var pAjax = false;
		if(window.XMLHttpRequest){
			pAjax = new XMLHttpRequest();
			
		}else if(window.ActiveXObject){
			pAjax = new ActiveXObject("Microsoft.XMLHTTP");
		}//if
		

		pAjax.open("GET",pFile);


		pAjax.onreadystatechange = function(){
			if(pAjax.readyState == 4 && pAjax.status == 200){
				//alert(pAjax.responseText);
				window.location.reload();
			}
		}
		pAjax.send(null);
	
}

function showTab(aName){
	document.getElementById('statustab').style.display="none";
	document.getElementById('linktab').style.display="none";
	document.getElementById('zdjecietab').style.display="none";
	document.getElementById('filmtab').style.display="none";
	
	document.getElementById(aName).style.display="";
}
function showOtherStemps(aID){
	if(document.getElementById("comm_"+aID).style.display==""){
		document.getElementById("comm_"+aID).style.display="none";
	}else{
		document.getElementById("comm_"+aID).style.display="";
	}
}
function showOtherStemps2(aID){
	if(document.getElementById("comm2_"+aID).style.display==""){
		document.getElementById("comm2_"+aID).style.display="none";
	}else{
		document.getElementById("comm2_"+aID).style.display="";
	}
}

function removeWallRecord(aID){
	if(confirm('Usunąć wpis?')){
		window.location.replace("pageactions.php?action=removewallrecord&id="+aID);
	}
}
$(document).ready(function(){
	$("#rozwin").click(function(event){
		
		for(k=0;k<pTotalWall;k++){
			$("#row_"+k).show();
		}
		event.preventDefault();
	});
	
	$("#zwin").click(function(event){
		
		for(k=0;k<pTotalWall;k++){
			if(k>10){
			$("#row_"+k).hide();
			}
		}
		$("#walltable").children("tr").hide();
		event.preventDefault();
	});
});
