	function showHide(parent_id)
	{
		e=document.getElementById("id"+parent_id);
		
		if (e.style.display=="none" || e.style.display=="")
		{
			e.style.display="block";
		}
		else
		{
			e.style.display="none";
		}
	}
	
	var temp=location.hash;
	
	function loadTopic(topic){
	
	jQuery(document).ready(function($){
		
		$.ajax({
			type: "POST",
			url: "ajax.php",
			data: "topic="+topic,
			success: function (data){
			
				$('a',this).css('color','red');
				$("#content").html(data);
				
				$("#usun").html(	"<a href='index.php?action=delete&amp;id="+topic+"'> usuń stronę </a>"	);
				$("#edytuj").html(	"<a href='index.php?action=edit&amp;id="+topic+"'> edytuj stronę </a>"	);
				$("#dodaj").html(	"<a href='index.php?action=add_into&amp;id="+topic+"'> dodaj stronę </a>"	);
				$("#dodaj-zdjecie").html(	"<a href='index.php?action=add_photo_into&amp;id="+topic+"'> dodaj zdjęcie </a>"	);
				$("#dodaj-art").html(	"<a href='index.php?action=add_intoArt&amp;id="+topic+"'> dodaj artykuł </a>"  );
				$("#dodaj-con").html(	"<a href='index.php?action=add_intoCon&amp;id="+topic+"'> dodaj konkurs </a>"  );
				$("#edytuj-main").html(	"<a href='index.php?action=editMain'> Edytuj główną </a>"  );
				location.hash=""+topic;
			}
		});
		});
	}
	 function check(){
        
        if ( temp != location.hash )
        {
                temp=location.hash;
                reload();
        }
    
        setTimeout('check()', 300);
    }
    
    
    function reload(){
    
        if ( location.hash != "" )
        {
            str=location.hash;
            strhash=str.substr(0, 1);
            
            if ( strhash == "#" )
            str=str.substr(1);
            
            loadTopic(str);        
        }
    }
    reload();
    check();
	
