// Ajax-Features hinzufügen

$(function()
{
	// Tabellenzeilen umfärben:
	$("table.full tr:even").addClass("row1");
	$("table.full tr:odd").addClass("row2");
	
	// Bei Klick auf eine Zeile, wird sie markiert
	var tr = $("table.full tr");
	tr.click(function() {
		$(this).toggleClass("mark");
	});
		
	// Hover-Effeckt für den Tabellenkopf
	var th = $("table.full th");	
	th.mouseover(function() {
		$(this).addClass("thhover");
	});
	
	th.mouseout(function() {
		$(this).removeClass("thhover");
	});
	
	// Hover-Effeckt für die 2., 4., 6. etc. Spalte
	var tr1 = $("table.full tr:even");
	tr1.mouseover(function() {
		$(this).addClass("hover1");
	});
	
	tr1.mouseout(function() {
		$(this).removeClass("hover1");
	});
	
	// Hover-Effeckt für die 1., 3., 5., etc. Spalte
	var tr2 = $("table.full tr:odd");
	tr2.mouseover(function() {
		$(this).addClass("hover2");
	});
	
	tr2.mouseout(function() {
		$(this).removeClass("hover2");
	});
	
	// Druckmanagement
	$("#print").click(function() {
		var head = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>'+ $("head title").text() +'</title><meta http-equiv="Content-type" content="text/html; charset=utf-8" /><link rel="stylesheet" href="<?=base_url()?>css/yaml/core/print_base.css" type="text/css" media="screen, projection" /></head><body onload="javascript:window.print();">';
		var foot = '</body></html>';
		var page = open('', '', 'dependent=yes, left=0, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no, top=0');
		var pageview = page.document;
		var content = $("#col3_content").html();
		pageview.open();
		pageview.write(head + content + foot);		
		pageview.close();
	});

});
