/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* general methods*/
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
var agt = navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ff  = (agt.indexOf("firefox") != -1);
var op = (agt.indexOf("opera") != -1);
var sf    = ((agt.indexOf('applewebkit') != -1) || (navigator.vendor == "Apple Computer, Inc."));


function check(){ alert("JS eingebunden"); }

var agt = navigator.userAgent.toLowerCase();
var mac_ff  = ( (agt.indexOf("firefox") != -1) && (agt.indexOf("macintosh") != -1) );

function create_printLink(){
  if($("html").attr("lang") == "de") var printtxt = "drucken";
	else var printtxt = "print";
	$('<li id="contentService_printLink"><a href="javascript:window.print()" title="Ã¶ffnet den Druckdialog des Browsers">'+printtxt +'</a></li>').prependTo("#contentService .contentService_links ul");

}

function create_printLink2(){
  if($("html").attr("lang") == "de") var printtxt = "drucken";
	else var printtxt = "print";
	$("#contentService .contentService_links").append('<ul><li id="contentService_printLink"><a href="javascript:window.print()" title="Ã¶ffnet den Druckdialog des Browsers">'+printtxt +'</a></li></ul>');
}

function create_commentLink(){
  if(document.getElementById("r4n-comment")){	var commenttxt = $("#r4n-comment h2").html()};
	if(document.getElementById("r4n-comment") && $("*").index( $('#r4n-comment .error')[0] ) < 0){
		$('<li class="send"><a href="#r4n-comment">'+commenttxt+'</a></li>').appendTo("#contentService .contentService_links ul");
		$('#r4n-comment').toggleClass("none");
		$("#contentService .contentService_links ul li.send")
			.click(function(){ 
				 toggleBox("#r4n-comment");
				 toggleActive("#contentService .contentService_links ul li.send a");		
		});
	}else if(document.getElementById("newsletter")){
	  $('<li class="send"><strong>'+comment2txt+'</strong></li>').appendTo("#contentService .contentService_links ul");
	}else if($("*").index( $('#r4n-comment .error')[0] ) > 0){
	  $('<li class="send"><a href="#r4n-comment">'+commenttxt+'</a></li>').appendTo("#contentService .contentService_links ul");
		$("#contentService .contentService_links ul li.send")
			.click(function(){ 
				 toggleBox("#r4n-comment");
				 toggleActive("#contentService .contentService_links ul li.send a");		
		});
	}
}

function create_recommendLink(){
  if($("html").attr("lang") == "de") { var recommendtxt = "versenden"; var recommend2txt = "versendet"; }
	else{ var recommendtxt = "send"; var recommend2txt = "sent"; }
	
	if(document.getElementById("recommend") && $("*").index( $('#recommend .error')[0] ) < 0){
		$('<li class="send"><a href="#recommend">'+recommendtxt+'</a></li>').appendTo("#contentService .contentService_links ul");
		$('#recommend').toggleClass("none");
		$("#contentService .contentService_links ul li.send")
			.click(function(){ 
				 toggleBox("#recommend");
				 toggleActive("#contentService .contentService_links ul li.send a");		
		});
	}else if(document.getElementById("newsletter")){
	  $('<li class="send"><strong>'+recommend2txt+'</strong></li>').appendTo("#contentService .contentService_links ul");
	}else if($("*").index( $('#recommend .error')[0] ) > 0){
	  $('<li class="send"><a href="#recommend">'+recommendtxt+'</a></li>').appendTo("#contentService .contentService_links ul");
		$("#contentService .contentService_links ul li.send")
			.click(function(){ 
				 toggleBox("#recommend");
				 toggleActive("#contentService .contentService_links ul li.send a");		
		});
	}
}

function toggleBox(content){
	$(content).slideToggle("slow",function(){
				$(content).toggleClass("none");
	});
}

function toggleActive(content){
	$(content).toggleClass("active");	
}

function toggleLink(content){
	$(content+" a.closed").remove();
	$(content).prepend('<span id="themes">Mehr Themen</span>');	
}

/*editierte Contentlinks*/

function get_target(t_url){
  var args = 'width=597,height=440,resizable,scrollbars'; 
  ok = window.open(t_url,'',args);
  if (ok) return false;
  else return true;
}

function isLive() {
  if( window.location.hostname.slice(0,3)=='cms' )
     return false;
  return true;
}

$(document).ready(function(){
	// Text zu mehr Link hinzufügen
	$('div.mehr > a img').after("Weiterlesen");

	//create_printLink();
	create_printLink2();
	//create_recommendLink();
	//create_commentLink();
	
});

