// ******************************************************************************
// Global Constants and Variables
// ******************************************************************************

var baseURL         = document.getElementsByTagName('base')[0].href;



function decryptCharcode(n,start,end,offset){
	n=n+offset;if(offset>0&&n>end){n=start+(n-end-1);}else if(offset<0&&n<start){n=end-(start-n-1);}
	return String.fromCharCode(n);
}

function decryptString(enc,offset){
	var dec="";
	var len=enc.length;
	for(var i=0;i<len;i++){
		var n=enc.charCodeAt(i);
		if(n>=0x2B&&n<=0x3A){
			dec+=decryptCharcode(n,0x2B,0x3A,offset);
		}else if(n>=0x40&&n<=0x5A){dec+=decryptCharcode(n,0x40,0x5A,offset);
		}else if(n>=0x61&&n<=0x7A){dec+=decryptCharcode(n,0x61,0x7A,offset);
		}else{dec+=enc.charAt(i);
		}}
	return dec;
}

function linkTo_UnCryptMailto(s){
	location.href=decryptString(s,-3);
}






// ******************************************************************************
var Base = Class.create();
Base.prototype = {

	// ******************************************************************************
	// Constants
	// ******************************************************************************
	Version: '1.0',

	classNames: {
	  xxx : 'footNav-top'
	},

	elmIds: {
	  searchInput : 'searchInput',
	  directAccessSelect : 'directAccessSelect',
	  directAccessSubmit : 'directAccessSubmit',
	  closeLink : 'closeLink',
	  printLink : 'printLink',
	  topLink : 'topLink'
	},

	// ******************************************************************************
	// vars
	// ******************************************************************************
	//ajaxLoadingIconObj: new Object,


	// ******************************************************************************
	// Constructor
	// ******************************************************************************
	initialize: function()
	{
	  if((typeof Prototype=='undefined') || (typeof Element == 'undefined') || (typeof Element.Methods=='undefined') || parseFloat(Prototype.Version.split(".")[0] + "." + Prototype.Version.split(".")[1]) < 1.6)
  	    throw("dieses Script benötigt das Prototype JavaScript framework >= 1.6.0");


	  document.observe('dom:loaded',this.onDomReadyHandler.bind(this), false);
	  Event.observe(window, 'load', this.onLoadHandler.bind(this), false);


	},


	onDomReadyHandler: function()
	{
	  try {
		var pageTracker = _gat._getTracker("UA-7517276-1");
		pageTracker._trackPageview();
	  } catch(err) {}


	  // anchorLink scroller
	  $$('a.anchorLink').each(function(elm){Event.observe(elm, 'click', this.anchorLinkClick.bindAsEventListener(this), false);}.bind(this));


	  // facelift setup
	  // *********************************
	  path = 'fileadmin/webfiles/js/facelift/';
	  if(Prototype.Browser.IE) {
		  path = baseURL + path;
	  }
	  FLIR.init( { path: path } );
	  $$("h2").each( function(el) {FLIR.replace(el, new FLIRStyle({mode:'wrap'}));});
	  $$(".modulContent .tx-dfextensions-pi1 li a span").each( function(el) {FLIR.replace(el, new FLIRStyle({mode:'wrap'} ));});

   	},



	onLoadHandler: function()
	{


   	},





	closeLinkClick : function(ev){
	  ev.stop();
	  window.close();
	},


	anchorLinkClick : function(ev){
	  ev.stop();
	  elm = ev.findElement('a');
	  hash = elm.href.split('#')[1];
	  scrollElm = $$('a[name='+ hash  +']').first();

	  new Effect.ScrollTo(scrollElm);

	},

	// ***********************************************************************************************
	// Dummy end func
	// ***********************************************************************************************
	dummy: function(){
	}
};




myBase = new Base();




