var cols = 3; // Bilder-Spaltenvar MIN_WIDTH = 714; // vgl. width #contentPanel layout.css var MAX_WIDTH = 935;var NAVSPACE = 186; // Platz, den die Navigation einnimmtvar resizeTimer = null;var activeProject; // speichert das momentan aktive Projekt für quicknav.swfvar versionIE; // IE-Versionvar page;/******************************************************************************* Preload Images------------------------------------------------------------------------------*/jQuery.preloadImages = function() {  for(var i = 0; i<arguments.length; i++)  {    jQuery("<img>").attr("src", arguments[i]);  }}$.preloadImages("images/internalLink_0.gif", "images/internalLink_1.gif", "images/externalLink_0.gif", "images/externalLink_1.gif", "images/internalLink_small_0.gif", "images/internalLink_small_1.gif", "images/mailLink_0.gif", "images/mailLink_1.gif", "images/mailLink_small_0.gif", "images/mailLink_small_1.gif", "images/bt_openVideo_de_0.gif", "images/bt_openVideo_de_1.gif", "images/bt_openWeb_de_0.gif", "images/bt_openWeb_de_1.gif", "images/bt_openVideo_en_0.gif", "images/bt_openVideo_en_1.gif", "images/bt_openWeb_en_0.gif", "images/bt_openWeb_en_1.gif", "images/slideimageLink_0.png", "images/slideimageLink_1.png");/******************************************************************************* Wird nach erstmaligem Seitenaufruf ausgeführt------------------------------------------------------------------------------*/$(document).ready( function() {        $.historyInit (pageload); // callback-Funktion pageload an jquery.historyCallback übergeben  resizeContentPanel(); // erstmalig ausführen  window.onresize = function() { handleWindowResize(); }     // Schriftgrad anpassen, falls Calibri nicht installiert    $(function(){        var detector = new FontDetector();    if (!detector.test("Calibri"))      $("body").addClass("notCalibri" );     });    versionIE = getInternetExplorerVersion();  /*  // Zeiten für Sonnenaufgang und -untergang ermitteln (s. sunrise.js);  var arrSunrise = getSunrise();   // falls Werte ausserhalb regulärer Grenzen, durch Standard ersetzen  if ((4.5 <= arrSunrise[0] <= 8.5) && (15.5 <= arrSunrise[1] <= 22.5)) {  } else {    arrSunrise[0] = 7;    arrSunrise[1] = 20;  }  */  var url;    url = "swf/headerContainer_de.swf";  // Header swfObject laden  var flashvars = {        //sunrise: arrSunrise[0],    //sunset: arrSunrise[1]    sunrise: 7,    sunset: 20  };  var params = {    wmode: "transparent" // wichtig, da swf sonst lightbox ueberlagert  };  var attributes = {};  swfobject.embedSWF (url, "headerSwf", "100%", "235", "9.0.0","swf/expressInstall.swf", flashvars, params, attributes);     // OnRollOver für Quicknav alt	$("img.btStripe").hover ( function() {    var srcHi = $(this).attr("src").replace('_lo',''); // Pfad anpassen    $(this).attr("src", srcHi);  }, function() {    var strBefore = $(this).attr("src").slice($(this).attr("src").lastIndexOf('.'));    var srcLo = $(this).attr("src").replace(strBefore, '_lo'+strBefore); // Pfad anpassen  	$(this).attr("src", srcLo);  });});/******************************************************************************* pageload-Function------------------------------------------------------------------------------*/// This function is called when:// 1. after calling $.historyInit();// 2. after calling $.historyLoad();// 3. after pushing "Go Back" button of a browserfunction pageload (hash) {  // für IE6 darf der Aufruf der Projekte nicht als "href='content.php?project=*'" erfolgen, da jquery.history sonst bei historyCheck zurückspringt, daher der workaround unten über url, data  var url = "php/content.php";   var data = hash;  // wenn andere Seite als content.php aufgerufen wurde, beginnt hash mit "http:"  if (hash.slice(0,3) == "php")   {    url = hash;    data = "";    if (url.split("&")[1])     {      data = url.split("&")[1];      url = url.split("&")[0];    }    activeProject = (hash.split("php/")[1]).split(".php")[0];  }     else  {   	// Abfrage, ob querystring übergeben wurde, falls ja project auslesen    if (hash.split("=")[0] == "project")       activeProject = hash.split("=")[1];    else      activeProject = "content";  }      //////////////////////////////////////////////////////////////////////////  // überprüfen, ob Query "lang" vorhanden ist, falls ja hidden-field setzen  // ABFRAGE SPRACHE GEÄNDERT  if (hash.split("&lang=")[1] && ($("#inputLang").attr ("value") != hash.split("&lang=")[1]))   {      $("#inputLang").attr ("value", hash.split("&lang=")[1]);      $("#headerSwf").attr ("data", "swf/headerContainer_" + hash.split("&lang=")[1] + ".swf");      }    //////////////////////////////////////////////////////////////////////////    // falls data nicht ohnehin schon qp Lang beinhaltet, diesen übergeben  if (data.indexOf ("&lang=") == -1)    data = data + "&lang=" + $("#inputLang").attr ("value");    //alert("url: "+url);  //alert("data: "+data);    // Ajax -> httpRequest  if (hash) {   // Seitenaufruf über Hyperlink oder Back-Button	 $.ajax ({      url: url,      data: data,      dataType: "html",      success: handleHttpRequestComplete    })  	} else {			// erster Seitenaufruf		$.ajax({      url: "php/content.php",      data: data,      dataType: "html",      success: handleHttpRequestComplete    }) 	}}function doHttpRequest (hash) {    hash = hash.replace(/^.*#/, '');	$.historyLoad (hash); }/******************************************************************************* Alle Funktionen, die aufgerufen werden sollen, wenn content.php neugeladen wurde------------------------------------------------------------------------------*/function handleHttpRequestComplete (html) {  // Inhalt schreiben  document.getElementById("contentPanelInner").innerHTML = html;    // Breite und Höhe des ContentPanels anpassen  resizeContentPanel();     // OnClick Events für Hyperlinks	$("a[@rel='history'],area[@rel='history']").click ( function() {	  doHttpRequest (this.href); 		return false;	});		// Aktives Projekt an quicknav.swf übergeben  sendToActionScript ();   // Abfrage Headline   switch ($("h1").attr("id")) {      // ÜBER MEDIENMOGUL     case "about":        page ="about";        // png-fix    $(document).pngFix();        var src0 = "images/slideimageLink_0.png";    var src1 = "images/slideimageLink_1.png";    var h1 = 65; // min Höhe slideImage    var h2 = 188; // max Höhe slideImage        // OnRollOver Events für SlideImage Button  	$(".slideImage img, .slideImage span").hover ( function() {            var src;            // Browserweiche wegen png-fix      if (versionIE == 6.0)       {   	     src = $(this).css("filter");  	     var filterSrc0 = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + src0 + '\', sizingMethod=\'scale\');';  	     var filterSrc1 = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + src1 + '\', sizingMethod=\'scale\');';      } else {   	     src = $(this).attr("src");      }        	  src = src.substr(src.indexOf('images'),src0.length); // absoluten Pfad beschneiden      if ($(this).parent().height() == h1) {    	  $(this).parent().animate({height: h2}, "slow");    	  if (versionIE == 6.0)     	    $(this).css("filter", filterSrc1);        else          $(this).attr("src", src1);    	  return false;    	} else {    	  $(this).parent().animate({height: h1}, "slow");    	  if (versionIE == 6.0)     	    $(this).css("filter", filterSrc0);        else          $(this).attr("src", src0);      }    }, function() {    	  return false;    });        //KLUDGE: toggle mit doppelter Funktionsdefinition statt click, da sonst redirect erfolgt    // OnClick Events für Textbutton read more  	$("a[@rel='readmore']").toggle ( function() {        	  $(this).next().slideDown("slow");   	  $(this).next().children("a").show();   	  $(this).hide();  	},function(){      $(this).next().slideDown("slow");       $(this).next().children("a").show();   	  $(this).hide();    });    // OnClick Events für Textbutton read less  	$("a[@rel='readless']").toggle ( function() {  	  $(this).parent().hide();   	  $(this).parent().prev("a").show();  	  $(this).hide();  	},function(){      $(this).parent().hide();   	  $(this).parent().prev("a").show();  	  $(this).hide();    });        break;        // IMPRESSUM    case "imprint":        page ="imprint";    break;        // ARBEITSPROBEN / PROJEKTE    default:        page ="default";        // Stern-Grafiken tauschen    if (versionIE == 6.0)   	           $(".btNew").attr("src", "images/btNew.gif");          // Browser-Weiche wg. Problem Transparenz in IE8 Beta    if (versionIE > 7.0) {      $("#contentPanel .imgInfo").hide();      $("#contentPanel .imgWrapper").hover(function() {        $(this).children(".imgInfo").show();      },function() {   		         $(this).children(".imgInfo").hide();      });       } else {            // Fade für alle anderen Browser           $(".imgInfo").hover(function() {        $(this).fadeTo(1, 0.9);       },function() {   		         $(this).fadeTo(1, 0);       });       }         // Rollover für ImageButtons		$(function() {      $("img.imgButton").hover(function() {  				this.src = this.src.replace("_0","_1");  		}, function() {  				this.src = this.src.replace("_1","_0");  		});  	});        // Click des <a>-Tags für div ausführen, damit Hyperlink auch ausserhalb der Textboxen im <a>-Tag funktioniert    $("#contentPanel .imgInfo").click(function() {          $(this).children("a").click();    });        // lightbox    $("#contentPanel a[@rel='lightbox']").lightBox();     $("#contentPanel a[@rel='lightbox-swf']").lightBox();     } }/******************************************************************************* Aktives Projekt an quicknav.swf übergeben------------------------------------------------------------------------------*/function sendToActionScript() {  if (thisMovie("quicknavSwf").sendToActionScript)    thisMovie("quicknavSwf").sendToActionScript("project="+activeProject);}// wird benötigt von sendToActionScriptfunction thisMovie(movieName) {  if (navigator.appName.indexOf("Microsoft") != -1) {    return window[movieName];  } else {    return document[movieName];  }}    /******************************************************************************* Fensterbreite ermitteln------------------------------------------------------------------------------*/ function getWindowWidth() {  if (window.innerWidth) {    return window.innerWidth;  } else if (document.body && document.body.offsetWidth) {    return document.body.offsetWidth;  } else {    return 0;  }}/******************************************************************************* Fensterhöhe ermitteln------------------------------------------------------------------------------*/ function getWindowHeight() {  if (window.innerHeight) {    return window.innerHeight;  } else if (document.body && document.body.offsetHeight) {    return document.body.offsetHeight;  } else {    return 0;  }}/******************************************************************************* Eventhandler Window Resize------------------------------------------------------------------------------*/ function handleWindowResize() {   if (resizeTimer) clearTimeout(resizeTimer);   resizeTimer = setTimeout(resizeContentPanel, 100);}function resizeContentPanel() {   var w = getWindowWidth();  var h = getWindowHeight();    // Anzahl der Spalten im ContentPanel der Fensterbreite anpassen  if (w >= 1150 && cols != 4) {    cols = 4;    $("#contentPanel").width (MAX_WIDTH);    $("#contentwrapper").width (NAVSPACE+MAX_WIDTH);  }  if (w <= 1150 && cols != 3) {    cols = 3;    $("#contentPanel").width (MIN_WIDTH);    $("#contentwrapper").width (NAVSPACE+MAX_WIDTH);  }  var imgUrl = "url(images/contentPanel_fauxColumn_"+cols+".gif)";  $("body").css({backgroundImage: imgUrl}); }/******************************************************************************* Font Detector (Schriftgrad anpassen, falls Calibri nicht installiert)------------------------------------------------------------------------------*//* http://www.lalit.org/lab/fontdetect.php */var FontDetector = function() {  var h = document.getElementsByTagName("body")[0];  var d = document.createElement("div");  var s = document.createElement("span");  d.appendChild(s);  d.style.display = "inline"; //FR: zur Sicherheit auf inline setzen, damit nicht falsch geerbt wird  d.style.fontFamily = "serif";    //font for the parent element DIV.  s.style.fontFamily = "serif";    //serif font used as a comparator.  s.style.fontSize   = "72px";      //we test using 72px font size, we may use any size. I guess larger the better.  s.innerHTML        = "mmmmmmmmmml";    //we use m or w because these two characters take up the maximum width. And we use a L so that the same matching fonts can get separated  h.appendChild(d);  var defaultWidth   = s.offsetWidth;    //now we have the defaultWidth  var defaultHeight  = s.offsetHeight;  //and the defaultHeight, we compare other fonts with these.  h.removeChild(d);  function test(font) {    h.appendChild(d);    var f = [];    f[0] = s.style.fontFamily = font;  // Name of the font    f[1] = s.offsetWidth;        // Width    f[2] = s.offsetHeight;        // Height    h.removeChild(d);    font = font.toLowerCase();    if (font == "arial" || font == "serif") {      f[3] = true;  // to set arial and serif true    } else {      f[3] = (f[1] != defaultWidth || f[2] != defaultHeight);  // Detected?    }    return f[3];  }  this.test = test;}/******************************************************************************* Browser Detector (wg.IE8 Beta)------------------------------------------------------------------------------*/function getInternetExplorerVersion()// Returns the version of Internet Explorer or a -1// (indicating the use of another browser).{  var rv = -1; // Return value assumes failure.  if (navigator.appName == 'Microsoft Internet Explorer')  {    var ua = navigator.userAgent;    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");    if (re.exec(ua) != null)      rv = parseFloat( RegExp.$1 );  }  return rv;}
