clicked = 0;
function page( id, target, click )
{
	if( typeof target == "undefined" ) target = "content";
	genContent( "id=" + id, target );
	if( typeof parent == "undefined" || typeof parent.walker == "undefined" ) return;
	if( typeof click == "undefined" )
	{
		clicked++;
		var loc = "walk.php?page=" + id + "&clicked=" + clicked + '&' + bfrAdm;
		parent.walker.location.href=loc;
	}
	else
	{
		clicked = click;
	}
}
function genSidebar( )
{
	if( at.treemotion.CMS.backend )
		admReset();
	at.treemotion.CMS.clean( 'sidebar' );
	Element.update( 'sidebar', loadingCode );
	new Ajax.Updater(
		'sidebar',
		'sidebar' + mode + '.php',
		{
			method: "get",
			evalScripts: true
		}
	);				
}
function updateRelated( type )
{
	genSidebar();
}

function genContent( params, target )
{
	if( typeof target == "undefined" ) target = "content";
	if( at.treemotion.CMS.backend )
		at.treemotion.CMSAdm.reset();
	at.treemotion.CMS.clean( target );
	Element.update( $( target ), at.treemotion.CMS.loadingCode );
	params += '&tag=' + target;
	new Ajax.Updater(
		target,
		'content.php',
		{
			parameters: params,
			method: "post",
			evalScripts: true
		}
	);				
}
var bfrAdm = '';
function init()
{
	inited = true;
	if( typeof parent == "undefined" || typeof parent.walker == "undefined" ) return;
	if( typeof parent.walker.counter == "undefined" )
	{
		//activateSection(76);
	}
	else parent.walker.req();
}