// Cufon
Cufon.replace('#statistik');
Cufon.replace('.boxtitel16');
Cufon.replace('.boxtitel18');
Cufon.replace('.ui-tabs-nav li span');
Cufon.replace('.ui-tabs-panel h3');
Cufon.replace('.datum-tag');



// Text resize Buttons
var sitefunctions = {
	textresize : function(){
	
		  // Make Buttons clickable
  
		// show text resizing links
		$(".FontSize").show();
		var $cookie_name = "PressBot-FontSize";
		var originalFontSize = $("html").css("font-size");
		// if exists load saved value, otherwise store it
		if($.cookie($cookie_name)) {
			var $getSize = $.cookie($cookie_name);
			$("html").css({fontSize : $getSize + ($getSize.indexOf("px")!=-1 ? "" : "px")}); // IE fix for double "pxpx" error
		} else {
			$.cookie($cookie_name, originalFontSize);
		}
		// reset link
		$(".resetFont").bind("click", function() {
			$("html").css("font-size", originalFontSize);
			$.cookie($cookie_name, originalFontSize);
		});
		// text "+" link
		$(".increaseFont").bind("click", function() {
			var currentFontSize = $("html").css("font-size");
			var currentFontSizeNum = parseFloat(currentFontSize, 10);

			if (currentFontSizeNum >= 20) {
			var newFontSize = currentFontSizeNum;
			}
			else {
			var newFontSize = currentFontSizeNum*1.1;
			}
			if (newFontSize, 11) {
				$("html").css("font-size", newFontSize);
				$.cookie($cookie_name, newFontSize);
			}

			return false;	
		});
		// - link
		$(".decreaseFont").bind("click", function() {
		var currentFontSize = $("html").css("font-size");
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		if (currentFontSizeNum <= 12) {
		var newFontSize = currentFontSizeNum;
		}
		else {
		var newFontSize = currentFontSizeNum*0.9;
		}
		if (newFontSize, 11) {
			$("html").css("font-size", newFontSize);
			$.cookie($cookie_name, newFontSize);
		}
		return false;
		});
		
		$(".decreaseFont").hover( function() { $(this).css("background-position","bottom left"); } , function() { $(this).css("background-position","top left"); });
		$(".resetFont").hover( function() { $(this).css("background-position","bottom left"); } , function() { $(this).css("background-position","top left"); });
		$(".increaseFont").hover( function() { $(this).css("background-position","bottom left"); } , function() { $(this).css("background-position","top left"); });
	}
}



 
$(document).ready(function(){

		//Newsticker sichtbar machen
		$('#newsticker').css('display','block');
		
		sitefunctions.textresize();	// Text resize
		
		$("#visitenkartentabs").tabs(); // Visitenkarte Tabs
		
		//FancyBox
		$("div.imagebox a").fancybox({'overlayOpacity':0.7,'imageScale':true});
		//{'overlayShow': true, 'overlayOpacity':0.8}
		$("a.article-downloads-piclink").fancybox({'overlayOpacity':0.7,'imageScale':true});
		



		// PRINT Icon bei einem Artikel
		$('.articlemeta').append('<br/><br/><a href="#print" id="print" title="Diesen Artikel drucken"><img src="default2/images/icon-printer.png" alt="Diesen Artikel drucken"/></a>');
		$('a#print').click(function() {
		window.print();
		return false;
		});

})
