// JavaScript Document

var showScroll = false;
var mobileSafari = false;
var agent = navigator.userAgent.toLowerCase();
var version = navigator.appVersion.toLowerCase();
var rtl = false;
var useBouncer = false;

// FSnD statistics
fsnd_statistics = new Image(1,1);
fsnd_single_page = new Image(1,1);
fsnd_statistics.src = "http://counter.fsnd.de/add_stats.php?id=83&pwd=translate"+"&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?id=83&pwd=translate&url="+document.URL;

if( ( agent.indexOf('iphone') !=-1 ) || ( agent.indexOf('ipad') !=-1 ) ||
	( version.indexOf('iphone') !=-1 ) || ( version.indexOf('ipad') !=-1 ) )
{
	mobileSafari = true;
	//alert("Mobile Safari!");
}

// language selector
function langSelected( selector )
{
	if( selector.options[selector.selectedIndex].value == '')
	{
	   return;
	}
	else
	{ 
		top.location.replace('http://' + selector.options[selector.selectedIndex].value ); 
	} 
}

var j = jQuery.noConflict();

j(document).ready(function() 
 {
   //alert('Ready!');
   j(function()
	{
	   // this initialises the scollpanes on the page.
	   if( showScroll )
	   {
		   if( mobileSafari )
		   {
		   	   j('#middle-content-text').jScrollTouch();
		   }
		   else
		   {
			   if( rtl )
			   {
				   //alert( "right-to-left is set!" );
				   j('#middle-content-text').jScrollPane({scrollbarOnLeft:true, showArrows:true, scrollbarWidth:16, arrowSize:24, dragMaxHeight:12, scrollbarMargin:5, reinitialiseOnImageLoad:true});
				   
			   }
			   else
			   {
			 		j('#middle-content-text').jScrollPane({showArrows:true, scrollbarWidth:16, arrowSize:24, dragMaxHeight:12, scrollbarMargin:5, reinitialiseOnImageLoad:true});
			   }
		   }
	   }
	   if( useBouncer )
	   {
		   j("#extraBounce").accordion({ autoHeight: false, active: false, collapsable: true, event: 'mouseover', animated: 'bounceslide' });
	   }
	})
 });
/*
window.fbAsyncInit = function() 
{
    FB.init({appId: 'your app id', status: true, cookie: true,
             xfbml: true});
  };
  (function() 
  {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
  */
