


var klarheit = 100;

function erstelleXMLHttpReqObj() {

// f�r Mozilla etc.
if(window.XMLHttpRequest) {
try { //Fehler abfangen
req = new XMLHttpRequest();
} catch(e) {
req = false;
}
// f�r den InternetExplorer
} else if(window.ActiveXObject) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
req = false;
}
}
}
return req;
}

function ausblenden(id) {
  obj=document.getElementById(id);
  klarheit=klarheit-5;
  obj.style.filter='Alpha(opacity='+klarheit+')';
  var klar=klarheit/100;
  obj.style.MozOpacity=klar;
  if(klarheit>=0){
    setTimeout("ausblenden('"+id+"')",400);
  }else{
    obj.style.visibility="hidden";
  }
}

$('document').ready(function() {
	
	// Zebra Tabelle erstellen
	setZebraTables();
	
	initTips();
	
	// default value für textfelder
	$("input").each(function() {
		if ($(this).attr('defaultValue') !== undefined && $(this).val() == '') {
			$(this).val($(this).attr('defaultValue'));
			$(this).css("color", "#c0c0c0");
		}
	});
	$("input").focus(function(){
		if ($(this).attr('defaultValue') !== undefined) {
			if ($(this).val() == $(this).attr('defaultValue')) {
				$(this).val('');
			}
			$(this).css("color", "#505050");
		}
	});
	
	$("input").blur(function(){
		if ($(this).attr('defaultValue') !== undefined) {
			if ($(this).attr('value') == '') {
				$(this).val($(this).attr('defaultValue'));
				$(this).css("color", "#c0c0c0");
			}
		}
	});
	
//	// H�he des Main divs erh�hen, um es auf die H�he der Module zu bringen
//	var modulesHeight = 0;
//	$(".modul").each(function() {
//		modulesHeight += $(this).height();
//	});
//	if ($("#main").height() < modulesHeight) {
//		$("#main").height(modulesHeight);
//	}
});

function setZebraTables() {
	// Zebra Tabelle erstellen
	$(".zebra tr:nth-child(odd)").css("backgroundColor", "#f1f1f1")
								.css("border-top", "1px solid #c0c0c0")
								.css("border-bottom", "1px solid #c0c0c0");
	
	$(".zebra tr:nth-child(odd)").mouseover(function(event) {
		$(this).css("backgroundColor", "#E7E6E6");
	});
	$(".zebra tr:nth-child(odd)").mouseout(function(event) {
		$(this).css("backgroundColor", "#f1f1f1");
	});
	$(".zebra tr:nth-child(even)").mouseover(function(event) {
		$(this).css("backgroundColor", "#E7E6E6");
	});
	$(".zebra tr:nth-child(even)").mouseout(function(event) {
		$(this).css("backgroundColor", "white");
	});
	
}

function initTips() {
	$(".tip").each(function() {
		$(this).prepend($("<div><img src='img/icon/lightbulb.png' height='20px'></div>"));
	});
}


