$(document).ready(function() { 
	$(".soft").css("opacity","0.4");
	$(".soft").hover(
		function () {
			$(this).fadeTo(300, 0.9);
		}, 
		function () {
			$(this).fadeTo(300, 0.4);
		}
	);	
	$(".soft2").css("opacity","0.2");
	$(".soft2").hover(
		function () {
			$(this).fadeTo(300, 0.9);
		}, 
		function () {
			$(this).fadeTo(300, 0.2);
		}
	);	
	$("#menu .menu li a").css("opacity","0.6");
	$("#menu .menu li a").hover(
		function () {
			$(this).fadeTo(300, 0.9);
		}, 
		function () {
			$(this).fadeTo(300, 0.6);
		}
	);	
	$("#menu .right a").css("opacity","0.3");
	$("#menu .right a").hover(
		function () {
			$(this).fadeTo(300, 1);
		}, 
		function () {
			$(this).fadeTo(300, 0.3);
		}
	);	
	$(".menutip").css("width",($("#menu ul li a:eq(0)").innerWidth()-10));
	$("#menu .login input[type=text], #menu .login input[type=password], #menu .login input[type=submit]").css("opacity","0.3");
	$("#menu .login :input").tooltip({ 
		position: "bottom center", 
		offset: [2, 5], 
		opacity: 0.7,
		tip: '.ohnet'
	});
	$("#menu .right a[title]").tooltip({ 
		offset: [2, 150], 
		opacity: 0.7,
		tip: '.ohnet'
	});
	$(".showt:input").tooltip({ 
		position: "center right", 
		offset: [-2, 8], 
		opacity: 0.7,
		tip: '.ohnet'
	});
	$(".showtip[title]").tooltip({ 
		position: "bottom right", 
		offset: [-2, -25], 
		opacity: 0.5,
		tip: '.ohnet'
	});
	$('.autoscal').each(function(index) {
		var url = $(this).attr("title");
		var width = $(this).innerWidth();
		var height = $(this).attr("lang");
		$(this).html('<img src="image.php?x='+url+'&w='+width+'&h='+height+'" border="0" alt="" />');
		$(this).attr("title","");
	});
	$(".showtip2").tooltip({ 
		position: "bottom right", 
		offset: [-40, -170], 
		opacity: 0.8
	});
	$(".showtip3").tooltip({ 
		position: "bottom center", 
		offset: [0, 0], 
		opacity: 0.8,
		effekt: 'fade'
	});
	$(".showtip4").tooltip({ 
		position: "bottom right", 
		offset: [-30, -90], 
		opacity: 0.8
	});
	$(".showtip5").tooltip({ 
		position: "bottom right", 
		offset: [-40, -240], 
		opacity: 0.8
	});
	$('.neww').click(function() {
		fenster = window.open($(this).attr("href"));
		return false;
	});
	$(".slider").click(function () {
		$("#"+$(this).attr("href")).slideToggle(400);
		var expa = "toggle-expand.png\")"; var expa2 = "toggle.png\")";
		var akt1 = $(this).parent().css("background-image").substr(-1*(expa.length));
		var akt2 = $(this).parent().css("background-image").substr(-1*(expa2.length));
		if(akt1 == expa) {
			$(this).parent().css("background-image","url(\"webicons/"+expa2)
		} else {
			if(akt2 == expa2) {
				$(this).parent().css("background-image","url(\"webicons/"+expa)
			}	
		}
		return false;
	});
	$('#hakenform').submit(function() {
		var aid = $('#hakenform input[type=hidden]').val();
		$.ajax({
			type: "POST",
			url: "read_abhaken.php",
			data: "id="+aid,
			success: function(msg){
				$('#abhaken').slideUp(600);
			}
		});
		return false;
	});
});