	(function($){

	  $.fn.vCenter = function(options) {

    var pos = {

      sTop : function() {

return window.pageYOffset || $.boxModel && document.documentElement.scrollTop || document.body.scrollTop; 

      },

      wHeight : function() {

if ( $.browser.opera || ($.browser.safari && parseInt ($.browser.version) > 520) ) { return window.innerHeight - (($(document).height() > window.innerHeight) ? getScrollbarWidth() : 0); 

                } else if ( $.browser.safari ) {

                        return window.innerHeight;

                }       else {

return $.boxModel && document.documentElement.clientHeight || document.body.clientHeight; 

        }

      }

    };

    return this.each(function(index) {

      if (index == 0) {

        var $this = $(this);

        var elHeight = $this.height();

        

        $this.css({

          position: 'absolute',

          marginTop: '0',

          top: pos.sTop() + (pos.wHeight() / 2) - (elHeight / 2)

        });

      }

    });

  };



})(jQuery);



(function($){

	  $.fn.hCenter = function(options) {

    var pos = {

      sTop : function() {

return window.pageYOffset || $.boxModel && document.documentElement.scrollTop || document.body.scrollTop; 

      },

      wHeight : function() {

if ( $.browser.opera || ($.browser.safari && parseInt ($.browser.version) > 520) ) { return window.innerWidth - (($(document).width() > window.innerWidth) ? getScrollbarWidth() : 0); 

                } else if ( $.browser.safari ) {

                        return window.innerWidth;

                }       else {

return $.boxModel && document.documentElement.clientWidth || document.body.clientWidth; 

        }

      }

    };

    return this.each(function(index) {

      if (index == 0) {

        var $this = $(this);

        var elWidth = $this.width();

        

        $this.css({

          position: 'absolute',

          marginLeft: '0',

          left: pos.sTop() + (pos.wWidth() / 2) - (elWidth / 2)

        });

      }

    });

  };



})(jQuery);



$(document).ready(function() {

  jQuery.fn.center = function () {

	  this.css("position","absolute");

	  this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");

	  this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");

	  return this;

  }

  jQuery.fn.addBackground = function () {

	  this.css("position","absolute");

	  this.css("width", ( $(window).width() - 668 ) / 2 + "px");

	  return this;

  }

	$("#hintergrund").addBackground();

});



jQuery(function(){

var title = '';

$("span#keyword").each(function(index) { 

  $(this).hover(

  function () 

	  {

	  	title = $(this).attr("title");

			if(title.length == 0) exit;

			$(this).attr('title', function() {

	  			return '';

			});

			//$(this).fadeOut(100);

			//$(this).fadeIn(500);

			
			$(document).bind('mousemove',function(e){ 
				$('div#fbox').css('top', function(index) { return e.pageY+20; });
				$('div#fbox').css('left', function(index) { return e.pageX-20; });
 		 });
 		 
				//alert(parseInt(y) + " ___ " + parseInt(x));	

			var tmp = title;

			if( title.indexOf("#", 0) >= 0 ) {

				$("span#content").before('<img class="tmpimg" src="' + tmp.substring(tmp.indexOf("#", 0)+1,tmp.indexOf("%", tmp.indexOf("#", 0))) + '" />');
				$('table.fbox-table').css('width', function(index) { return 390; });
				tmp = tmp.substring(tmp.indexOf("%",0)+1,tmp.length);	

			}
			else {
				$('table.fbox-table').css('width', function(index) { return 550; });
			}

			$("span#content").text(tmp);

			$('div#fbox').css('visibility', function(index) { return "visible"; });

	  }, 

  function () 

  	  {

			$('div#fbox').css('visibility', function(index) { return "hidden"; });

			$('.tmpimg').remove();

			$(this).attr('title', function() {

	  			return title;

			});

      }

)})});



jQuery(function(){

var title = '';

$("span.keyword").each(function(index) { 

  $(this).hover(

  function () 

	  {

	  	title = $(this).attr("title");

			if(title.length == 0) exit;

			$(this).attr('title', function() {

	  			return '';

			});

	    var browserWidth = $(window).width();
	    var browserHeight = $(window).height();

			$(document).bind('mousemove',function(e){ 
				$('div#fbox').css('top', function(index) { return e.pageY+20; });
				$('div#fbox').css('left', function(index) { return e.pageX-20; });
  		});

			var tmp = title;

			if( title.indexOf("#", 0) >= 0 ) {

				$("span#content").before('<img class="tmpimg" src="' + tmp.substring(tmp.indexOf("#", 0)+1,tmp.indexOf("%", tmp.indexOf("#", 0))) + '" />');

				//alert('<img class="tmpimg" src="' + tmp.substring(tmp.indexOf("#", 0)+1,tmp.indexOf("%", tmp.indexOf("#", 0))) + '" />');
				$('table.fbox-table').css('width', function(index) { return 390; });
				tmp = tmp.substring(tmp.indexOf("%",0)+1,tmp.length);	

			}		
			else {
				$('table.fbox-table').css('width', function(index) { return 550; });
			}
			
			$("span#content").text(tmp);

			$('div#fbox').css('visibility', function(index) { return "visible"; });

	  }, 

  function () 

  	  {

			$('div#fbox').css('visibility', function(index) { return "hidden"; });

			$('.tmpimg').remove();

			$(this).attr('title', function() {

	  			return title;

			});

      }

)})});

$(function() {

$(window).resize(function(){

	$('#hintergrund').addBackground();

});

});
