$('#js_style').attr("href", "style_script.css");


$(function() {
  if(!$.session("font_size")) $.session("font_size", $('html').css('font-size'));
  else $('html').css('font-size', $.session("font_size"));
  $.session("kontrast", 'false');
  $.session("nur_text", 'false');
});



$(document).ready(function(){
  if($('#suchbegriff').val()==''){ 
   $('#suchbegriff').val('Ihr Suchbegriff..');
  };
  $('a').focus(function(){
     $(this).blur();
    });
    
  $('#suchbegriff').focus(function(){
   if($(this).val()=='Ihr Suchbegriff..'){
    $(this).val('');
   }   
  });    
  
  $('#suchbegriff').blur(function(){
   if($(this).val()==''){  
    $(this).val('Ihr Suchbegriff..');
   }
  });      
    
  $('#oa_news').fadeIn("slow"); 
  $('#bookmarks').fadeIn("slow");


  // Increase Font Size
  //$('.horizontal_navigation').css('font-size', '1.0em');  
  $(".bigger").click(function(){
  
    var currentFontSize = $('html').css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = eval(currentFontSizeNum + 2);
    
   $("html[id!='color_navigation']").css('color', 'white');
   $("html[id!='color_navigation']").css('background-color', 'black');
    
	if ( newFontSize < 22 ) {
	 $("html[id!='color_navigation']").css('font-size', newFontSize);
   $.session("font_size", newFontSize+"px");
	}	

	//if(newFontSize<"20"){
	//alert(newFontSize);
	// $('.horizontal_navigation').css('font-size',newFontSize);
  //}
  //alert('test');
    return false;
  });
  // Decrease Font Size
  $(".smaller").click(function(){
    var currentFontSize = $('html').css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = eval(currentFontSizeNum - 2);
    
   $("html[id!='color_navigation']").css('color', 'white');
   $("html[id!='color_navigation']").css('background-color', 'black');
    
  	if ( newFontSize > 14 ) {
    	$('html').css('font-size', newFontSize);
    	$.session("font_size", newFontSize+"px");
  	}
    return false;
  });
  
  
  // Kontrast
  $(".kontrast").click(function(){

   if($.session("kontrast")=='false')
   {
     $("div").css('color', 'white');
     $("a").css('color', 'white');
     $("p").css('color', 'white');
     $("span").css('color', 'white');
     $("strong").css('color', 'white');
     $("b").css('color', 'white');
     $("h1").css('color', 'white');
     $("td").css('color', 'white');
     $("th").css('color', 'white');
     $("div").css('background', 'black');
     $("table").css('background', 'black');
     $("td").css('background', 'black');
     $("th").css('background', 'black');
     $("h1").css('background', 'black');
     $.session("kontrast", 'true')
   }
   else document.location.reload();
    return false;
   });

  // Kontrast
  $(".nur_text").click(function(){
   if($.session("nur_text")=='false')
   {
     $("link").attr('href', 'includes/css/no_style.css');
     $("div").css('background', 'white');
     $("div").css('text-align', 'left');
     $("table").css('background', 'white');
     $("td").css('background', 'white');
     $("th").css('background', 'white');
     $("h1").css('background', 'white');
     
     $.session("nur_text", 'true');
   }
   else document.location.reload();
    return false;
   });
   
});


