// JavaScript Document
/********** piwik 1 ******************/
var pkBaseURL = "http://piwik.fsnd.net/";

function callStats()
{
	/*********   FSnD statistics    Copyright:  FSnD(Klaus@FSnD.de)   ************/
	fsnd_statistics = new Image(1,1);
	fsnd_single_page = new Image(1,1);
	fsnd_statistics.src = "http://counter.fsnd.de/add_stats.php?stat_id=10&pwd=eisen"+"&refer="+escape(document.referrer)+"&scrd="+screen.colorDepth+"&scrw="+screen.width+"&doc_url="+document.URL;
	fsnd_single_page.src = "http://counter.fsnd.de/single_page.php?stat_id=10&pwd=eisen&url="+document.URL;
}

var fSetHeight = false;
var iHeight = 0;

function startup()
{
	//debugWrite( 'in startup()' );
	
	//debugWrite( window.innerHeight );
	
	setTopMargin();
	if( fSetHeight )
	{
		setInnertHeight();
	}
}

function setTopMargin()
{
 var mainWrapper = document.getElementById( "mainWrapper" );
 
 	if( mainWrapper != null )
	{
		if( window.innerHeight < 900 )
		{
			mainWrapper.style.marginTop = '0px';
			debugWrite( "set mainWrapper.style.marginTop = '0px';" );
		}
	}
}

function setInnertHeight()
{
 var scrollArea = document.getElementById( "flexscroll" );
 var mainArea = document.getElementById( "main-content" );
 var textContent = document.getElementById( "text-content" );
 
	if( (iHeight > 0) && (scrollArea != null) && (mainArea != null) )
	{
	 var newHeight = iHeight + 'px';
	 
		scrollArea.style.height = newHeight;
		scrollArea.style.marginTop = "5px";
		mainArea.style.height = newHeight;
		textContent.style.height = newHeight;
		scrollArea.style.overflow = 'hidden';
		mainArea.style.overflow = 'hidden';
		textContent.style.overflow = 'hidden';
	}
}

function debugWrite( sText )
{
 var debugArea = document.getElementById( "debugArea" );
	
	if( debugArea != null )
	{
	 var sOldHTML = debugArea.innerHTML;
	 
		debugArea.innerHTML = sOldHTML + '<br>' + sText;
	}
	else
	{
		//alert( "Could not find debug-area" );
	}
}

function callPiwik()
{
	try 
	{
	 var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 3);
	 
	   piwikTracker.trackPageView();
	   piwikTracker.enableLinkTracking();
	} 
	catch( err ) 
	{}
}

callStats();
callPiwik();




