var $j = jQuery.noConflict();

 
$j(document).ready(function() {
/* Referenzen */
	$j(".i_refbilder_li IMG").click(function () { 
      $j("#klein1, #klein2, #klein3").show();
	  $j(this).hide();
	  
	  var mylength = this.id.length;
	  var myID = this.id.substring(mylength-1,mylength);
	  $j("#bild1, #bild2, #bild3").hide();
	  $j("#bild"+myID).fadeIn("normal");
    });
	
	

	
/* aufklappen */ 
	$j("div.klapp_auf").toggle(
		function() {
			$j(this).children(".i_aufklapp_ecke").css("background-image","url(fileadmin/templates/img/aufgeklappt_icon.gif)");
			$j(this).next().show("fast");
		},
	 
		function() {
			$j(this).children(".i_aufklapp_ecke").css("background-image","url(fileadmin/templates/img/aufklapp_icon.gif)");	
			$j(this).next().hide("fast");
		}
	);   
});


function wp_print_fontsizer_de() {
	document.write("<div class=\"s_accessible\">");
	document.write("<span>Schriftgröße:</span> <a href=\"/normal\" onclick=\"setActiveStyleSheet('font100%'); return false;\" id=\"f1\">normal</a>, <a href=\"/gross\" onclick=\"setActiveStyleSheet('font110%'); return false;\" id=\"f2\">groß</a>, <a href=\"/sehr_gross\" onclick=\"setActiveStyleSheet('font120%'); return false;\" id=\"f3\">sehr groß</a> - ");
	document.write("<span>Kontrast:</span> <a href=\"/normal\" onclick=\"desetActiveStyleSheet('kont-no'); return false;\" id=\"f1\">normal</a>, <a href=\"/schwarz/weiß\" onclick=\"desetActiveStyleSheet('kont-sw'); return false;\" id=\"f2\">schwarz/weiß</a>, <a href=\"/invers\" onclick=\"desetActiveStyleSheet('kont-iv'); return false;\" id=\"f3\">invers</a>");
	document.write("</div>");
}

function wp_print_fontsizer_cz() {
	document.write("<span>Velikost písma:</span> <a href=\"/normalni\" onclick=\"setActiveStyleSheet('font100%'); return false;\" id=\"f1\">normální</a>, <a href=\"/velka\" onclick=\"setActiveStyleSheet('font110%'); return false;\" id=\"f2\">velká</a>, <a href=\"/nejvetsi\" onclick=\"setActiveStyleSheet('font120%'); return false;\" id=\"f3\">nejv?tší</a> - ");
	document.write("<span>Kontrast:</span> <a href=\"/normalni\" onclick=\"desetActiveStyleSheet('kont-no'); return false;\" id=\"f1\">normální</a>, <a href=\"/cernobily\" onclick=\"desetActiveStyleSheet('kont-sw'); return false;\" id=\"f2\">?ernobílý</a>, <a href=\"/inverzni\" onclick=\"desetActiveStyleSheet('kont-iv'); return false;\" id=\"f3\">inverzní</a>");
}

/* Styleswitcher Start */
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
	  if(a.getAttribute("title").indexOf("font") != -1) {
	    a.disabled = true;
        if(a.getAttribute("title") == title) a.disabled = false;
	  }
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) {
	  if (a.getAttribute("title").indexOf("font") != -1) return a.getAttribute("title");
	}
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) {
	  if(a.getAttribute("title").indexOf("font") != -1) return a.getAttribute("title");
	}
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

/* Styleswitcher Ende */





/* Designswitcher Start */
function desetActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
	  if(a.getAttribute("title").indexOf("kont") != -1) {
	    a.disabled = true;
        if(a.getAttribute("title") == title) a.disabled = false;
	  }
    }
  }
}

function degetActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) {
	  if (a.getAttribute("title").indexOf("kont") != -1) return a.getAttribute("title");
	}
  }
  return null;
}

function degetPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) {
	  if(a.getAttribute("title").indexOf("kont") != -1) return a.getAttribute("title");
	}
  }
  return null;
}

function decreateCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function dereadCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
  var decookie = dereadCookie("destyle");
  var detitle = decookie ? decookie : degetPreferredStyleSheet();
  desetActiveStyleSheet(detitle);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title );
  var detitle = degetActiveStyleSheet();
  decreateCookie("destyle", detitle );
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

var decookie = dereadCookie("destyle");
var detitle = decookie ? decookie : degetPreferredStyleSheet();
desetActiveStyleSheet(detitle);
/* Designswitcher Ende */
