	
	jQuery.noConflict();
	
  /* ------------------------------ */
  // general eventhandler
  jQuery("#col2").ready(function () {
      startContentPaging();
	  setFAQLinks();
  });
  /* ------------------------------ */
   
  // global variables
  var minPage = 1;
  var maxPage = 0;
  var pagingNav;
  var currPage;
  var isFAQ = false;
  var contentContainer = [];
  var contentIdPrefixSimple = "content-page-";
  var contentIdPrefix = "#" + contentIdPrefixSimple;
  var contentPageWidth = (564+18+200)+"px";
  var slideDuration = 500;
  
  function hideContentNavigationInfo( pageNr ) {

    pagingNav.html("");
    window.setTimeout( "showContentNavigationInfo("+pageNr+")", slideDuration*2 );
  }
  // generates the prev/next links and the currPage/maxPage index
  function showContentNavigationInfo ( pageNr ) {
	var htmlContent = "";
    
	pagingNav.css("position", "static");
	pagingNav.css("top", "0");

	if (isFAQ && (pageNr > 2))
	{
		htmlContent += '<a href="#" onclick="newContentPage(1); return false;">Zur&uuml;ck zur &Uuml;bersicht</a><br />';
		
		pagingNav.css("position", "relative");
		pagingNav.css("top", "-12px");
	}
    
	htmlContent += "Seite " + pageNr + " / " + maxPage;
    htmlContent += "<br />";
	
    if (pageNr > minPage)
    {
      htmlContent += '<a href="#" onclick="newContentPage(' + (pageNr - 1) + '); return false;">&lt;</a> &nbsp;';
    }
    else
    {
      htmlContent += "&nbsp;&nbsp;";
    }
    
    if (pageNr < maxPage)
    {
      htmlContent += '<a href="#" onclick="newContentPage(' + (pageNr + 1) + '); return false;">&gt;</a> &nbsp;';
    }
    else
    {
      htmlContent += "&nbsp;&nbsp;";
    }
    

    pagingNav.html(htmlContent);
  }
  
  // basic functions when changing the page
  function newContentPage ( pageNr )
  {
    if ((pageNr < minPage) || (pageNr > maxPage)) 
    {
      return false;
    }
    
    hideContentNavigationInfo( pageNr );
    showContentPage( pageNr, currPage );
    currPage = pageNr;
  }
  
  // actually shows a content page and hides others
  // error handling in newContentPage()
  function showContentPage ( newPage, prevPage )
  {      
    //alert("From: "+prevPage+"\nTo: "+newPage);
    if (newPage == prevPage) {
      return false;
    } 
    else if (newPage > prevPage) // step forward
    {
      jQuery( contentContainer[prevPage] ).animate( 
      {
        "right": contentPageWidth
      },
      {
        duration: slideDuration,
        complete: function () 
        { 
          jQuery( contentContainer[prevPage] ).hide();
          jQuery( contentContainer[newPage] ).css("right", "-"+contentPageWidth);
          jQuery( contentContainer[newPage] ).show();
          jQuery( contentContainer[newPage] ).animate(
            {
              "right": "0px"
            },
            {
              duration: slideDuration
            }
          );
        }
      });
    }
    else // step back
    {
      jQuery( contentContainer[prevPage] ).animate( 
      {
        "right": "-"+contentPageWidth
      },
      {
        duration: slideDuration,
        complete: function () 
        { 
          jQuery( contentContainer[prevPage] ).hide();
          jQuery( contentContainer[newPage] ).css("right", contentPageWidth);
          jQuery( contentContainer[newPage] ).show();
          jQuery( contentContainer[newPage] ).animate(
            {
              "right": "0px"
            },
            {
              duration: slideDuration
            }
          );
        }
      });
    }
    
  }
    
  // --------------------------------------------------------------------

  // Some basic start functions like hiding the later pages etc..
  function startContentPaging () {
    pagingNav = jQuery('#contentNavigation'); 
    currPage = 1;
    prevCurrPage = 1;
    maxPage = getMaxPage();


	if (maxPage <= 1)
	{
		return false;	
	}
    showContentNavigationInfo( currPage );
 
 
 
    // dont hide the first content page
    for (var i = 2; i < contentContainer.length; i++)
    {
      jQuery( contentContainer[i] ).hide();
      jQuery( contentContainer[i] ).css("position", "absolute");
    }
    jQuery( contentContainer[minPage] ).css("position", "absolute");
  }
  
  // Gets the maximum page number available
  function getMaxPage () 
  {
	var container = jQuery('.innerMainContent div[id^="'+contentIdPrefixSimple+'"]');
	
	if (container == null)
	{
		return false;	
	}
	
	for (var i = 0; i < container.length; i++)
	{
		contentContainer[i+1] = "#" + container[i].id;
	}
	
    return container.length;
  }
  
  function setFAQLinks ()
  {
    // check if it is the faq page
    if ((jQuery('#isFAQ') == null) || (jQuery('#isFAQ').length == 0))
    {
        return false;
    }


	isFAQ = true;
	jQuery('.faq_link').each(
		function ()
		{
			var linkDestination = jQuery(this).attr("href");
  			var destinationPieces = linkDestination.split("/");
            destinationPieces = destinationPieces.pop();
            destinationPieces = destinationPieces.split("#");
			var destination = "#" + destinationPieces[ destinationPieces.length - 1 ];
			var destinationPageNr = getPageToId( destination );
			jQuery(this).click( function () { newContentPage(destinationPageNr); return false; } );
		}
	);
  }
  
  function getPageToId ( pageID )
  {
	  for (var i = 0; i < contentContainer.length; i++)
	  {
			if (contentContainer[i] == pageID)
			{
				return i;	
			}
	  }
	  return 1;
  }
  
  /* ----------------------------------------------------------------------------------------------------------- */
  
  // Manipulating the font-size
  function changeFontSize ( fontSize )
  {
    // remove the previous css-class
    jQuery("body").removeAttr("class");
    
    if ((fontSize == "normal") || (fontSize == "small") || (fontSize == "big"))
    {
      addCSS = "font_" + fontSize;
    }
    else
    {
      addCSS = "font_normal";
    }
    
    jQuery("body").attr("class", addCSS);

    return false;
  }